# Gradient

Color gradient text



<ComponentPreview base="ink" name="gradient-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/gradient
    ```
  </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 base="ink" name="gradient" title="components/ui/gradient.tsx" />

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

Usage [#usage]

```tsx
import { Gradient } from "@/components/ui/gradient";
```

```tsx
<Gradient colors={["#ff6b6b", "#4ecdc4"]}>Hello Gradient</Gradient>
```

Examples [#examples]

Cristal [#cristal]

<ComponentPreview base="ink" name="gradient-cristal" />

Teen [#teen]

<ComponentPreview base="ink" name="gradient-teen" />

Mind [#mind]

<ComponentPreview base="ink" name="gradient-mind" />

Morning [#morning]

<ComponentPreview base="ink" name="gradient-morning" />

Vice [#vice]

<ComponentPreview base="ink" name="gradient-vice" />

Passion [#passion]

<ComponentPreview base="ink" name="gradient-passion" />

Fruit [#fruit]

<ComponentPreview base="ink" name="gradient-fruit" />

Instagram [#instagram]

<ComponentPreview base="ink" name="gradient-instagram" />

Atlas [#atlas]

<ComponentPreview base="ink" name="gradient-atlas" />

Retro [#retro]

<ComponentPreview base="ink" name="gradient-retro" />

Summer [#summer]

<ComponentPreview base="ink" name="gradient-summer" />

Pastel [#pastel]

<ComponentPreview base="ink" name="gradient-pastel" />

Rainbow [#rainbow]

<ComponentPreview base="ink" name="gradient-rainbow" />

API Reference [#api-reference]

Gradient [#gradient]

Either pass `colors`, or pass `name` (not both required; `name` selects a preset when `colors` is omitted).

| Prop       | Type                                                                                                                                                     | Default    |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `children` | `string`                                                                                                                                                 | `required` |
| `colors`   | `string[]`                                                                                                                                               | -          |
| `name`     | `"cristal" \| "teen" \| "mind" \| "morning" \| "vice" \| "passion" \| "fruit" \| "instagram" \| "atlas" \| "retro" \| "summer" \| "pastel" \| "rainbow"` | -          |
| `bold`     | `boolean`                                                                                                                                                | `false`    |

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:** Ink labels and semantic state expose the component without relying on visual styling alone.
