PU-Table Component
A powerful and customizable table component with sorting, filtering, and pagination features
Usage
Basic Usage
Name | Age | |
---|---|---|
John Doe | 28 | [email protected] |
Jane Smith | 34 | [email protected] |
Name | Age | |
---|---|---|
John Doe | 28 | [email protected] |
Jane Smith | 34 | [email protected] |
Name | Age | |
---|---|---|
John Doe | 28 | [email protected] |
Jane Smith | 34 | [email protected] |
Name | Age | |
---|---|---|
John Doe | 28 | [email protected] |
Page 1 of 2
Prop | Type | Required | Default | Description |
---|---|---|---|---|
headers | Array<{ key: string, label: string }> | Yes | - | Table column definitions |
rows | Array<Record<string, string | number | boolean>> | Yes | - | Table data rows |
sortable | boolean | No | false | Enable column sorting |
filterable | boolean | No | false | Enable global filtering |
perPage | number | No | undefined | Number of rows per page |
hiddenColumns | string[] | No | [] | Columns to hide |
Slot | Props | Description |
---|---|---|
cell-{key} | { row: object } | Custom cell content for specific columns |
- Base styling with Tailwind:
table { @apply w-full border-collapse border-2 border-primary-light-500; } th { @apply bg-primary-light-500/10 text-primary-light-500 text-left p-2; } td { @apply border p-2 border-primary-light-500; }
- Pagination controls:
.pagination { @apply flex justify-between mt-4; }
- Column sorting (asc/desc)
- Global search filtering
- Pagination controls
- Custom cell content via slots
- Hidden columns support
- Responsive design
PUInput
for search functionalityPUButton
for pagination controlsPUIcon
for sort indicators- Tailwind CSS for styling
- Vue 3 Composition API