empty
draco-china-github/emptyFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/empty.jsonSource
1import { cva, type VariantProps } from "class-variance-authority"23import { cn } from "@/registry/radix-sera/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 border-dashed p-12 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-10 shrink-0 items-center justify-center rounded-none bg-muted text-foreground [&_svg:not([class*='size-'])]:size-5",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-lg font-semibold tracking-wider uppercase",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 "mt-0.5 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-4 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}
Files it writes
More from shadcn/ui
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
