Bento Grid
magicui/bento-gridFreeComponent
Bento grid is a layout used to showcase the features of a product in a simple and elegant way.
Live preview
live · rendered by the registry
Rendered by magicui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://magicui.design/r/bento-grid.jsonSource
1import { type ComponentPropsWithoutRef, type ReactNode } from "react"2import { ArrowRightIcon } from "@radix-ui/react-icons"34import { cn } from "@/lib/utils"5import { Button } from "@/components/ui/button"67interface BentoGridProps extends ComponentPropsWithoutRef<"div"> {8 children: ReactNode9 className?: string10}1112interface BentoCardProps extends ComponentPropsWithoutRef<"div"> {13 name: string14 className: string15 background: ReactNode16 Icon: React.ElementType17 description: string18 href: string19 cta: string20}2122const BentoGrid = ({ children, className, ...props }: BentoGridProps) => {23 return (24 <div25 className={cn(26 "grid w-full auto-rows-[22rem] grid-cols-3 gap-4",27 className28 )}29 {...props}30 >31 {children}32 </div>33 )34}3536const BentoCard = ({37 name,38 className,39 background,40 Icon,41 description,42 href,43 cta,44 ...props45}: BentoCardProps) => (46 <div47 key={name}48 className={cn(49 "group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl",50 // light styles51 "bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]",52 // dark styles53 "dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]",54 className55 )}56 {...props}57 >58 <div>{background}</div>59 <div className="p-4">60 <div className="pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10">61 <Icon className="h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75" />62 <h3 className="text-xl font-semibold text-neutral-700 dark:text-neutral-300">63 {name}64 </h3>65 <p className="max-w-lg text-neutral-400">{description}</p>66 </div>6768 <div69 className={cn(70 "pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden"71 )}72 >73 <Button74 variant="link"75 asChild76 size="sm"77 className="pointer-events-auto p-0"78 >79 <a href={href}>80 {cta}81 <ArrowRightIcon className="ms-2 h-4 w-4 rtl:rotate-180" />82 </a>83 </Button>84 </div>85 </div>8687 <div88 className={cn(89// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from magicui
All 247 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Androidandroid | magicui | Components | Free | no deps | |
| Animated Beamanimated-beam | magicui | Components | Free | 1 dep | |
| Animated Circular Progress Baranimated-circular-progress-bar | magicui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | magicui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | magicui | Components | Free | 1 dep | |
| Animated Listanimated-list | magicui | Components | Free | 1 dep | |
| Animated Shiny Textanimated-shiny-text | magicui | Components | Free | no deps | |
| Theme Toggleranimated-theme-toggler | magicui | Components | Free | 1 dep |
