Skip to content

COMPONENT / bento-grid

Brutal Bento Grid_

Hairline grid whose 2px gaps over a line-coloured parent become the borders. 1, 2 then 4 columns; cells span 1-4. Requires @cybr/tokens.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/bento-grid

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

01 / SPAN 2

The grid is the border

02 / SPAN 1

2px gaps over a line-coloured parent.

03 / SPAN 1

Nothing floats.

04 / SPAN 4 · FULL ROW

Props

Component props
PropTypeDefaultDescription
BentoGrid ...propsComponentProps<"div">—The grid wrapper. Every native <div> attribute is forwarded; className is merged last with cn().
BentoGridItem span1 | 2 | 3 | 41Columns the cell covers. 2 takes the full row from sm; 3 and 4 take the full row at sm, then 3 or 4 columns from lg.
BentoGridItem ...propsComponentProps<"div">—Every native <div> attribute is forwarded to the cell; className is merged last with cn().

Usage

Needs the stylesheet from @cybr/tokens. After the install, import it in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
import { BentoGrid, BentoGridItem } from "@/components/ui/bento-grid";

export function Overview() {
  return (
    <BentoGrid>
      <BentoGridItem span={2}>Spec card</BentoGridItem>
      <BentoGridItem>Access card</BentoGridItem>
      <BentoGridItem>Hardware panel</BentoGridItem>
      <BentoGridItem span={4}>Stat band</BentoGridItem>
    </BentoGrid>
  );
}

Anatomy

Accessibility