Skip to Content
Kokonut UI

CD-05Cards

Widget Grid

Dashboard widgets you lift, drag and resize on a 6-column grid, with spring physics and full keyboard support.

Install with
lucide-react, motion

PROOnboarding Checklist and more like it are in Kokonut UI Pro

Installation

Widget Grid is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/bento-grid.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/bento-grid

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/bento-grid.tsx.

npm install lucide-react motion

Usage

import WidgetGrid from "@/components/kokonutui/bento-grid";

export default function Example() {
  return <WidgetGrid />;
}

Props

items
WidgetGridItem[]Default demo data
layout
WidgetLayoutItem[]

Controlled order and spans.

defaultLayout
WidgetLayoutItem[]

Uncontrolled starting order and spans.

onLayoutChange
(layout: WidgetLayoutItem[]) => void

Called on every reorder or resize, including live moves while dragging.

className
string

Extra classes for the root element.

rowHeight
numberDefault 176

Height of one row in pixels.

WidgetGridItem

idrequired
string
titlerequired
string
icon
ReactNode
renderrequired
(size: WidgetSize) => ReactNode

Renders the widget body for the size its column span maps to.

defaultSpan
number

Span used when no layout is given. Defaults to 2.

WidgetLayoutItem

idrequired
string
spanrequired
number

Width in columns of the 6-column grid (2 to 6).

WidgetSize

type WidgetSize = "s" | "m" | "l";

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
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.