BG-03Backgrounds
Shape Hero
A landing hero where shapes drop in, pile up under the headline and can be grabbed and thrown.
PRODither Reveal Hero and more like it are in Kokonut UI Pro
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-heroUsage
import ShapeHero from "@/components/kokonutui/shape-hero";
export default function Example() {
return <ShapeHero as="h2" />;
}Props
classNamestringExtra classes for the root element.
eyebrowReactNodeSmall line above the title, such as a badge or a link.
titleReactNodeDefault "Components with a little gravity"descriptionReactNodeDefault "Copy-paste components for React, built with Ta…actionsReactNodeDefault <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.
shapesHeroShape[]Default built-inShapes that drop into the hero, pile up and can be thrown around.
fillnumberDefault 0.3Share of the hero's area the pile may fill; extra shapes are left out.
HeroShape
idrequiredstringcontentReactNodeText or an icon inside the shape. Leave empty for a plain shape.
classNamestringSize, 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.