@antadesign/table
    Preparing search index...

    Interface TableProps<T>

    interface TableProps<T> {
        className?: string;
        style?: CSSProperties;
        children?: ReactNode;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        data: TableSource<T>;
        columns?: Record<string, TableColumn<T>>;
        virtualizer?: TableVirtualizer;
        virtualizerProps?: TableVirtualizerOptions;
        height?: number | "auto";
        minHeight?: number;
        maxHeight?: number;
        minRowsToDisplay?: number;
        width?: number;
        maxWidth?: number;
        headerHeight?: number;
        hideHeader?: boolean;
        hideRowCount?: boolean;
        rowMinHeight?: number;
        rowMaxHeight?: number;
        rowHeightFixed?: boolean;
        rowClassName?: (row: T, index: number) => string | undefined;
        borders?: { row?: boolean; column?: boolean };
        onRowClick?: (event: MouseEvent, row: T, index: number) => void;
        selected?: readonly number[];
        onSelectChange?: (
            selected: number[],
            event: MouseEvent | KeyboardEvent,
            index: number | null,
        ) => void;
        filtering?: false | TableFilterFn<T>;
        filterOptions?: TableFilterOption[];
        maxFilterOptions?: number;
        filterFacets?: SelectFacet[];
        filterValue?: TableFilterValue;
        defaultFilterValue?: TableFilterValue;
        onFilterChange?: (value: TableFilterValue) => void;
        textFilterFields?: string[];
        textFilterPlaceholder?: string;
        searching?: boolean;
        defaultSearch?: string;
        sorting?: TableSorting;
        defaultSorting?: TableSorting;
        onSortingChange?: (sorting: TableSorting) => void;
        columnHiding?: boolean;
        defaultHiddenColumns?: string[];
        expand?: boolean;
        download?: boolean | TableDownloadOptions<T>;
        dataLoading?: boolean;
        follow?: boolean;
        onContainerResize?: (size: { width: number; height: number }) => void;
        empty?: ReactNode;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Type Parameters

    • T

    Hierarchy

    • BaseProps
      • TableProps

    Indexable

    • [key: `data-${string}`]: unknown

      Any data-* attribute is forwarded to the rendered element.

    • [key: `aria-${string}`]: unknown

      Any aria-* attribute is forwarded to the rendered element.

    Index
    className?: string

    Adds CSS classes to the root element and preserves its existing classes.

    style?: CSSProperties

    Inline CSS styles on the root element.

    children?: ReactNode

    Content to render in place of any default content.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute, shown as a browser tooltip on hover.

    slot?: string

    Named slot in a parent web component, such as slot="header" in a <Dialog>.

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).

    data: TableSource<T>

    The rows: an array, or a range source that builds rows on demand. Rows are objects; each key is a column.

    columns?: Record<string, TableColumn<T>>

    Column settings by key. When set, these are the columns, in this order; otherwise the keys of the first rows.

    virtualizer?: TableVirtualizer

    Renders the rows. Pass VirtualScroll from @antadesign/virtual-scroll to mount only the rows near the viewport. Without it, every row is mounted in a native scroll container.

    virtualizerProps?: TableVirtualizerOptions
    height?: number | "auto"

    Frame height in pixels, or auto to fit every row. The frame is the bordered header and rows; the toolbar and row count are outside it. Fewer rows than fill height shrink the frame to them, so it never leaves a gap.

    minHeight?: number
    maxHeight?: number
    minRowsToDisplay?: number

    Rows the frame fits before its container asks for more.

    10
    
    width?: number

    Frame width in pixels. Defaults to the width of the container.

    maxWidth?: number
    headerHeight?: number
    34
    
    hideHeader?: boolean
    hideRowCount?: boolean

    Hides the row count below the frame. false shows it.

    true
    
    rowMinHeight?: number

    Minimum row height, without its border.

    26
    
    rowMaxHeight?: number

    Rows taller than this are clipped.

    rowHeightFixed?: boolean

    Every row is rowMinHeight tall; cell text does not wrap.

    rowClassName?: (row: T, index: number) => string | undefined
    borders?: { row?: boolean; column?: boolean }

    Row and column borders.

    { row: true, column: true }
    
    onRowClick?: (event: MouseEvent, row: T, index: number) => void
    selected?: readonly number[]

    Selected rows, by index in data. Pair with onSelectChange.

    onSelectChange?: (
        selected: number[],
        event: MouseEvent | KeyboardEvent,
        index: number | null,
    ) => void

    Turns on selection. Receives the whole new selection on every row click, and [] with a null index on Escape. Click selects one row; Ctrl or Cmd + click toggles a row; Shift + click selects a range; Ctrl or Cmd + Shift + click adds a range.

    filtering?: false | TableFilterFn<T>

    false removes the text filter and the facets. A function replaces the built-in filter.

    filterOptions?: TableFilterOption[]

    Facets for the Filter menu. Defaults to one per column whose values are primitives.

    maxFilterOptions?: number

    Inferred facets skip columns with more distinct values than this in their first 500 rows. Defaults to 100. Does not limit filterOptions.

    filterFacets?: SelectFacet[]

    More facets, such as custom ones. Only a filtering function sees their values.

    filterValue?: TableFilterValue

    Controlled filter state.

    defaultFilterValue?: TableFilterValue
    onFilterChange?: (value: TableFilterValue) => void
    textFilterFields?: string[]

    Columns the text filter searches. Defaults to every column with primitive values.

    textFilterPlaceholder?: string
    Filter by text
    
    searching?: boolean

    The search field, which marks matches in cells and steps through them.

    true
    
    defaultSearch?: string
    sorting?: TableSorting

    Controlled sort order.

    defaultSorting?: TableSorting
    onSortingChange?: (sorting: TableSorting) => void
    columnHiding?: boolean

    The Columns menu, which hides and shows columns.

    true
    
    defaultHiddenColumns?: string[]

    Columns hidden on mount, by key.

    expand?: boolean

    The Expand action, which fills the viewport with the table.

    true
    
    download?: boolean | TableDownloadOptions<T>

    The Download menu, or its options.

    true
    
    dataLoading?: boolean

    The rows are placeholders for data still arriving: controls that act on rows are disabled.

    follow?: boolean

    Start at the last row and keep it in view as rows are appended.

    onContainerResize?: (size: { width: number; height: number }) => void

    Fires with the size of the space the table occupies when it is measured or resized.

    empty?: ReactNode

    Shown when there are no rows.