# Sparkline

Inline Unicode braille sparkline chart



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

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

      <ComponentSource base="ink" name="sparkline" title="components/ui/sparkline.tsx" />

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

Usage [#usage]

```tsx
import { Sparkline } from "@/components/ui/sparkline";
```

```tsx
<Sparkline data={[4, 8, 15, 16, 23, 42, 38, 26]} width={20} label="Requests" />
```

API Reference [#api-reference]

Sparkline [#sparkline]

| Prop    | Type       | Default    |
| ------- | ---------- | ---------- |
| `data`  | `number[]` | `required` |
| `width` | `number`   | `20`       |
| `color` | `string`   | -          |
| `label` | `string`   | -          |
