Feature bento
Two wide soft cards over three, each with a bottom glow and an optional visual.
Render exactly the page you need
Every option is one parameter.
Every format in one endpoint
Images, documents and text.
Dark mode
Geo-located rendering
Built for AI agents
Install
$ npx shadcn@latest add @nudgekit/feature-bentoOr with no config: npx shadcn@latest add https://ui.nudgekit.app/r/feature-bento.json
Brings in @nudgekit/card, and the theme.
Usage
usage.tsx
import { FeatureBento } from "@/components/feature-bento"
<FeatureBento
features={[
{ title: "Render exactly the page you need", description: "…", visual: <CardPanel>…</CardPanel> },
{ title: "Every format in one endpoint" },
{ title: "Dark mode" },
{ title: "Geo-located rendering" },
{ title: "Built for AI agents" },
]}
/>Do
- Give the first two features a small product visual.
Don't
- Put icons in coloured circles at the top of every card.
Code
What the CLI writes into your project. It is yours to change.
components/feature-bento.tsx
import * as React from "react";
import { cn } from "@/lib/utils";
import { Card, CardDescription, CardTitle } from "@/components/ui/card";
export interface Feature {
title: string;
description?: string;
/** A small product visual under the text. */
visual?: React.ReactNode;
}
export interface FeatureBentoProps {
/** Two wide features on top (the first is larger), then three below. */
features: [Feature, Feature, Feature?, Feature?, Feature?];
className?: string;
}
const glows = [2, 1, 3, 2, 1] as const;
/** Soft cards with a bottom glow: 1.6fr + 1fr on top, three equal cards below. */
function FeatureBento({ features, className }: FeatureBentoProps) {
const [a, b, ...rest] = features;
const bottom = rest.filter(Boolean) as Feature[];
const cell = (f: Feature, i: number, tall: boolean) => (
<Card key={f.title} glow={glows[i]} className={tall ? "min-h-80" : "min-h-[270px]"}>
<CardTitle>{f.title}</CardTitle>
{f.description && <CardDescription>{f.description}</CardDescription>}
{f.visual && <div className="mt-6">{f.visual}</div>}
</Card>
);
return (
<div data-slot="feature-bento" className={cn("grid gap-4", className)}>
<div className="grid gap-4 md:grid-cols-[1.6fr_1fr]">
{cell(a, 0, true)}
{cell(b, 1, true)}
</div>
{bottom.length > 0 && <div className="grid gap-4 md:grid-cols-3">{bottom.map((f, i) => cell(f, i + 2, false))}</div>}
</div>
);
}
export { FeatureBento };