Skip to Content
Kokonut UI

BG-03Backgrounds

Shape Hero

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

Install with
no extra packages

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-hero

Usage

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
ReactNodeDefault "Components with a little gravity"
description
ReactNodeDefault "Copy-paste components for React, built with Ta…
actions
ReactNodeDefault <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
numberDefault 0.3

Share of the hero's area the pile may fill; extra shapes are left out.

HeroShape

idrequired
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

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

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