Display UI

Table

Displays structured data in rows and columns for easy comparison, sorting, and scanning of information.

Loading...

Installation

npx shadcn@latest add https://display-ui.vercel.app/r/Table

Usage

import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeadCell,
  TableRow,
} from "@/components/display-ui/Table"
<Table>
  <TableHead>
    <TableRow>
      <TableHeadCell>Sr no.</TableHeadCell>
      <TableHeadCell>Name</TableHeadCell>
      <TableHeadCell>Email</TableHeadCell>
      <TableHeadCell>Role</TableHeadCell>
      <TableHeadCell>Status</TableHeadCell>
    </TableRow>
  </TableHead>
  <TableBody>
    <TableRow>
      <TableCell>1</TableCell>
      <TableCell>User Name</TableCell>
      <TableCell>user@gmail.com</TableCell>
      <TableCell>Web Developer</TableCell>
      <TableCell>Active </TableCell>
    </TableRow>
  </TableBody>
</Table>

API

Separator Props

For Table Component

AttributeTypeDescriptionDefault
childrenReactNode | ReactNode[]Table structure content. Typically includes TableHead and TableBody components.-
classNamestringAdditional CSS classes to customize the table styling.-

For Table Head

AttributeTypeDescriptionDefault
childrenReactNode | ReactNode[]Header rows of the table. Typically composed of TableRow and TableHeadCell components.-
classNamestringAdditional CSS classes to customize the table header styling.-

For Table Body

AttributeTypeDescriptionDefault
childrenReactNode | ReactNode[]Body rows of the table. Typically composed of TableRow and TableCell components.-
classNamestringAdditional CSS classes to customize the table body styling.-

For Table Row

AttributeTypeDescriptionDefault
childrenReactNode | ReactNode[]Cells rendered within a table row.-
classNamestringAdditional CSS classes to customize the table row styling.-

For Table Head Cell

AttributeTypeDescriptionDefault
childrenReactNodeContent displayed inside a table header cell (th).-
classNamestringAdditional CSS classes to customize the table header cell styling.-

For Table Cell

AttributeTypeDescriptionDefault
childrenReactNodeContent displayed inside a table data cell (td).-
classNamestringAdditional CSS classes to customize the table cell styling.-

Credits

This component is inspired by Rehman Kalawant Design Shared On Github.

On this page