# Card

Card with header, body, and footer slots



<ComponentPreview base="opentui" name="card-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/opentui-card
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="opentui" name="card" title="components/ui/card.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { Card } from "@/components/ui/card";
```

```tsx
<Card title="System Info" subtitle="Local machine">
  <Text>CPU: 4 cores @ 3.2 GHz</Text>
</Card>
```

API Reference [#api-reference]

Card [#card]

| Prop                | Type                                                                                         | Default    |
| ------------------- | -------------------------------------------------------------------------------------------- | ---------- |
| `title`             | `string`                                                                                     | -          |
| `subtitle`          | `string`                                                                                     | -          |
| `children`          | `ReactNode`                                                                                  | `required` |
| `footer`            | `ReactNode`                                                                                  | -          |
| `borderColor`       | `string`                                                                                     | -          |
| `width`             | `number`                                                                                     | -          |
| `borderStyle`       | `"single" \| "double" \| "round" \| "bold" \| "singleDouble" \| "doubleSingle" \| "classic"` | `"round"`  |
| `paddingX`          | `number`                                                                                     | `1`        |
| `paddingY`          | `number`                                                                                     | `0`        |
| `footerDividerChar` | `string`                                                                                     | `"─"`      |
