Saltar al contenido
Logic2BUI

Buscar en la documentación

Busca componentes y documentación

Nuevo
Menú

Tabla

Componente de tabla adaptable.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
Total$1,200.00

Instalación

npx logic2b@next add table

Uso

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

NameRoleStatus
Olivia MartinOwnerActive
Jackson LeeMemberActive
Isabella NguyenMemberInvited

Simple

ItemQtyPrice
Keyboard2$180.00
Monitor1$320.00
Mouse3$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.

JSX generado
<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>

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.

Ver JSON

Table

Componente
Props: TableProps
PropiedadTipoObligatoriaValor predeterminadoDescripción
containerPropsReact.ComponentProps<"div">No—Label and focus a scrolling table region when its content needs overflow.

TableHeader

Componente
Props: React.ComponentProps<"thead">

TableBody

Componente
Props: React.ComponentProps<"tbody">

TableFooter

Componente
Props: React.ComponentProps<"tfoot">

TableHead

Componente
Props: React.ComponentProps<"th">

TableRow

Componente
Props: React.ComponentProps<"tr">

TableCell

Componente
Props: React.ComponentProps<"td">

TableCaption

Componente
Props: 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.

Ver JSON
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.