Brickslab.

@brickslab/ui-web

CSS Grid layout component for bento-style interfaces. Cards span multiple columns and rows to create rich, asymmetric layouts. Propagates reduced-motion preference to all children via context.

Aperçu

Bento layout — 3 colonnes, cellules asymétriques

Performance

Lightning-fast components with zero runtime overhead and tree-shakable exports.

Type-safe

Full TypeScript support.

Design tokens

Consistent visual language.

Open Source

Free forever — MIT license.

Dense packing — cartes de hauteurs variées

Layout

Speed

Code

Zap

Shield

Star

Auto-responsive — colonnes fluides

Performance

Optimized bundle

Code

Clean APIs

Layout

Flexible grid

Speed

Fast renders

BentoGrid Props

PropTypeDéfautRequisDescription
childrenReact.ReactNodeChild elements (typically BentoCard components).
columnsnumber | "auto""auto"Number of columns. "auto" uses auto-fit with minWidth minimum.
minWidthnumber | string250Minimum card width in auto mode. E.g. 200 → "200px", or "15rem".
gapnumber | stringvar(--space-4)Gap between grid items. Accepts CSS tokens or pixel values.
densebooleanfalseEnable CSS Grid dense packing to fill gaps automatically.
autoRowsstring"auto"CSS value for grid-auto-rows. E.g. "180px", "1fr", "minmax(120px, auto)".
styleReact.CSSPropertiesInline styles merged onto the grid container.
asReact.ElementType"div"HTML element or component to render as.
reducedMotion"auto" | "always" | "never""auto"Controls motion reduction. Propagated to child BentoCards via context.

BentoCard Props

PropTypeDéfautRequisDescription
namestringCard title.
descriptionstringCard body text.
IconReact.ElementTypeIcon component (e.g. from react-icons).
colSpannumberNumber of grid columns this card spans.
rowSpannumberNumber of grid rows this card spans.
hoverEffect"lift" | "glow" | "none""none"Hover animation.
hrefstringMakes the card a link.
ctastringCall-to-action label shown at bottom.
backgroundReact.ReactNodeDecorative background layer.
interactivebooleanfalseAdds pointer cursor.
styleReact.CSSPropertiesInline styles merged onto the card.
reducedMotion"auto" | "always" | "never"Per-card override. Inherits from BentoGrid context if omitted.

Usage

tsx
import { BentoGrid, BentoCard } from "@brickslab/ui-web";
import { FiZap, FiCode, FiLayout } from "react-icons/fi";

<BentoGrid columns={3} autoRows="180px" gap="var(--space-4)" dense>
  {/* Hero card — spans 2 cols × 2 rows */}
  <BentoCard
    name="Performance"
    description="Lightning-fast components, zero runtime overhead."
    Icon={FiZap}
    colSpan={2}
    rowSpan={2}
    hoverEffect="lift"
  />
  {/* Regular cards */}
  <BentoCard name="Clean Code" Icon={FiCode} hoverEffect="lift" />
  <BentoCard name="Design System" Icon={FiLayout} hoverEffect="lift" />
  {/* Banner — spans full width */}
  <BentoCard
    name="Open Source"
    description="Free forever."
    colSpan={3}
    hoverEffect="glow"
  />
</BentoGrid>