Grid List with Dropdown
blocks/grid-list-01FreeBlock
A grid list with dropdown block.
Install it
npx shadcn@latest add https://blocks.so/r/grid-list-01.jsonSource
1import { MoreVertical } from 'lucide-react';2import { Button } from '@/components/ui/button';3import { Card, CardContent } from '@/components/ui/card';4import {5 DropdownMenu,6 DropdownMenuContent,7 DropdownMenuItem,8 DropdownMenuSeparator,9 DropdownMenuTrigger,10} from '@/components/ui/dropdown-menu';1112const bookCollections = [13 { name: 'Science Fiction', initials: 'SF', href: '#', books: 37 },14 { name: 'Mystery Thrillers', initials: 'MT', href: '#', books: 29 },15 { name: 'Historical Fiction', initials: 'HF', href: '#', books: 23 },16];1718export default function GridList01() {19 return (20 <div className="flex items-center justify-center p-8">21 <div>22 <h2 className="text-balance font-medium text-muted-foreground text-sm">23 Favorite Book Collections24 </h2>25 <ul26 className="mt-3 grid grid-cols-1 gap-5 sm:gap-6 lg:grid-cols-3"27 role="list"28 >29 {bookCollections.map((collection) => (30 <li className="col-span-1" key={collection.name}>31 <Card className="flex w-full flex-row gap-0 overflow-hidden rounded-md py-0 shadow-2xs">32 <div className="flex w-16 shrink-0 items-center justify-center bg-primary font-medium text-primary-foreground text-sm">33 {collection.initials}34 </div>35 <CardContent className="flex flex-1 items-center justify-between truncate bg-card p-0">36 <div className="flex-1 truncate px-4 py-2 text-sm">37 <a38 className="font-medium text-foreground hover:text-muted-foreground"39 href={collection.href}40 >41 {collection.name}42 </a>43 <p className="text-pretty text-muted-foreground">44 {collection.books} Books45 </p>46 </div>47 <div className="shrink-0 pr-2">48 <DropdownMenu>49 <DropdownMenuTrigger50 render={51 <Button52 className="h-8 w-8 rounded-full"53 size="icon"54 type="button"55 variant="ghost"56 />57 }58 >59 <span className="sr-only">Open options</span>60// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from blocks
All 76 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Chat with Voice Inputai-01 | blocks | Blocks | Free | 1 dep | |
| AI Chat with Model Selectionai-02 | blocks | Blocks | Free | 1 dep | |
| AI Chat Compact Interfaceai-03 | blocks | Blocks | Free | 1 dep | |
| AI Chat with File Attachmentsai-04 | blocks | Blocks | Free | 1 dep | |
| AI Elements Chatai-05 | blocks | Blocks | Free | 2 deps | |
| Command Menu with Groupscommand-menu-01 | blocks | Blocks | Free | 1 dep | |
| Command Menu with Keyboard Shortcutscommand-menu-02 | blocks | Blocks | Free | 1 dep | |
| Command Menu with Documentation Searchcommand-menu-03 | blocks | Blocks | Free | 1 dep |
