Skip to content
Blocks

FAQ

A complete faq section, ready to adapt to your product.

Open ↗

Make it yours.

Install the editable source and its dependencies into your React + Tailwind project.

Scroll horizontally for long lines
pnpm dlx shadcn@4.0.8 add http://localhost:3000/r/faq.json

Use it

Scroll horizontally for long lines
"use client";
import {Faq} from '@/components/jez-ui/blocks/faq';

export default function Example(){

return <><Faq/></>;
}

Props & types

Scroll horizontally for long lines
{ className?: string }

Source

View 3 source files

registry/blocks/faq.tsx

Scroll horizontally for long lines
"use client";
import * as React from "react";
import { cn } from "../ui/utils";
import { Accordion } from "../ui/accordion";
export function Faq({ className }: { className?: string }) {
  return (
    <section className={cn("py-8", className)}>
      <h2 className="mb-5 text-3xl">Good questions.</h2>
      <Accordion
        type="single"
        collapsible
        items={[
          {
            value: "start",
            title: "How do I get started?",
            content:
              "Choose a template, install its dependencies, and run the local development server. The included README walks through each step.",
          },
          {
            value: "source",
            title: "Can I change the source?",
            content:
              "The source is designed to be edited. Adjust the theme and components to fit your product, subject to the distribution licence.",
          },
          {
            value: "backend",
            title: "Is a backend included?",
            content:
              "These are frontend templates with demo data. Connect your own authentication, storage, and services at the documented integration points.",
          },
        ]}
      />
    </section>
  );
}

registry/ui/utils.ts

Scroll horizontally for long lines
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...values: ClassValue[]) {
  return twMerge(clsx(values));
}

registry/ui/accordion.tsx

Scroll horizontally for long lines
"use client";
import * as React from "react";
import { cn } from "./utils";
import { Accordion as Primitive } from "radix-ui";
export function Accordion({
  items,
  className,
  ...props
}: React.ComponentProps<typeof Primitive.Root> & {
  items: { value: string; title: string; content: React.ReactNode }[];
}) {
  return (
    <Primitive.Root className={cn("w-full", className)} {...props}>
      {items.map((i) => (
        <Primitive.Item
          key={i.value}
          value={i.value}
          className="border-b border-border"
        >
          <Primitive.Header>
            <Primitive.Trigger className="flex w-full justify-between gap-4 py-4 text-left font-medium">
              {i.title}
              <span aria-hidden="true">+</span>
            </Primitive.Trigger>
          </Primitive.Header>
          <Primitive.Content className="pb-4 text-sm text-muted-foreground">
            {i.content}
          </Primitive.Content>
        </Primitive.Item>
      ))}
    </Primitive.Root>
  );
}

Dependencies

clsx@2.1.1 · tailwind-merge@3.5.0 · radix-ui@1.6.7

Accessibility & behaviour

Provide meaningful labels and preserve keyboard focus styles. Check contrast when customising theme colours.

Read the accessibility and performance guide →