Bento Grid 1
shadcnstore/bento-grid-1FreeBlock
A responsive grid of listings
Install it
npx shadcn@latest add https://shadcnstore.com/r/bento-grid-1.jsonSource
1'use client'23import { useState } from 'react'4import { SlidersHorizontal } from 'lucide-react'56import { Button } from '@/components/ui/button'78import { destinationsByRegion, type Destination, type RegionId } from "@/components/data/bento-grid-1-data"9import { BentoGrid1DestinationCard } from './bento-grid-1-destination-card'10import { BentoGrid1FilterColumn, BentoGrid1FilterGrid, BentoGrid1FilterItem } from './bento-grid-1-filter-grid'11import { BentoGrid1SlidingTabs } from './bento-grid-1-sliding-tabs'1213const columnHeights = [14 ['h-[300px]', 'h-[300px]'],15 ['h-[420px]', 'h-[180px]'],16 ['h-[300px]', 'h-[300px]'],17] as const1819function buildColumns(items: Destination[]) {20 return columnHeights.map((heights, columnIndex) => {21 const start = columnIndex * 222 return heights23 .map((heightClass, rowIndex) => {24 const destination = items[start + rowIndex]25 if (!destination) {26 return null27 }2829 return { destination, heightClass }30 })31 .filter((entry): entry is { destination: Destination; heightClass: (typeof heights)[number] } => entry !== null)32 })33}3435export function BentoGrid1() {36 const [activeRegion, setActiveRegion] = useState<RegionId>('top-rated')37 const [favorites, setFavorites] = useState<number[]>([])3839 const activeDestinations = destinationsByRegion[activeRegion]40 const columns = buildColumns(activeDestinations)4142 const toggleFavorite = (id: number) => {43 setFavorites(prev => (prev.includes(id) ? prev.filter(favId => favId !== id) : [...prev, id]))44 }4546 return (47 <section className='w-full'>48 <div className='mx-auto w-full max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>49 <div className='mb-8 flex flex-col gap-2 text-center sm:mb-12 lg:mb-16'>50 <h2 className='text-3xl tracking-tight sm:text-4xl lg:text-5xl'>51 <span className='text-foreground font-bold'>Top</span>{' '}52 <span className='text-foreground font-semibold'>Destinations</span>53 </h2>54 <p className='text-muted-foreground mx-auto max-w-2xl'>55 There are Many Variations of Passages Of Lorem Ipsum Available56 </p>57 </div>5859 <div className='mb-8 flex flex-wrap items-center justify-between gap-4'>60 <BentoGrid1SlidingTabs value={activeRegion} onValueChange={setActiveRegion} />61 <Button variant='outline' className='h-9 cursor-pointer px-4 py-2'>62 <SlidersHorizontal data-icon='inline-start' />63 Filter64// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from ShadcnStore
All 228 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| About 1about-1 | ShadcnStore | Blocks | Free | 1 dep · 3 files | |
| About 2about-2 | ShadcnStore | Blocks | Paid | 2 deps · 3 files | |
| AI Chat 1ai-chat-1 | ShadcnStore | Blocks | Free | 2 deps · 4 files | |
| AI Chat 2ai-chat-2 | ShadcnStore | Blocks | Paid | 1 dep · 4 files | |
| AI Prompt 1ai-prompt-1 | ShadcnStore | Blocks | Paid | 1 dep · 3 files | |
| App Dashboard 1app-1 | ShadcnStore | Blocks | Free | 1 dep · 4 files | |
| Task Management 2app-2 | ShadcnStore | Blocks | Paid | 2 deps · 4 files | |
| Foundational Application Shellapp-shell-1 | ShadcnStore | Blocks | Free | 1 dep · 4 files |
