# Cards

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

:::card{title="Moons" icon="moon"}
Io, Europa, Ganymede
:::

## Import

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

## Usage

Display a card using the `<Card>` component and provide a [`title`](#title) for the card.

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

<Card title="Check this out">Interesting content you want to highlight.</Card>
```

```markdoc
{% card title="Check this out" %}
Interesting content you want to highlight.
{% /card %}
```

:::card{title="Check this out"}
Interesting content you want to highlight.
:::

### Add icons to cards

Include an icon in a card using the [`icon`](#icon) attribute set to the name of [one of Starlight’s built-in icons](/guides/reference-icons#all-icons).

```mdx 'icon="star"'
import { Card } from '@astrojs/starlight/components';

<Card title="Stars" icon="star">
	Sirius, Vega, Betelgeuse
</Card>
```

```markdoc 'icon="star"'
{% card title="Stars" icon="star" %}
Sirius, Vega, Betelgeuse
{% /card %}
```

:::card{title="Stars" icon="star"}
Sirius, Vega, Betelgeuse
:::

### Group cards

Display multiple cards side-by-side when there’s enough space by grouping them using the [`<CardGrid>`](/guides/components-card-grids) component.
See the [“Group cards”](/guides/components-card-grids#group-cards) guide for an example.

## `<Card>` Props

**Implementation:** [`Card.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/src/user-components/Card.astro)

The `<Card>` component accepts the following props:

### `title`

**required**\
**type:** `string`

The title of the card to display.

### `icon`

**type:** `string`

A card can include an `icon` attribute set to the name of [one of Starlight’s built-in icons](/guides/reference-icons#all-icons).

## Related pages

- [Starlight](../index.md)
- [Using Components](./components-using-components.md)
- [Pages](./guides-pages.md)
- [Not found](./more-404.md)
- [Configuration Reference](./reference-configuration.md)
- [Plugins and Integrations](./resources-plugins.md)
- [Start Here](./start-here-index.md)
- [Getting Started](./start-here-getting-started.md)
- [Guides](./guides-index.md)
- [Authoring Content in Markdown](./guides-authoring-content.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
