Table

Tabla composable de bajo nivel. Combina Table, TableHeader, TableBody, TableRow, TableHead y TableCell para construir cualquier layout: plain o card, densidad cómoda o compacta, filas zebra, hover y cabecera fija. Para sort/filter/paginación usa DataTable.

JuegoGéneroEstadoMAU
Wuthering WavesARPGpublicado12,4 M
Honkai: Star RailJRPGpublicado9,7 M
Rinascita OnlineMMORPGbeta2,1 M

Instalación#

bash
pnpm add @tsukira/ui

Uso#

tsx
import {  Table, TableHeader, TableBody,  TableRow, TableHead, TableCell,} from "@tsukira/ui"; <Table variant="card" hoverable>  <TableHeader>    <TableRow>      <TableHead>Nombre</TableHead>      <TableHead align="right">Importe</TableHead>    </TableRow>  </TableHeader>  <TableBody>    <TableRow>      <TableCell>Factura #001</TableCell>      <TableCell align="right"> 1.200</TableCell>    </TableRow>  </TableBody></Table>

Ejemplos#

Variante plain y card

plain (sin borde) · card (borde + radio + sombra sutil)
ProductoPrecio
Pase de temporada€ 9,99
Pack de skins€ 4,99
ProductoPrecio
Pase de temporada€ 9,99
Pack de skins€ 4,99

Densidad

comfortable (default) · compact — útil cuando el espacio es limitado
FranquiciaGéneroRating
Kuro GamesARPG8,9
HoYoverseJRPG9,1
Level-5Gacha RPG7,8
CygamesTáctico8,3

Hoverable y fila seleccionada

hoverable activa el highlight en hover · selected resalta la fila activa
NombreRol
Ana LópezAdmin
Bruno DíazEditor
Carla RuizViewer

Fusión: listado de usuarios

Table + Avatar + Badge de estado + Chip de rol
UsuarioRolEstado
ALAna López
Adminactivo
BDBruno Díaz
Editoractivo
CRCarla Ruiz
Viewerinactivo
DMDiego Mora
Viewerinactivo

Fusión: facturación con acciones por fila

Table + Button ghost para Ver detalle y Descargar por cada factura
Nº FacturaClienteImporteEstadoAcciones
F-2026-001Kuro Games SL€ 28.500pagada
F-2026-002HoYoverse Europe€ 19.200pendiente
F-2026-003Level-5 Studios€ 7.800vencida

API#

TablePropsextends Omit<TableHTMLAttributes<HTMLTableElement>, 'title'>
PropTipoDefaultDescripción
variant'plain' | 'card''plain'Variante visual. Default 'plain'.
density'comfortable' | 'compact''comfortable'Densidad. Default 'comfortable'.
stripedbooleanFilas alternadas zebra.
hoverablebooleanHover en filas.
stickyHeaderbooleanSticky thead al scrollear.
maxHeightnumber | stringMax-height del wrapper (px o string CSS) — habilita scroll vertical.
widthnumber | string'100%'Ancho del wrapper. Default '100%'.
TableRowPropsextends HTMLAttributes<HTMLTableRowElement>
PropTipoDefaultDescripción
selectedbooleanFila seleccionada (estilo).
clickablebooleanFila clicable (cursor + hover).
TableCellPropsextends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'>
PropTipoDefaultDescripción
align'left' | 'center' | 'right'Alineación del contenido.
truncatebooleanNo envolver texto.
widthnumber | stringAncho (px o '20%').
TableEmptyPropsextends HTMLAttributes<HTMLTableCellElement>
PropTipoDefaultDescripción
colSpan*numberCuántas columnas span (=colSpan).
messageReactNodeMensaje.
iconReactNodeIcono.