@yarcl/react
    Preparing search index...

    Variable TableConst

    Table: (__namedParameters: TableProps) => Element & {
        Body: (
            props: DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>>,
        ) => Element;
        Cell: (__namedParameters: TableCellProps) => Element;
        ColumnResizer: (__namedParameters: TableColumnResizerProps) => Element;
        Columns: (__namedParameters: TableColumnsProps) => Element;
        ColumnVisibility: <Id extends string>(
            __namedParameters: TableColumnVisibilityProps<Id>,
        ) => Element;
        Head: (
            props: DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>>,
        ) => Element;
        HeaderCell: (__namedParameters: TableHeaderCellProps) => Element;
        Row: (__namedParameters: TableRowProps) => Element;
        SelectAllCell: (__namedParameters: TableSelectAllCellProps) => Element;
        SelectionCell: (__namedParameters: TableSelectionCellProps) => Element;
        VirtualBody: <T>(__namedParameters: TableVirtualBodyProps<T>) => Element;
    } = ...

    A data table with density from the config, sortable columns, row selection and row virtualization.

    Type Declaration

      • (__namedParameters: TableProps): Element
      • Renders the table frame and shares its scroll container and density with compound parts.

        Parameters

        Returns Element

    <Table density="compact" striped caption="Invoices">
    <Table.Head>
    <Table.Row>
    <Table.SelectAllCell checked={allSelected} onCheckedChange={toggleAll} />
    <Table.HeaderCell sortable sortDirection={sortDir} onSort={setSortDir}>Customer</Table.HeaderCell>
    <Table.HeaderCell align="end">Amount</Table.HeaderCell>
    </Table.Row>
    </Table.Head>
    <Table.VirtualBody items={invoices} estimateRowHeight={48} getItemKey={(invoice) => invoice.id}>
    {(invoice) => (
    <Table.Row key={invoice.id} selected={selected.has(invoice.id)}>
    <Table.SelectionCell aria-label={`Select ${invoice.customer}`} checked={selected.has(invoice.id)} onCheckedChange={() => toggle(invoice.id)} />
    <Table.Cell>{invoice.customer}</Table.Cell>
    <Table.Cell align="end">{invoice.amount}</Table.Cell>
    </Table.Row>
    )}
    </Table.VirtualBody>
    </Table>