# Shape Hero

A landing hero where shapes drop in, pile up under the headline and can be grabbed and thrown.

Install with

```bash
npx shadcn@latest add https://kokonutui.com/r/shape-hero.json
```

no extra packages

- Pull Cord
- Detent Dial
- Wheel Picker
- Topo
- Split Flap
- Notification Stack
- Paper Fold
- Toss Board
- React
- Motion
- Tailwind CSS
- shadcn/ui
- Peel Sticker
- Background Paths
- Flow Field
- TypeScript

## Components with a little gravity

Copy-paste components for React, built with Tailwind CSS and Motion. Grab a shape and throw it.

## Installation

Shape Hero is a free, open-source React component in the Kokonut UI [Backgrounds collection](/content/docs/backgrounds/index.html). Add it with the shadcn CLI, which copies the source into `components/kokonutui/shape-hero.tsx`, so the code is yours to change.

```bash
npx shadcn@latest add @kokonutui/shape-hero
```

## Usage

```javascript
import ShapeHero from "@/components/kokonutui/shape-hero";

export default function Example() {
  return <ShapeHero as="h2" />;
}
```

## Props

- `className`  
  `string`  
  Extra classes for the root element.

- `eyebrow`  
  `ReactNode`  
  Small line above the title, such as a badge or a link.

- `title`  
  `ReactNode`  
  Default `"Components with a little gravity"`

- `description`  
  `ReactNode`  
  Default `"Copy-paste components for React, built with Tailwind CSS and Motion."`

- `actions`  
  `ReactNode`  
  Default `<DefaultActions />`  
  Call-to-action buttons under the description.

- `as`  
  `"h1" | "h2" | "h3" | "p"`  
  Default `"h1"`  
  Heading element for the title, so the page decides where its `h1` is.

- `shapes`  
  `HeroShape[]`  
  Default `built-in`  
  Shapes that drop into the hero, pile up and can be thrown around.

- `fill`  
  `number`  
  Default `0.3`  
  Share of the hero's area the pile may fill; extra shapes are left out.

### HeroShape

- `id`  
  required  
  `string`

- `content`  
  `ReactNode`  
  Text or an icon inside the shape. Leave empty for a plain shape.

- `className`  
  `string`  
  Size, color and rounding. Every shape is treated as a pill: as wide as it renders, with fully round ends, so a square box becomes a circle.

## Dependencies

| Needs                               | Version | Comes from  |
|-------------------------------------|---------|-------------|
| `cn` from `lib/utils.ts`           |         | shadcn init |
| React                               | `19`    | Your app    |
| Tailwind CSS                        | `4`     | Your app    |

No provider, font or global CSS to set up: the file works as soon as it lands.

[Background Paths](/content/docs/backgrounds/background-paths/index.html)  
A ribbon of lines in one color that keeps flowing at any size and parts around the cursor.  
[Wind](/content/docs/backgrounds/flow-field/index.html)  
Streamlines that part around the cursor, swirl in its wake and scatter on click, built with React and Canvas.
