Table
Tables are used to organize and present data efficiently in applications. They provide features like sorting, filtering, pagination, and various display modes to handle complex data representations effectively.
| Type | Resource | 
|---|---|
| Design | Figma | 
| Web | Web Storybook | 
| Code | Gitlab | 
Usage
import { Avatar } from 'bio-bind-ui';import { Table } from 'bio-bind-ui';
 
function MyComponent() {
  return (
    <Table
      columns={[
        {
          header: 'Name',
          accessorKey: 'name',
        },
        {
          header: 'Age',
          accessorKey: 'age',
        },
      ]}
      data={[
        { name: 'John Doe', age: 30 },
        { name: 'Jane Smith', age: 25 },
      ]}
    />
  );
}Examples
Default Table
Basic table with standard configuration.
With Pagination
Table with server-side pagination support.
With Filtering
Table with column filtering capabilities.
With Row Selection
Table with selectable rows.
With Variant Colored
Table with variant colored
With Infinite Scroll
Table with infinite scroll loading.
Props
| Prop | Type | Default | Description | 
|---|---|---|---|
| variant | "default" | "neutral" | "colored" | "default" | Visual style of the table | 
| mode | "light" | "dark" | "light" | Theme mode of the table | 
| striped | boolean | false | Enables alternating row colors | 
| columns | ColumnDef<unknown, unknown>[] | Required | Column definitions | 
| data | unknown[] | Required | Table data | 
| showPagination | boolean | false | Shows pagination controls | 
| paginationOptions | PaginationOptions | - | Server-side pagination config | 
| client | boolean | false | Enables client-side operations | 
| loading | boolean | false | Shows loading state | 
| selectedRow | boolean | false | Enables row selection | 
| infinity | boolean | false | Enables infinite scrolling | 
| emptyText | string | "No data available" | Text for empty state | 
| expandedRow | boolean | false | Enables expandable rows | 
| subComponent | (rowData: any) => ReactNode | - | Renders expanded row content | 
| onSorting | (sort: ColumnSort[]) => void | - | Sorting change callback | 
| onFilter | (filter: ColumnFilter[]) => void | - | Filter change callback | 
| onSelectedRow | (selected: any[]) => void | - | Selection change callback | 
Column Definition
Columns are defined using the ColumnDef type from @tanstack/react-table. Here are the key properties:
interface ColumnDef {
  header: string;
  accessorKey: string;
  size?: number;
  enableSorting?: boolean;
  enableGlobalFilter?: boolean;
  meta?: {
    filterVariant: 'text' | 'select' | 'range';
    options?: Array<{ label: string; value: string | number }>;
  };
}Pagination Options
Configuration for server-side pagination:
interface PaginationOptions {
  showPerPage: boolean;
  limitOption?: number[];
  totalPage: number;
  page: number;
  pageSize: number;
  onChangePage: (page: number) => void;
  onChangeLimit: (limit: number) => void;
}Filter Types
The table supports three types of filters:
- Text Filter: Free text search
 - Select Filter: Dropdown selection from predefined options
 - Range Filter: Date range selection
 
Styling
The table supports two themes (light and dark) and three variants:
default: Standard table designneutral: Minimalist designcolored: Enhanced visual hierarchy with colored rows
Accessibility
The table component is built with accessibility in mind:
- Proper ARIA labels
 - Keyboard navigation support
 - Screen reader friendly markup
 - High contrast mode support
 
Best Practices
- 
Performance
- Use client-side operations for small datasets
 - Implement server-side operations for large datasets
 - Enable infinite scroll for large datasets with frequent updates
 
 - 
Responsive Design
- Consider column visibility on different screen sizes
 - Use appropriate column widths
 - Implement horizontal scrolling for many columns
 
 - 
Data Loading
- Show loading state during data fetching
 - Provide meaningful empty states
 - Handle errors gracefully
 
 - 
Filtering
- Choose appropriate filter types for each column
 - Implement debouncing for text filters
 - Provide clear filter indicators