empty
neobrutalism/emptyFreeComponent
neobrutalism publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by neobrutalism on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://retroui.dev/r/empty.jsonSource
1import { cva, type VariantProps } from "class-variance-authority"23import { cn } from "@/lib/utils"45function Empty({ className, ...props }: React.ComponentProps<"div">) {6 return (7 <div8 data-slot="empty"9 className={cn(10 "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded border-2 bg-card p-6 text-center text-balance",11 className12 )}13 {...props}14 />15 )16}1718function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {19 return (20 <div21 data-slot="empty-header"22 className={cn("flex max-w-sm flex-col items-center gap-2", className)}23 {...props}24 />25 )26}2728const emptyMediaVariants = cva(29 "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",30 {31 variants: {32 variant: {33 default: "bg-transparent",34 icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",35 },36 },37 defaultVariants: {38 variant: "default",39 },40 }41)4243function EmptyMedia({44 className,45 variant = "default",46 ...props47}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {48 return (49 <div50 data-slot="empty-icon"51 data-variant={variant}52 className={cn(emptyMediaVariants({ variant, className }))}53 {...props}54 />55 )56}5758function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {59 return (60 <div61 data-slot="empty-title"62 className={cn(63 "cn-font-heading text-sm font-medium tracking-tight",64 className65 )}66 {...props}67 />68 )69}7071function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {72 return (73 <div74 data-slot="empty-description"75 className={cn(76 "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",77 className78 )}79 {...props}80 />81 )82}8384function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {85 return (86 <div87 data-slot="empty-content"88 className={cn(89 "flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance",90 className91 )}92 {...props}93 />94 )95}9697export {98 Empty,99 EmptyHeader,100 EmptyTitle,101 EmptyDescription,102 EmptyContent,103 EmptyMedia,104}
What it pulls in
npm packages
Files it writes
More from neobrutalism
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalism | Components | Free | 2 deps | |
| alertalert | neobrutalism | Components | Free | 2 deps | |
| alert-dialogalert-dialog | neobrutalism | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | neobrutalism | Components | Free | 1 dep | |
| avataravatar | neobrutalism | Components | Free | 1 dep | |
| badgebadge | neobrutalism | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | neobrutalism | Components | Free | 2 deps | |
| buttonbutton | neobrutalism | Components | Free | 2 deps |
