Aller au contenu principal

Styled Table Components

Description

The Table components are predefined styled wrappers based on the TableCell, TableRow, and Div components. These components provide structured table layouts with enhanced styling for header rows, checkboxes, and row selection.

Styled Table Components

Component NameDescription
TableContainerA styled container wrapping the table for proper layout and scrolling.
TableRow_HeaderA header row with a styled background and color.
TableCell_HeaderCheckboxA sticky checkbox cell for table headers.
TableCell_CheckboxA sticky checkbox cell for table rows.
TableRow_SelectedA row component that highlights selection state.
TableCell_TanstackA styled table cell supporting TanStack Table.

Example Usage

Basic Styled Table Components

import { TableContainer, TableRow_Header, TableCell_Checkbox } from '@nomana-it/liberty-core';

export const TableExample = () => {
return (
<TableContainer>
<table>
<thead>
<TableRow_Header>
<TableCell_Checkbox>
<input type="checkbox" />
</TableCell_Checkbox>
<th>Column 1</th>
<th>Column 2</th>
</TableRow_Header>
</thead>
<tbody>
<tr>
<TableCell_Checkbox>
<input type="checkbox" />
</TableCell_Checkbox>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>
</TableContainer>
);
};

Notes

  • TableContainer ensures proper scrolling and layout.
  • TableRow_Header provides custom header row styling.
  • TableCell_Checkbox and TableCell_HeaderCheckbox are sticky for better usability.
  • TableRow_Selected helps indicate selected rows visually.
  • TableCell_Tanstack is optimized for TanStack Table column sizes and alignment.

🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core