# Bento Grid (Andromeda Pro)

Bento Grid is a component of the Premium Andromeda Pro design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Lays out cards on a grid where one can span several columns and cards in a row line up their parts.

- Design system: [Andromeda Pro](https://aicanvas.me/design-systems/andromeda-pro.md)
- License: Premium (proprietary)
- Install slug: `andromeda-pro-bento-grid`
- Page: https://aicanvas.me/design-systems/andromeda-pro/bento-grid

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-pro-bento-grid
```

Requires Premium. Without a Premium token the command writes a placeholder (a `PremiumLocked` notice) instead of the component.

Every Andromeda Pro component at once: `npx shadcn@latest add @aicanvas/andromeda-pro`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda-pro/components/BentoGrid.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { BentoGrid } from '@/components/aicanvas/andromeda-pro/components/BentoGrid'
```

## Example

```tsx
import { BentoGrid, BentoGridItem } from '@/components/aicanvas/andromeda-pro/components/BentoGrid'

<BentoGrid columns={2}>
  <BentoGridItem><section>Open invoices</section></BentoGridItem>
  <BentoGridItem><section>Monthly revenue</section></BentoGridItem>
  <BentoGridItem colSpan="full"><section>Recent payments</section></BentoGridItem>
</BentoGrid>
```

## Parts

Bento Grid is built from `BentoGrid` and `BentoGridItem`. Each part has its own props table below.

## Props

### BentoGrid

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `columns?` | `1\|2\|3\|4` | `2` | Columns on a desktop row. |
| `tabletColumns?` | `1\|2` |  | Columns between md and lg. Defaults to 2 for a three or four column grid, else to `columns`. |
| `gap?` | `keyof tokens.spacing` | `3` | The gutter between panels, a spacing step, on both axes. The system's panel gutter is spacing[3]. |
| `children` | `React.ReactNode` |  | BentoGridItems. |

### BentoGridItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colSpan?` | `number\|'full'` | `1` | Columns the panel runs across; 'full' takes the whole row at every width. Clamped to the columns the grid has at each width. |
| `rowSpan?` | `number` | `1` | Rows the panel runs down, beside shorter neighbours. Dropped below md, where nothing stands beside it. |
| `rows?` | `number` |  | Shared rows: the panel spans this many grid rows and lays its children on them (subgrid), so siblings with the same count line up part by part. One child per row. Overrides `rowSpan`. |
| `rowGap?` | `keyof tokens.spacing` | `6` | The space between the shared rows, a spacing step; the card inset by default. |
| `asChild?` | `boolean` | `false` | Render the only child (the caller's Card) as the item, merging the item's class, style and ref onto it. |
| `render?` | `React.ReactElement` |  | The same as asChild, in the Base UI form some installers rewrite asChild into: the item renders this element with its class, style and ref merged on, and its children become the element's children. |
| `children` | `React.ReactNode` |  | The panel content, or with `asChild` the panel itself. |

## Remix prompt

Only when the user wants Bento Grid rebuilt from scratch instead of installed: the public part of its remix prompt is in the Remix panel at https://aicanvas.me/design-systems/andromeda-pro/bento-grid.

## More Andromeda Pro components

- [Button](https://aicanvas.me/design-systems/andromeda-pro/button.md)
- [Card](https://aicanvas.me/design-systems/andromeda-pro/card.md)
- [Checkbox](https://aicanvas.me/design-systems/andromeda-pro/checkbox.md)
- [Choice Card](https://aicanvas.me/design-systems/andromeda-pro/choice-card.md)
- [Collapsible](https://aicanvas.me/design-systems/andromeda-pro/collapsible.md)
