Skip to main content
Bento Surface

Bento Surface

Modular 1px hairline grid layout.

Layout
5/16
12 cols

Modular Hairline Architecture

Hover across cells to inspect cursor-tracked emerald radial illumination.

0 kB

Zero Bloat

Pure Tailwind + React primitives.

0.08

1px Hairlines

Balanced alpha contrast across modes.

99.9%

Responsive Token System

Consistent border, radius, and surface elevation rules built for speed.

1. Install Dependencies

$npm install framer-motion lucide-react

2. Copy Component Code

components/ui/BentoSurface.tsx
1"use client";
2
3import React from "react";
4import { motion, useMotionTemplate, useMotionValue } from "framer-motion";
5
6export interface BentoItem {
7 title: string;
8 description: string;
9 metric: string;
10 span?: 1 | 2;
11}
12
13interface BentoSurfaceProps {
14 items: BentoItem[];
15}
16
17function BentoCell({ item }: { item: BentoItem }) {
18 const mouseX = useMotionValue(-200);
19 const mouseY = useMotionValue(-200);
20 const spotlight = useMotionTemplate`radial-gradient(240px circle at ${mouseX}px ${mouseY}px, rgba(16, 185, 129, 0.10), transparent 75%)`;
21
22 return (
23 <div
24 onPointerMove={(e) => {
25 const rect = e.currentTarget.getBoundingClientRect();
26 mouseX.set(e.clientX - rect.left);
27 mouseY.set(e.clientY - rect.top);
28 }}
29 className={`group relative overflow-hidden rounded-2xl border border-black/[0.08] bg-white p-5 transition-colors hover:border-black/20 dark:border-white/[0.08] dark:bg-[#0A0A0A] dark:hover:border-white/20 ${
30 item.span === 2 ? "md:col-span-2" : "md:col-span-1"
31 }`}
32 >
33 <motion.div
34 aria-hidden="true"
35 style={{ background: spotlight }}
36 className="pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100"
37 />
38 <div className="relative z-10 flex h-full flex-col justify-between gap-4">
39 <span className="font-mono text-xs font-medium tabular-nums text-emerald-600 dark:text-emerald-400">
40 {item.metric}
41 </span>
42 <div>
43 <h3 className="text-sm font-medium text-black dark:text-white">
44 {item.title}
45 </h3>
46 <p className="mt-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400">
47 {item.description}
48 </p>
49 </div>
50 </div>
51 </div>
52 );
53}
54
55export function BentoSurface({ items }: BentoSurfaceProps) {
56 return (
57 <div className="grid grid-cols-1 gap-4 md:grid-cols-3">
58 {items.map((item) => (
59 <BentoCell key={item.title} item={item} />
60 ))}
61 </div>
62 );
63}

Usage Example

import { BentoSurface } from "@/components/ui/BentoSurface";
export default function ArchitectureSection() {
return (
<BentoSurface
columns={3}
items={[
{ title: "Zero Runtime Bloat", metric: "0 kB", span: 2 },
{ title: "1px Hairlines", metric: "0.08", span: 1 },
]}
/>
);
}

3. Props Reference

Bento Surface props API reference
PropTypeDefaultDescription
itemsBentoItem[]requiredArray of surface cell configurations with optional 2-column span.
item.span1 | 21Controls grid column span on md+ breakpoints.
item.metricstringrequiredMonospace highlight token rendered at the top of each bento cell.