# Gradient Card

A card on a live gradient, with a scrim that keeps white text legible.

Source: https://gradients.sh/docs/components/gradient-card

<ComponentPreview center>
  <GradientCardDemo />

  <include cwd lang="tsx" meta='title="gradient-card-demo.tsx"'>components/docs/demos/gradient-card.tsx</include>
</ComponentPreview>

## Installation

```bash
npx shadcn@latest add https://gradients.sh/r/gradient-card.json
```

## Usage

```tsx
import { GradientCard } from "@/components/gradient-card";

<GradientCard className="h-72">
  <p className="text-lg font-semibold">Grain</p>
</GradientCard>;
```

Content sits at the bottom of the card. The `scrim` darkens the area behind it so white text stays legible.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | `—` | Card content. It sits at the bottom of the card by default. |
| `kind` | `GradientKind` | `"grain"` | Which gradient fills the component: one of the six free kinds, or any kind registered with the engine. |
| `scrim` | `boolean` | `true` | Darken the bottom of the card behind the text. |
| `colors` | `[string, string, ...string[]]` | `["#ffd8b4", "#e0703b", "#8a2c1d", "#2b1015"]` | Two to six colours: hex, oklch(), names or var(--token). |
| `background` | `string` | `"#070505"` | Base colour under the gradient. |
| `speed` | `number` | `0.48` | 0 to 2. How fast the gradient moves. 0 holds it still. |
| `loopSeconds` | `number` | `16` | 4 to 30. The animation repeats exactly every loopSeconds. |
| `scale` | `number` | `1` | 0.25 to 4. Noise frequency: higher means smaller shapes. |
| `warp` | `number` | `0.55` | 0 to 1. Domain-warp strength. |
| `grain` | `number` | `0.5` | 0 to 1. Film grain. |
| `blur` | `number` | `0.55` | 0 to 1. Softness. |
| `seed` | `number` | `7` | Integer seed for the noise field. |
| `dither` | `{ enabled?: boolean; cell?: number; levels?: number }` | `{ enabled: false, cell: 3, levels: 8 }` | Ordered 4×4 Bayer dither. |
| `interaction` | `{ pointer?: number; scroll?: number }` | `{ pointer: 0.15, scroll: 0 }` | 0 to 1 influence of the pointer and of scroll velocity. |
| `maxDpr` | `number` | `1.5` | Device pixel ratio cap for the canvas. |
| `reducedMotion` | `"respect" \| "ignore"` | `"respect"` | "respect" shows one still frame when the user prefers reduced motion. |
| `className` | `string` | `—` | Classes for the outer element. Size it here; the gradient fills it. |
