Components
Bento Grid
A bento layout for mixed-size marketing highlights.
Installation
$ npx veil-ui@latest add bento-gridUsage
import { BentoGrid } from "@/components/ui/bento-grid";
<BentoGrid
items={[
{ title: "Composable", description: "Small parts that fit together." },
{ title: "Themeable", description: "Swap brand colors in one place." },
]}
/>;Examples
Basic
Everything composes
Primitives, patterns and page sections share the same tokens and spacing scale.
Themeable
Swap brand colors in one place.
Keyboard first
Focus rings and shortcuts included.
Fast setup
One CLI command per component.
Compact
Copy-paste registry
Own the source from day one.
Accessible defaults
Tested with axe in CI.
Docs included
Every component ships with examples.
API reference
The package exports bento-grid along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.
Accessibility
- Pages keep a single
h1in the hero and useh2/h3for section hierarchy. - Call-to-action elements are real links or buttons with discernible labels.
- Decorative icons are
aria-hiddenand meaningful images requirealttext.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add bento-grid --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
import type { BentoGridProps } from "./types";
const props = defineProps<BentoGridProps>();
</script>
<template>
<div
data-slot="bento-grid"
:class="
cn(
'grid auto-rows-min gap-3 sm:grid-cols-2 lg:grid-cols-4',
props.class,
)
"
>
<div
v-for="(item, index) in props.items"
:key="item.title"
:class="
cn(
'flex flex-col gap-3 rounded-xl border bg-background p-5 shadow-xs',
index === 0 && 'sm:col-span-2 sm:row-span-2',
item.className,
)
"
>
<span
v-if="item.icon"
class="flex size-9 items-center justify-center rounded-md bg-primary/10 text-primary [&_svg]:size-4"
>
<component :is="item.icon" />
</span>
<div>
<h3 class="text-sm font-semibold">{{ item.title }}</h3>
<p v-if="item.description" class="mt-1 text-sm text-muted-foreground">
{{ item.description }}
</p>
</div>
<div v-if="item.media" class="mt-auto">
<component :is="item.media" />
</div>
</div>
</div>
</template>