Minimal Accordion
A quiet, accessible disclosure pattern for product and documentation pages.
html · tailwind · react
GUIDE_LOG // TAILWIND_CSS_GUIDE
Use utilities to adapt proven FAQ semantics to your design system.
Tailwind CSS provides utility classes for building responsive FAQ sections directly in HTML or JSX.
md: and lg: to change layouts for different screen sizes instantly.group-open: to animate icons when a <details> element is toggled.Best for 5-10 questions. It keeps the user focused on one answer at a time.
<div class="mx-auto max-w-2xl divide-y divide-gray-200">
<details class="group py-6">
<summary
class="flex cursor-pointer items-center justify-between font-medium text-gray-900"
>
<span>How fast is the deployment?</span>
<span class="transition group-open:rotate-180">
<svg
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path d="M19 9l-7 7-7-7" />
</svg>
</span>
</summary>
<p class="mt-4 text-gray-600 leading-relaxed">
Deployment timing depends on your build and hosting provider.
</p>
</details>
</div>
Ideal for landing pages with many short answers. It maximizes vertical space.
<div class="grid grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-16">
<div>
<h3 class="text-lg font-bold text-gray-900">Is there a free tier?</h3>
<p class="mt-2 text-gray-600">
Review the pricing page for current plan limits.
</p>
</div>
<div>
<h3 class="text-lg font-bold text-gray-900">Can I change plans later?</h3>
<p class="mt-2 text-gray-600">
Plan changes are managed from the billing settings page.
</p>
</div>
</div>
Don't forget to style the hover and focus states for better accessibility:
<summary
class="cursor-pointer hover:text-blue-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded-lg p-2 transition-colors"
>
<span>How do I update my profile?</span>
</summary>
Tailwind utilities can size and color icons from libraries such as Heroicons or Lucide. Mark decorative icons with aria-hidden="true".
If your site supports dark mode, Tailwind's dark: prefix allows you to define styles for dark-themed interfaces.
<div class="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100">
<h3 class="font-semibold">Where are account settings?</h3>
<p class="mt-2 text-gray-600 dark:text-gray-300">
Open the profile menu and choose Settings.
</p>
</div>
Tailwind scans configured source files and generates CSS for detected classes. Keep class names statically discoverable and verify the production bundle with your own build tooling.
Tailwind CSS provides the flexibility to build any FAQ layout imaginable while ensuring your code remains maintainable and performance-optimized.
A quiet, accessible disclosure pattern for product and documentation pages.
html · tailwind · react
A smooth, interactive accordion with elegant slide transitions and rotating icons.
html · tailwind · react
A scannable FAQ layout for landing pages with short, independent answers.
tailwind · react
Organize large sets of questions into logical groups for better discoverability.
html · tailwind · react
A powerful FAQ interface with a real-time search filter to help users find answers instantly.
tailwind · react
A standard FAQ layout paired with a prominent 'Contact Us' call-to-action for unresolved queries.
html · tailwind · react
A visually striking accordion designed specifically for dark-themed interfaces and high-contrast environments.
tailwind · react
A grid-based FAQ specifically tailored for handling billing, subscription, and pricing questions.
tailwind · react
A card-based FAQ layout designed to guide new users through their first steps and common setup hurdles.
tailwind · react
A minimalist, space-saving FAQ design for sidebars or mid-article content.
html · tailwind · react