Skip to content

Cards

Learn how to use cards in Starlight to display content in a box.

To display content in a box matching Starlight’s styles, use the <Card> component.

import { Card } from '@astrojs/starlight/components';

Display a card using the <Card> component and provide a title for the card.

Include an icon in a card using the icon attribute set to the name of one of Starlight’s built-in icons.

Display multiple cards side-by-side when there’s enough space by grouping them using the <CardGrid> component. See the “Group cards” guide for an example.

Implementation: Card.astro

The <Card> component accepts the following props:

required
type: string

The title of the card to display.

type: string

A card can include an icon attribute set to the name of one of Starlight’s built-in icons.