# Card

Card with header, body, and footer slots



<ComponentPreview base="ink" 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/ink/card
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install ink
      ```

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource src="registry/bases/ink/ui/types.ts" title="components/ui/types.ts" />

      <ComponentSource src="registry/bases/ink/themes/default.ts" title="lib/terminal-themes/default.ts" />

      <ComponentSource src="registry/bases/ink/hooks/use-theme.ts" title="hooks/use-theme.ts" />

      <ComponentSource src="registry/bases/ink/hooks/use-unicode.ts" title="hooks/use-unicode.ts" />

      <ComponentSource src="registry/bases/ink/lib/terminal-style.ts" title="lib/terminal-style.ts" />

      <ComponentSource base="ink" 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`                                                                                     | `"─"`      |

Notes [#notes]

Accessibility [#accessibility]

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

* **Screen reader:** Screen-reader mode removes decorative output while preserving meaningful labels and state.
