table
accelya-ui-lib/tableFreeComponent
shadcn/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/table.jsonSource
1import * as React from "react"23import { cn } from "@/lib/utils"45const Table = React.forwardRef<6 HTMLTableElement,7 React.HTMLAttributes<HTMLTableElement>8>(({ className, ...props }, ref) => (9 <div className="relative w-full overflow-auto">10 <table11 ref={ref}12 className={cn("w-full caption-bottom text-sm", className)}13 {...props}14 />15 </div>16))17Table.displayName = "Table"1819const TableHeader = React.forwardRef<20 HTMLTableSectionElement,21 React.HTMLAttributes<HTMLTableSectionElement>22>(({ className, ...props }, ref) => (23 <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />24))25TableHeader.displayName = "TableHeader"2627const TableBody = React.forwardRef<28 HTMLTableSectionElement,29 React.HTMLAttributes<HTMLTableSectionElement>30>(({ className, ...props }, ref) => (31 <tbody32 ref={ref}33 className={cn("[&_tr:last-child]:border-0", className)}34 {...props}35 />36))37TableBody.displayName = "TableBody"3839const TableFooter = React.forwardRef<40 HTMLTableSectionElement,41 React.HTMLAttributes<HTMLTableSectionElement>42>(({ className, ...props }, ref) => (43 <tfoot44 ref={ref}45 className={cn(46 "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",47 className48 )}49 {...props}50 />51))52TableFooter.displayName = "TableFooter"5354const TableRow = React.forwardRef<55 HTMLTableRowElement,56 React.HTMLAttributes<HTMLTableRowElement>57>(({ className, ...props }, ref) => (58 <tr59 ref={ref}60 className={cn(61 "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",62 className63 )}64 {...props}65 />66))67TableRow.displayName = "TableRow"6869const TableHead = React.forwardRef<70 HTMLTableCellElement,71 React.ThHTMLAttributes<HTMLTableCellElement>72>(({ className, ...props }, ref) => (73 <th74 ref={ref}75 className={cn(76 "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",77 className78 )}79 {...props}80 />81))82TableHead.displayName = "TableHead"8384const TableCell = React.forwardRef<85 HTMLTableCellElement,86 React.TdHTMLAttributes<HTMLTableCellElement>87>(({ className, ...props }, ref) => (88 <td89 ref={ref}90 className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}91 {...props}92 />93))94TableCell.displayName = "TableCell"9596const TableCaption = React.forwardRef<97 HTMLTableCaptionElement,98 React.HTMLAttributes<HTMLTableCaptionElement>99>(({ className, ...props }, ref) => (100 <caption101// … truncated
Files it writes
More from shadcn/ui
All 357 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | 1 dep | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | 1 dep | |
| avataravatar | shadcn/ui | Components | Free | 1 dep | |
| badgebadge | shadcn/ui | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | 1 dep | |
| buttonbutton | shadcn/ui | Components | Free | 1 dep |
