Skip to content

Faq Tinted

FAQ by topic: three big pastel topic buttons (emoji + label) switch the list of white Q&A cards below, which fades in on change.

soft-flat/section/faq-tinted
Open ↗

Source

"use client";

import { useState } from "react";
import { cn } from "@/lib/utils";

export interface FaqTintedProps {
  title?: string;
  topics?: { label: string; emoji: string; items: { question: string; answer: string }[] }[];
  className?: string;
}

const TINTS = ["bg-da-accent text-da-accent-fg", "bg-da-secondary text-da-secondary-fg", "bg-da-primary/12 text-da-fg"];

const DEFAULT_TOPICS: NonNullable<FaqTintedProps["topics"]> = [
  {
    label: "Getting started",
    emoji: "🚀",
    items: [
      { question: "Where do I start?", answer: "Pick a template on the welcome screen — it comes with example tasks you can delete." },
      { question: "How do I invite people?", answer: "Share button → paste emails. They get a friendly invite with a magic link." },
    ],
  },
  {
    label: "Billing",
    emoji: "💳",
    items: [
      { question: "When am I charged?", answer: "Only when your team grows past 5 people, on the first of the month." },
      { question: "Can I pay yearly?", answer: "Yes, and you save 25%. Invoices are available in Settings → Billing." },
    ],
  },
  {
    label: "Privacy",
    emoji: "🔒",
    items: [
      { question: "Who can see my boards?", answer: "Only people you invite. Private boards are visible to you alone." },
      { question: "Where is data stored?", answer: "In Frankfurt, Germany. We never sell or share your data." },
    ],
  },
];

/** FAQ grouped by topic: three big pastel topic buttons (emoji + label) switch the visible Q&A list below, which fades in. */
export function FaqTinted({ title = "Help center", topics = DEFAULT_TOPICS, className }: FaqTintedProps) {
  const [active, setActive] = useState(0);
  const topic = topics[active] ?? topics[0];
  return (
    <section aria-labelledby="sf-tinted-title" className={cn("da-section bg-da-bg text-da-fg", className)}>
      <div className="da-container">
        <h2 id="sf-tinted-title" className="text-center font-da-display text-[clamp(2rem,4.5vw,3rem)] font-extrabold tracking-da-display">
          {title}
        </h2>
        <div role="group" aria-label="Topics" className="mx-auto mt-10 grid max-w-3xl gap-3 sm:grid-cols-3">
          {topics.map((t, i) => (
            <button
              key={t.label}
              type="button"
              aria-pressed={i === active}
              onClick={() => setActive(i)}
              className={cn(
                "da-focus da-transition flex flex-col items-center gap-2 rounded-da-lg p-5 font-da-display text-lg font-extrabold",
                TINTS[i % TINTS.length],
                i === active ? "scale-[1.03] shadow-da-md ring-3 ring-da-fg/10" : "opacity-75 hover:opacity-100",
              )}
            >
              <span aria-hidden className="text-3xl">
                {t.emoji}
              </span>
              {t.label}
            </button>
          ))}
        </div>
        <dl
          key={active}
          className="mx-auto mt-8 max-w-3xl space-y-3 transition-[opacity,translate] duration-(--da-duration-slow) ease-da starting:translate-y-2 starting:opacity-0"
          aria-live="polite"
        >
          {topic?.items.map((it) => (
            <div key={it.question} className="rounded-da-lg bg-da-surface p-6 shadow-da-sm">
              <dt className="font-da-display text-lg font-extrabold">{it.question}</dt>
              <dd className="mt-1.5 text-da-muted-fg">{it.answer}</dd>
            </div>
          ))}
        </dl>
      </div>
    </section>
  );
}

export default FaqTinted;

modules/soft-flat/section/faq-tinted/index.tsx

Props

PropTypeDefaultDescription
titlestring—Heading.
topics{ label, emoji, items }[]—Topics.
classNamestring—Classes.

Other faq variants in Soft Flat

FAQ in other art directions

FAQ Accordion

Two-column FAQ: sticky title + support CTA on the left, numbered accordion cards on the right with a yellow plus that rotates into an ink cross when open. Built on Radix Accordion.

BrutalistFAQ

FAQ Categories

Help-center style FAQ: topic buttons with counts on the left (stacked on desktop, wrapped on mobile), and a ruled accordion on the right whose open question floods yellow.

BrutalistFAQ

FAQ Grid

Always-open FAQ grid: ruled cells (1/2/3 columns) with a yellow question-mark square, uppercase question and answer, closed by a full-width ink contact row. No interaction needed.

BrutalistFAQ

FAQ Search

Searchable FAQ: a huge ruled search field that presses in on focus, live result count, and native <details> cards with tags; a pink empty state points to support.

BrutalistFAQ

Faq Cards

All-open FAQ: a 3-column grid of glass cards, each with a gradient number badge, question and answer, followed by a glass contact pill with an ink button.

GlassFAQ

Faq Chat

FAQ as a chat: suggested question chips on the left; picking one adds a gradient user bubble and, after a typing indicator, a glass answer bubble in the conversation panel.

GlassFAQ

FAQ Glass

Centered FAQ with stacked frosted accordion cards; the plus button spins into a gradient cross with a slight overshoot and answers expand smoothly. Built on Radix Accordion.

GlassFAQ

Faq Search

Help-center FAQ: large glass search pill filtering a frosted Radix accordion live, with category tags, result count and highlighted matches; empty state.

GlassFAQ

Faq Grid

All answers visible at once: a three-column grid of short questions and answers under a header, followed by two support link cards (documentation, talk to us).

MinimalFAQ

Faq List

Centered single-column FAQ built on native details/summary (zero JS): hairline dividers, a plus icon that rotates into a cross when open, and a contact line underneath.

MinimalFAQ

FAQ Split

Two-column FAQ: title, description and support link on the left, hairline-divided Radix accordion on the right with a rotating chevron and a smooth height + fade expand.

MinimalFAQ

Faq Tabs

FAQ grouped by category behind an underline tab bar (Radix Tabs, with counts); the active category shows every question and answer in a two-column definition list.

MinimalFAQ

Faq Inline

Ultra-compact FAQ: short questions and one-line answers flowing as a 3-column grid of mono question labels over large answers — scannable in seconds.

Mono CleanFAQ

Faq List

Numbered accordion FAQ in a ruled list: mono index + question, a +/− glyph that swaps, answer indented under the question; left column holds the label and title.

Mono CleanFAQ

Faq Split

Always-open FAQ as a two-column definition list (question left in medium weight, answer right in muted text) on hairline rows, followed by a mono contact line.

Mono CleanFAQ

Faq Tabs

FAQ grouped by topic with text tabs (Radix Tabs) underlined in ink when active, and each topic’s answers as a ruled definition list.

Mono CleanFAQ

Faq Accordion

Two-column FAQ: heading + description + contact link on the left, bordered Radix accordion with plus icons rotating to × on the right.

Neo CorporateFAQ

Faq Security

Security & compliance FAQ: dark-tinted certification cards (SOC 2, ISO 27001, GDPR, PCI) with shield icons, then security questions as native <details> disclosure rows.

Neo CorporateFAQ

Faq Sidebar

Help-center style FAQ: a vertical category nav (left, becomes horizontal scroll chips on mobile) and the selected category’s questions as an open definition list.

Neo CorporateFAQ

Faq Support

Compact 2×3 grid of short Q&As followed by three bordered support channel cards (docs, chat, dedicated support).

Neo CorporateFAQ

Faq Columns

Editorial FAQ: serif title and intro in a narrow left column, questions as a two-column definition list on the right separated by warm hairlines.

Organic SoftFAQ

Faq Contact

FAQ beside a contact card: native disclosure list on the left, and a clay-tinted card with a sprouting-leaf illustration, email and chat buttons on the right.

Organic SoftFAQ

Faq Search

Searchable FAQ: rounded search field plus topic pills filter a list of questions (native details), with a friendly empty state and live result count.

Organic SoftFAQ

Faq Soft

Soft accordion: each question is its own rounded paper pill-card that turns sage when open, with a round plus that rotates into a cross; generous spacing.

Organic SoftFAQ