---
title: "Card"
description: "Surface for related content."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Card

```gistui
root = Grid(Card(Header("Card", size:sm), "The default surface."), Card(Header("Sunk", size:sm), "A quieter, inset surface.", v:sunk), Card(Header("Outline", size:sm), "A border, no fill.", v:outline), cols:3)
```

## Signature

This is the line a model reads in the system prompt.

```gistui
Card(...children, v:card|sunk|outline|clear, gap:Gap, accent:Accent)
```

- **Group:** Layout
- **Children:** Yes: any component or text
- **Positional arguments:** none

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `v` | `card` · `sunk` · `outline` · `clear` | named: `v:…` | Default `"card"`. |
| `gap` | `none` · `xs` · `sm` · `md` · `lg` · `xl` | named: `gap:…` | Also accepts `small`, `medium`, `large`. |
| `accent` | `neutral` · `slate` · `stone` · `rose` · `pink` · `violet` · `indigo` · `blue` · `teal` · `green` · `orange` · `amber` · `red` | named: `accent:…` | Also accepts `purple`, `gray`, `grey`, `zinc`, `yellow`. |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Card: MyCard });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ Card: MyCard }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ Card: MyCard }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ Card: MyCard }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Card: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="Card"]`.

Source: https://gistui.com/docs/components/layout/card/index.mdx
