We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content

Directory

Details Component

The Details component creates interactive expandable sections that help organize and present content in a clean, accessible way. It features smooth animations, keyboard navigation, and maintains ARIA compliance for better accessibility.

  • Check Circle

    Smooth Animations: Polished expand/collapse transitions

  • Check Circle

    Accessible Design: Full keyboard support and ARIA compliance

  • Check Circle

    Flexible Content: Supports any nested content

  • Check Circle

    Customizable: Configurable title tags and styling

Create expandable sections with a title and content:

Getting started is easy! Simply install our template and follow the quick setup guide.

<Details title="How do I get started?">
Getting started is easy! Simply install our template
and follow the quick setup guide.
</Details>

Choose semantic heading levels for better document structure:

Content with h2 heading level

<Details title="Section One" titleTag="h2">
Content with h2 heading level
</Details>

Add complex content structures within Details:

Nested Heading

Paragraph content with rich text support.

  • List item one
  • List item two
  • List item three
<Details title="Complex Content Example">
<h3 class="mb-2 text-lg font-bold">Nested Heading</h3>
<p class="mb-2">Paragraph content with rich text support.</p>
<ul class="pl-4 mb-2 list-disc">
<li>List item one</li>
<li>List item two</li>
<li>List item three</li>
</ul>
</Details>
Required Props
Details Component Props Extends <details> HTMLElement
Prop Type Default Description
title string - The title text shown in the summary
titleTag div | h1 | h2 | h3 | h4 | h5 | h6 div HTML tag for the title
titleClass string Additional classes for the title
descriptionClass string Additional classes for the content
transitionDuration number 300 Transition duration in milliseconds
  • Enter/Space to toggle
  • Tab for focus management
  • Clear focus indicators
  • Aria labels
  1. Content Organization

    • Group related information
    • Keep titles concise
    • Use consistent patterns
    • Consider content hierarchy
  2. Visual Design

    • Maintain clear indicators
    • Use consistent spacing
    • Ensure readable text
    • Consider mobile views
  3. Performance

    • Lazy load content when possible
    • Optimize animations
    • Monitor content size
    • Consider initial state
FAQs
Product details
Settings panels
Accordion menus
Expandable sections
Content filters
Code examples
Technical details
Installation steps
Troubleshooting guides

Limited Time Launch Sale

Ready to create intuitive, accessible expandable content? Get our AstroJS starter template now and start building better user experiences with the Details component.

GET 60% OFF!
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes