| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Credit Card | $450.00 |
| Total | $1,200.00 | ||
Instalación
npx logic2b@next add tableUso
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
<Table>
<TableCaption>Lista de tus facturas recientes.</TableCaption>
<TableHeader>
<TableRow>
<TableHead>Factura</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>FAC001</TableCell>
</TableRow>
</TableBody>
</Table>
Notas de uso
Cada parte es un wrapper ligero del elemento HTML correspondiente y reenvía sus propiedades nativas. Table también coloca <table> dentro de un contenedor con desplazamiento horizontal.
Todos aceptan className y las propiedades estándar del elemento que renderizan.
Ejemplos
Con estado
| Name | Role | Status |
|---|---|---|
| Olivia Martin | Owner | Active |
| Jackson Lee | Member | Active |
| Isabella Nguyen | Member | Invited |
Simple
| Item | Qty | Price |
|---|---|---|
| Keyboard | 2 | $180.00 |
| Monitor | 1 | $320.00 |
| Mouse | 3 | $150.00 |
Playground interactivo
Edita las propiedades del componente y revisa el JSX exacto antes de copiarlo. La vista previa se carga solo cuando esta sección entra en pantalla.
<Table
className="table-auto"
>
<TableHeader>
<TableRow>
<TableHead>Package</TableHead>
<TableHead>Status</TableHead>
<TableHead
className="text-right"
>Tests</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>registry</TableCell>
<TableCell>Passing</TableCell>
<TableCell
className="text-right"
>136</TableCell>
</TableRow>
<TableRow>
<TableCell>web</TableCell>
<TableCell>Passing</TableCell>
<TableCell
className="text-right"
>648</TableCell>
</TableRow>
</TableBody>
<TableCaption>Current quality-gate status.</TableCaption>
</Table>| Package | Status | Tests |
|---|---|---|
| registry | Passing | 136 |
| web | Passing | 648 |
Referencia de API
Generada a partir de las exportaciones públicas de TypeScript en src/ui/table.tsx. Las descripciones técnicas conservan el texto canónico del código fuente.
Table
ComponenteProps: TableProps| Propiedad | Tipo | Obligatoria | Valor predeterminado | Descripción |
|---|---|---|---|---|
containerProps | React.ComponentProps<"div"> | No | — | Label and focus a scrolling table region when its content needs overflow. |
TableHeader
ComponenteProps: React.ComponentProps<"thead">TableBody
ComponenteProps: React.ComponentProps<"tbody">TableFooter
ComponenteProps: React.ComponentProps<"tfoot">TableHead
ComponenteProps: React.ComponentProps<"th">TableRow
ComponenteProps: React.ComponentProps<"tr">TableCell
ComponenteProps: React.ComponentProps<"td">TableCaption
ComponenteProps: React.ComponentProps<"caption">Contrato de accesibilidad
Comportamiento legible por máquinas y responsabilidades de quien integra table. Los detalles normativos conservan el texto canónico del registro.
- Soporte
- Semántica nativa
- Patrón
- data table
- HTML table elements
Semántica incorporada
- Uses native table, row, header and cell elements.
Responsabilidades de integración
- Add a caption, scope headers correctly and provide a non-visual name for interactive controls in cells.