# Gradient Cover

Deterministic SVG cover art generated from a seed string with palette and pattern axes.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

<ComponentPreview name="gradient-cover">
  <GradientCoverDemo />
</ComponentPreview>

## Installation [#installation]

```bash
npx shadcn@latest add https://motif.sweetretry.com/r/gradient-cover.json
```

## Usage [#usage]

```tsx
import {
  GradientCover,
  GradientCoverTitle,
} from "@/components/ui/motif/gradient-cover";

export function CollectionCard({ collection }) {
  return (
    <GradientCover seed={collection.id}>
      <GradientCoverTitle>{collection.name}</GradientCoverTitle>
    </GradientCover>
  );
}
```

`seed` is required and deterministically picks `palette` and `pattern` when omitted.

## Variants [#variants]

<GradientCoverMatrixDemo />

| Pattern  | Draws                                                      |
| -------- | ---------------------------------------------------------- |
| `plain`  | Nothing (color and grain only)                             |
| `waves`  | Near-parallel lines whose swell grows down the cover       |
| `dots`   | Fixed grid of dots                                         |
| `petals` | Leaf outlines scattered across the cover and off its edges |

## Seeds [#seeds]

Fixing `palette` or `pattern` leaves the other axis's seeded output unchanged.

<GradientCoverSeedDemo />

## As an image source [#as-an-image-source]

`gradientCoverUrl` returns a `data:` URI and `gradientCoverSvg` returns the raw SVG string, for use with components like [Cover Fan](/docs/agents/cover-fan).

```tsx
import { gradientCoverUrl } from "@/components/ui/motif/gradient-cover";

const items = starters.map((starter) => ({
  id: starter.id,
  title: starter.title,
  src: gradientCoverUrl({ seed: starter.id, palette: "lagoon" }),
}));

<CoverFan items={items} onSelect={start} />;
```

<GradientCoverFanDemo />

## Parts [#parts]

| Part                 | Renders                                                     |
| -------------------- | ----------------------------------------------------------- |
| `GradientCover`      | Root container (`rounded-xl` square by default) and SVG art |
| `GradientCoverTitle` | White title sized to the cover via `cqw`                    |

- The SVG is `aria-hidden` and uses literal hex palettes so covers look identical in light and dark modes.

## Component source [#component-source]

<ComponentSource
  name="gradient-cover"
  src="registry/new-york/gradient-cover.tsx"
  title="gradient-cover.tsx"
/>
