跳转到内容

卡片网格

要将多个 <Card><LinkCard> 组件包裹在网格中,请使用 <CardGrid> 组件。

预览

恒星

天狼星、织女星、参宿四

卫星

木卫一、木卫二、木卫三

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

通过使用 <CardGrid> 组件将多个 <Card> 组件分组,可以在有足够空间时将它们并排显示。

import { Card, CardGrid } from '@astrojs/starlight/components';
<CardGrid>
<Card title="Check this out" icon="open-book">
Interesting content you want to highlight.
</Card>
<Card title="Other feature" icon="information">
More information you want to share.
</Card>
</CardGrid>
预览

看看这个

你想要突出显示的有趣内容。

其他功能

你想要分享的更多信息。

通过使用 <CardGrid> 组件将多个 <LinkCard> 组件分组,可以在有足够空间时将它们并排显示。

import { LinkCard, CardGrid } from '@astrojs/starlight/components';
<CardGrid>
<LinkCard title="Authoring Markdown" href="/guides/authoring-content/" />
<LinkCard title="Components" href="/components/using-components/" />
</CardGrid>

通过向 <CardGrid> 组件添加 stagger 属性,可以垂直移动网格的第二列以增加视觉趣味性。

这个属性在你的主页上显示项目关键功能时很有用。

import { Card, CardGrid } from '@astrojs/starlight/components';
<CardGrid stagger>
<Card title="Check this out" icon="open-book">
Interesting content you want to highlight.
</Card>
<Card title="Other feature" icon="information">
More information you want to share.
</Card>
</CardGrid>
预览

看看这个

你想要突出显示的有趣内容。

其他功能

你想要分享的更多信息。

实现: CardGrid.astro

<CardGrid> 组件接受以下属性

类型: boolean

定义是否在网格中交错卡片。