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

Skip to main content

Directory

List Component

The List component provides a flexible foundation for creating structured, accessible lists with optional icons and custom styling. Perfect for feature lists, navigation menus, and content organization.

  • Check Circle

    Flexible Structure: Support for both simple text and complex content

  • Check Circle

    Icon Integration: Optional icons with customizable styling

  • Check Circle

    Accessibility: Semantic HTML structure with proper list markup

  • Check Circle

    Customization: Extensive styling options and props

Create lists using either the simplified array approach or individual list items when complex content is needed:

<List listItems={['First Item', 'Second Item', 'Third Item']} />
<!-- Using listItems prop -->
<List>
<ListItem>First Item</ListItem>
<ListItem>Second Item</ListItem>
<ListItem>Third Item</ListItem>
</List>
<!-- Using ListItem components -->

Add visual hierarchy with icons:

  • Check Circle Default icon alignment
  • Check Circle Consistent spacing
  • Check Circle Automatic sizing
---
import checkIcon from '@/assets/icons/check-circle.svg?raw';
---
<List>
<ListItem icon={checkIcon}>Default icon alignment</ListItem>
<ListItem icon={checkIcon}>Consistent spacing</ListItem>
<ListItem icon={checkIcon}>Automatic sizing</ListItem>
</List>
  • Star

    Custom icon styling

  • Chevron Right

    Multiple icon options

<List>
<ListItem icon={star} iconProps={{ class: 'text-secondary' }}>
Custom icon styling
</ListItem>
<ListItem icon={arrow} iconProps={{ class: 'text-success' }}>
Multiple icon options
</ListItem>
</List>

Lists support rich content within items:

  • Check Circle

    Feature Title

    Detailed description of the feature goes here.

  • Check Circle

    Another Feature

    Can include any HTML content or components.

<List class="[&_icon]:mt-1 sm:[&_icon]:mt-1.5">
<ListItem icon={checkIcon}>
<div>
<h3>Feature Title</h3>
<p class="text-txt-secondary text-sm">Detailed description of the feature.</p>
</div>
</ListItem>
<ListItem icon={checkIcon}>
<div>
<h3>Another Feature</h3>
<p class="text-txt-secondary text-sm">Can include any HTML content.</p>
</div>
</ListItem>
</List>
List Component Props extends <ul> HTMLElement
Prop Type Default Description
listItems string[] [] Array of simple text items
icon string Default icon for all items in the listItems prop
iconProps ComponentProps<typeof Icon> Props passed to all icons
listItemProps HTMLAttributes<"li"> Props passed to all list items
List Component Props extends <li> HTMLElement
Prop Type Default Description
icon string Icon for this specific item
iconProps ComponentProps<typeof Icon> Props for this item's icon
Feature lists
Navigation menus
FAQ sections
Documentation
Checklists

Limited Time Launch Sale

Start building structured, accessible content today with our List component. Get the AstroJS starter template and enhance your content organization instantly.

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