Dotted Rule FAQ Accordion
Rows separated by thin dotted cobalt hairlines, each with a large condensed blue question that has a faint underline and a small plus sign on the right; heading has a 'View docs' link aligned right.
Rebuilt from hermes-agent.nousresearch.com in the Electric Ultramarine Engraving style.
npx shadcn@latest add https://justyoink.it/r/electric-ultramarine-engraving/blocks/dotted-rule-faq.json
Looks exactly like hermes-agent.nousresearch.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/electric-ultramarine-engraving/mine/dotted-rule-faq.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: title, linkLabel, linkHref and items ({q, a}[]). Click a row to expand it; the plus turns into a minus and only one row is open at a time.
components/dotted-rule-faq.tsx
import { useState } from "react"; type Item = { q: string; a: string }; export default function DottedRuleFaqAccordion({ title = "Questions", linkLabel = "Read guides", linkHref = "#", items = [ { q: "How are plans billed?", a: "Plans are billed monthly based on the seats you have active. You can change or cancel at any time from your account settings." }, { q: "Where do I begin?", a: "Create a workspace, invite a teammate and follow the short checklist on your dashboard. Most teams are set up in minutes." }, { q: "Can I talk to my assistant by message?", a: "Yes. Open the inbox panel and send a message; replies arrive in the same thread, and history stays attached." }, { q: "Is information saved across visits?", a: "Everything is stored in your workspace and restored whenever you return, unless you choose to clear it." }, { q: "What if I pause my assistant?", a: "It stops running immediately. Your settings and history are kept so you can resume whenever you like." }, ] as Item[], }) { const [open, setOpen] = useState<number | null>(null); return ( <section className="bg-paper text-cobalt-deep px-6 py-16 md:py-20"> <div className="mx-auto max-w-[1080px]"> <div className="flex items-end justify-between pb-4"> <div className="flex items-start gap-2"> <h2 className="font-display text-[64px] leading-none md:text-[96px] font-light tracking-tight uppercase-none">{title}</h2> <svg aria-hidden="true" width="16" height="18" viewBox="0 0 16 18" className="mt-3 text-cobalt" fill="none" stroke="currentColor" strokeWidth="1.5"> <path d="M3 1h7l4 4v12H3z" /> <path d="M6 9h5M6 12h5" /> </svg> </div> <a href={linkHref} className="font-mono text-micro uppercase underline underline-offset-4 decoration-cobalt-deep/40 hover:decoration-cobalt-deep transition-colors duration-300 mb-3 focus-visible:outline focus-visible:outline-2 focus-visible:outline-cobalt">{linkLabel}</a> </div> <ul className="border-t border-dotted border-cobalt-deep"> {items.map((it, i) => { const isOpen = open === i; return ( <li key={i} className="border-b border-dotted border-cobalt-deep"> <button type="button" aria-expanded={isOpen} aria-controls={`faq-panel-${i}`} onClick={() => setOpen(isOpen ? null : i)} className="group flex w-full items-center justify-between gap-4 py-5 text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-cobalt" > <span className="font-display text-[28px] md:text-[34px] font-light leading-tight text-cobalt underline underline-offset-4 decoration-cobalt/20 group-hover:decoration-cobalt transition-colors duration-300">{it.q}</span> <span aria-hidden="true" className="font-mono text-body text-cobalt w-4 text-center">{isOpen ? "−" : "+"}</span> </button> <div id={`faq-panel-${i}`} role="region" className={`grid transition-all duration-300 ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`}> <div className="overflow-hidden"> <p className="max-w-2xl pb-6 font-sans text-body text-cobalt-deep">{it.a}</p> </div> </div> </li> ); })} </ul> </div> </section> ); }import { useState } from "react"; type Item = { q: string; a: string }; export default function DottedRuleFaqAccordion({ title = "Questions", linkLabel = "Read guides", linkHref = "#", items = [ { q: "How are plans billed?", a: "Plans are billed monthly based on the seats you have active. You can change or cancel at any time from your account settings." }, { q: "Where do I begin?", a: "Create a workspace, invite a teammate and follow the short checklist on your dashboard. Most teams are set up in minutes." }, { q: "Can I talk to my assistant by message?", a: "Yes. Open the inbox panel and send a message; replies arrive in the same thread, and history stays attached." }, { q: "Is information saved across visits?", a: "Everything is stored in your workspace and restored whenever you return, unless you choose to clear it." }, { q: "What if I pause my assistant?", a: "It stops running immediately. Your settings and history are kept so you can resume whenever you like." }, ] as Item[], }) { const [open, setOpen] = useState<number | null>(null); return ( <section className="bg-foreground text-primary/90 px-6 py-16 md:py-20"> <div className="mx-auto max-w-[1080px]"> <div className="flex items-end justify-between pb-4"> <div className="flex items-start gap-2"> <h2 className="font-sans text-[64px] leading-none md:text-[96px] font-light tracking-tight uppercase-none">{title}</h2> <svg aria-hidden="true" width="16" height="18" viewBox="0 0 16 18" className="mt-3 text-background" fill="none" stroke="currentColor" strokeWidth="1.5"> <path d="M3 1h7l4 4v12H3z" /> <path d="M6 9h5M6 12h5" /> </svg> </div> <a href={linkHref} className="font-mono text-electric-micro uppercase underline underline-offset-4 decoration-primary/40 hover:decoration-primary/90 transition-colors duration-300 mb-3 focus-visible:outline focus-visible:outline-2 focus-visible:outline-background">{linkLabel}</a> </div> <ul className="border-t border-dotted border-primary/90"> {items.map((it, i) => { const isOpen = open === i; return ( <li key={i} className="border-b border-dotted border-primary/90"> <button type="button" aria-expanded={isOpen} aria-controls={`faq-panel-${i}`} onClick={() => setOpen(isOpen ? null : i)} className="group flex w-full items-center justify-between gap-4 py-5 text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-background" > <span className="font-sans text-[28px] md:text-[34px] font-light leading-tight text-background underline underline-offset-4 decoration-background/20 group-hover:decoration-background transition-colors duration-300">{it.q}</span> <span aria-hidden="true" className="font-mono text-electric-body text-background w-4 text-center">{isOpen ? "−" : "+"}</span> </button> <div id={`faq-panel-${i}`} role="region" className={`grid transition-all duration-300 ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`}> <div className="overflow-hidden"> <p className="max-w-2xl pb-6 font-sans text-electric-body text-primary/90">{it.a}</p> </div> </div> </li> ); })} </ul> </div> </section> ); }
Quality checks
Automated, in a real browser · 5d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: not passedElements must meet minimum color contrast ratio thresholds (2 elements)
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.