Content

Table

Tabular data container with consistent row and column styling.

Basic Table

Standard data table with clean typography.

NameStatusRole
Alice JohnsonActiveDesigner
Bob SmithOfflineDeveloper
'use client'

import React from 'react'
import { Table, Thead, Tbody, Tr, Th, Td, Badge } from 'biibaos'

export default function App() {
  return (
    <Table>
      <Thead>
        <Tr>
          <Th>Name</Th>
          <Th>Status</Th>
          <Th>Role</Th>
        </Tr>
      </Thead>
      <Tbody>
        <Tr>
          <Td>Alice Johnson</Td>
          <Td><Badge variant="success" dot>Active</Badge></Td>
          <Td>Designer</Td>
        </Tr>
        <Tr>
          <Td>Bob Smith</Td>
          <Td><Badge variant="secondary" dot>Offline</Badge></Td>
          <Td>Developer</Td>
        </Tr>
      </Tbody>
    </Table>
  )
}

Variants & Styles

Support for hover states, zebra stripes, and borders.

Hover & StripedValue
Row 1100
Row 2200
Bordered & CompactValue
Small RowA
Small RowB
'use client'

import React from 'react'
import { Table, Stack } from 'biibaos'

export default function App() {
  return (
    <Stack direction="column" gap={20}>
      <Table hover striped>
        <Thead><Tr><Th>Hover & Striped</Th><Th>Value</Th></Tr></Thead>
        <Tbody>
          <Tr><Td>Row 1</Td><Td>100</Td></Tr>
          <Tr><Td>Row 2</Td><Td>200</Td></Tr>
        </Tbody>
      </Table>
      <Table bordered compact>
        <Thead><Tr><Th>Bordered & Compact</Th><Th>Value</Th></Tr></Thead>
        <Tbody>
          <Tr><Td>Small Row</Td><Td>A</Td></Tr>
          <Tr><Td>Small Row</Td><Td>B</Td></Tr>
        </Tbody>
      </Table>
    </Stack>
  )
}

Data Table (High-level)

Advanced data management with built-in search, sorting, categorical filters, and pagination.

Product
Category
Price
Status
Apple Watch
Wearables
$399
In Stock
iPhone 15
Phones
$999
Low Stock
iPad Pro
Tablets
$799
In Stock
'use client'

import React from 'react'
import { DataTable, Badge } from 'biibaos'

export default function App() {
  const data = [
    { id: 1, name: 'Apple Watch', category: 'Wearables', price: '$399', status: 'In Stock' },
    { id: 2, name: 'iPhone 15', category: 'Phones', price: '$999', status: 'Low Stock' },
    { id: 3, name: 'iPad Pro', category: 'Tablets', price: '$799', status: 'In Stock' },
    { id: 4, name: 'MacBook Air', category: 'Laptops', price: '$1199', status: 'In Stock' },
    { id: 5, name: 'AirPods Pro', category: 'Audio', price: '$249', status: 'Out of Stock' },
  ]

  const columns = [
    { key: 'name', header: 'Product', sortable: true },
    { key: 'category', header: 'Category', sortable: true, width: 140 },
    { key: 'price', header: 'Price', sortable: true, width: 100 },
    {
      key: 'status',
      header: 'Status',
      render: (item) => (
        <Badge variant={item.status === 'In Stock' ? 'success' : item.status === 'Out of Stock' ? 'danger' : 'warning'}>
          {item.status}
        </Badge>
      )
    },
  ]

  return (
    <DataTable 
      data={data} 
      columns={columns} 
      searchable 
      paginated 
    />
  )
}

Toolbar Actions

Extend the table toolbar with custom buttons or actions using the rightAction slot.

Project
Status
Project A
Active
Project B
Paused
'use client'

import React from 'react'
import { DataTable, Button, Icon, Badge } from 'biibaos'
import { Plus } from 'lucide-react'

export default function App() {
  const data = [
    { id: 1, name: 'Project A', status: 'Active' },
    { id: 2, name: 'Project B', status: 'Paused' },
  ]

  const columns = [
    { key: 'name', header: 'Project' },
    { 
      key: 'status', 
      header: 'Status',
      render: (item) => <Badge variant={item.status === 'Active' ? 'success' : 'warning'}>{item.status}</Badge>
    },
  ]

  return (
    <DataTable
      data={data}
      columns={columns}
      rightAction={
        <Button size="sm" variant="primary" leftIcon={<Icon icon={Plus} />}>
          Create New
        </Button>
      }
    />
  )
}

Loading State

Use the isLoading prop to show a professional skeleton state while fetching data.

Name
Email
Role
'use client'

import React from 'react'
import { DataTable } from 'biibaos'

export default function App() {
  return (
    <DataTable
      isLoading
      data={[]}
      columns={[
        { key: 'name', header: 'Name' },
        { key: 'email', header: 'Email' },
        { key: 'role', header: 'Role' },
      ]}
    />
  )
}

Server-side Pagination

Handle large datasets by fetching only the required page from your server. The table UI will automatically adapt to your external count and page state.

ID
Name
Price
101
Server Product 1
$99
102
Server Product 2
$149
'use client'

import { useState } from 'react'
import { DataTable } from 'biibaos'

export default function App() {
  const [page, setPage] = useState(1)
  
  // Example data for the current page
  const data = [
    { id: 101, name: 'Server Product 1', price: '$99' },
    { id: 102, name: 'Server Product 2', price: '$149' },
  ]

  return (
    <DataTable
      manualPagination
      data={data}
      totalCount={500} // Total items in your database
      currentPage={page}
      pageSize={10}
      onPageChange={(newPage) => setPage(newPage)}
      columns={[
        { key: 'id', header: 'ID' },
        { key: 'name', header: 'Name' },
        { key: 'price', header: 'Price' },
      ]}
    />
  )
}

Properties

PropTypeDefaultDescription
childrenReact.ReactNodeMain descriptive text or overlay children layout
hoverbooleanAdds hover state to rows
stripedbooleanAlternating row colors
borderedbooleanFull borders between cells
compactbooleanReduced padding for tight layouts
responsivebooleanAdds adaptive "stacked" behavior on mobile
dataany[]Array of data objects to display in the table grid
columnsDataTableColumn[]Column definitions mapping keys to header and cell renderers
searchablebooleantrueIf true, reveals standard text search input inside the toolbar
searchPlaceholderstring"Search..."Ghost text inside the search input
paginatedbooleantrueIf true, enables page splitting navigation controls at the bottom
pageSizenumber10Number of rows to render per active page viewport
selectablebooleanfalseIf true, enables checkbox selections on row items
onRowClick(item: any) => voidCallback event triggered when a row is clicked
emptyStateReact.ReactNodeCustom element rendered when data set is empty or filtered out
filtersDataTableFilter[]List of filters to display in the header select boxes
rightActionReact.ReactNodeCustom header actions aligned to the far right toolbar edge
isLoadingbooleanfalseIf true, activates animated grid skeleton layout block
manualPaginationbooleanfalseEnable server-side pagination instead of client-side filtering
totalCountnumberTotal row count across server for correct pagination pages
currentPagenumberCurrent active page value for server-side page control
onPageChange(page: number) => voidCallback function triggered on navigation page transition