BentoGrid

An asymmetric grid layout for showcasing features in a bento-box style. Use col-span and row-span classes on children to create the asymmetry.

Preview

<script>
  import { BentoGrid } from '@vultra/ui';
</script>

<BentoGrid cols="3">
  <div class="col-span-2 row-span-2 flex min-h-[300px] items-center justify-center rounded-xl bg-[var(--ui-muted)] p-6">
    <span class="text-lg font-semibold">Large feature</span>
  </div>
  <div class="flex items-center justify-center rounded-xl bg-[var(--ui-muted)] p-6">Small</div>
  <div class="flex items-center justify-center rounded-xl bg-[var(--ui-muted)] p-6">Small</div>
  <div class="col-span-3 flex items-center justify-center rounded-xl bg-[var(--ui-muted)] p-6">Full width</div>
</BentoGrid>

Creating asymmetric layouts

Apply col-span-* and row-span-* Tailwind classes to children:

ClassEffect
col-span-2Spans 2 columns
col-span-3Full width
row-span-2Double height

Props

PropTypeDefault
cols'2' \| '3' \| '4''3'
classstring

Install

npx @vultra/cli add bento-grid