shadcn.io is not affiliated with official shadcn/ui
Highlighted Question FAQ Block for Ark UI
A FAQ for boat winter storage that leads with its one most-asked question as a raised card in a card, key phrases highlighted, above five accordion rows.
Installation
Overview
A highlighted-question FAQ for React with Ark UI. A title and one sentence sit above a card in card: a muted shell with + marks on its corners wraps a raised panel that is light on a light page and dark on a dark one, holding a "Most asked" badge, the question as a large heading, its answer with the key phrases marked as if with a highlighter, and a link to the full checklist. Below it, five more questions run rail to rail as hairline rows under a rule with + marks, closed until opened, and the last row ends the block. The page's rails and top rule come from the Guides spine, so the block lines up with its neighbours in a stack. It's built from Highlight Text, Badge, Accordion and Guides, with CSS transitions and your theme's tokens for every colour. For product pages where one question outweighs the rest and its answer should be on the page without a click.
FAQ
How do I change the featured question and its highlights?
The featured question and its answer are written in the markup of the card, so edit them there. Each highlighted phrase is a Marked component with its text; the words around them are plain. Keep to three or four short phrases that someone skimming would want to catch: marking half the sentence marks nothing. The five rows below come from QUESTIONS at the top of the file.
How is the highlight drawn, and is it readable?
The marker is the theme's foreground colour at 12%, so it's a light grey wash in a light theme and a lighter one in a dark theme, and the marked text switches to full foreground. Contrast stays well above the AA minimum in every preset and the page's text selection and find in page work as usual: the marked words are real text. It draws across each phrase once, a short moment after the page loads.
What happens with reduced motion?
The highlight is simply there, with no drawing, and the entrances are off, so the first screen shows the finished card. The rows' plus turns into a cross as a row opens, without animating. The answers also open and close at once, with no height animation.
Are the closed answers in the page's markup?
The featured answer is always on the page. For the rows below:
the Accordion takes lazyMount={false} and unmountOnExit={false}, so every answer renders from the start, hidden until its question opens, and search engines and server rendering see all six questions.
How does it work with a keyboard and a screen reader?
The featured question is an h3 with its answer as a paragraph, and the link after it is the first stop for Tab. Each row below is a button inside its own h3, Enter or Space opens and closes one, and one answer is open at a time.
The Up and Down arrows also move between the rows, and Home and End jump to the first and last.