Shape Hero - React Component | Kokonut UI
Shape Hero
A landing hero where shapes drop in, pile up under the headline and can be grabbed and thrown.
Install with
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. Add it with the shadcn CLI, which copies the source into components/kokonutui/shape-hero.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/shape-hero
Usage
import ShapeHero from "@/components/kokonutui/shape-hero";
export default function Example() {
return <ShapeHero as="h2" />;
}
Props
classNamestring
Extra classes for the root element.eyebrowReactNode
Small line above the title, such as a badge or a link.titleReactNode
Default"Components with a little gravity"descriptionReactNode
Default"Copy-paste components for React, built with Tailwind CSS and Motion."actionsReactNode
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 itsh1is.shapesHeroShape[]
Defaultbuilt-in
Shapes that drop into the hero, pile up and can be thrown around.fillnumber
Default0.3
Share of the hero's area the pile may fill; extra shapes are left out.
HeroShape
id
requiredstringcontentReactNode
Text or an icon inside the shape. Leave empty for a plain shape.classNamestring
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
A ribbon of lines in one color that keeps flowing at any size and parts around the cursor.
Wind
Streamlines that part around the cursor, swirl in its wake and scatter on click, built with React and Canvas.