BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/9ui/table

table

9ui/table
FreeComponent

9ui publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by 9ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://9ui.dev/r/table.json

Source

ui/table.tsx9ui.dev/r/table.json
1import * as React from "react"
2
3import { cn } from "@/lib/utils"
4
5function Table({ className, ...props }: React.ComponentProps<"table">) {
6 return (
7 <div
8 data-slot="table-container"
9 className="relative w-full overflow-x-auto"
10 >
11 <table
12 data-slot="table"
13 className={cn("w-full caption-bottom text-sm", className)}
14 {...props}
15 />
16 </div>
17 )
18}
19
20function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
21 return (
22 <thead
23 data-slot="table-header"
24 className={cn("[&_tr]:border-b", className)}
25 {...props}
26 />
27 )
28}
29
30function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
31 return (
32 <tbody
33 data-slot="table-body"
34 className={cn("[&_tr:last-child]:border-0", className)}
35 {...props}
36 />
37 )
38}
39
40function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
41 return (
42 <tfoot
43 data-slot="table-footer"
44 className={cn(
45 "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
46 className
47 )}
48 {...props}
49 />
50 )
51}
52
53function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
54 return (
55 <tr
56 data-slot="table-row"
57 className={cn(
58 "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
59 className
60 )}
61 {...props}
62 />
63 )
64}
65
66function TableHead({ className, ...props }: React.ComponentProps<"th">) {
67 return (
68 <th
69 data-slot="table-head"
70 className={cn(
71 "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
72 className
73 )}
74 {...props}
75 />
76 )
77}
78
79function TableCell({ className, ...props }: React.ComponentProps<"td">) {
80 return (
81 <td
82 data-slot="table-cell"
83 className={cn(
84 "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
85 className
86 )}
87 {...props}
88 />
89 )
90}
91
92function TableCaption({
93 className,
94 ...props
95}: React.ComponentProps<"caption">) {
96 return (
97 <caption
98 data-slot="table-caption"
99 className={cn("text-muted-foreground mt-4 text-xs", className)}
100 {...props}
101 />
102 )
103}
104
105export {
106 Table,
107 TableHeader,
108 TableBody,
109 TableFooter,
110 TableHead,
111 TableRow,
112 TableCell,
113 TableCaption,
114}

Files it writes

  • src/components/ui/table.tsx

Facts

Registry
9ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on 9ui 9ui.dev borabaloglu/9ui on GitHub Raw registry item This item as JSON

More from 9ui

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordion9uiComponentsFreeno deps
alertalert9uiComponentsFreeno deps
alert-dialogalert-dialog9uiComponentsFreeno deps
aspect-ratioaspect-ratio9uiComponentsFreeno deps
autocompleteautocomplete9uiComponentsFreeno deps
avataravatar9uiComponentsFreeno deps
badgebadge9uiComponentsFreeno deps
breadcrumbsbreadcrumbs9uiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex