A grid of tiles in mixed sizes, each with a colour block, a title and a link that slides in on hover. Lays out your main kinds of work on one screen.
How to use
Make two files in your project's components folder: bento-grid.tsx and bento-grid.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
import styles from "./bento-grid.module.css";
interface BentoGridProps extends ComponentPropsWithoutRef<"div"> {
children: ReactNode;
/** Height of each row, as a CSS length. */
rowHeight?: string;
}
interface BentoCardProps extends ComponentPropsWithoutRef<"div"> {
name: string;
/** Set the tile's span with a class of your own, for example `grid-column: span 2; grid-row: span 2`. */
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
import styles from "./bento-grid.module.css";
interface BentoGridProps extends ComponentPropsWithoutRef<"div"> {
children: ReactNode;
/** Height of each row, as a CSS length. */
rowHeight?: string;
}
interface BentoCardProps extends ComponentPropsWithoutRef<"div"> {
name: string;
/** Set the tile's span with a class of your own, for example `grid-column: span 2; grid-row: span 2`. */
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.