PU-Table Component

A powerful and customizable table component with sorting, filtering, and pagination features

Usage

Basic Usage

Name Age Email
John Doe28[email protected]
Jane Smith34[email protected]
Name Age Email
John Doe28[email protected]
Jane Smith34[email protected]
Name Age Email
John Doe28[email protected]
Jane Smith34[email protected]
Name Age Email
John Doe28[email protected]
Page 1 of 2
PropTypeRequiredDefaultDescription
headersArray<{ key: string, label: string }>Yes-Table column definitions
rowsArray<Record<string, string | number | boolean>>Yes-Table data rows
sortablebooleanNofalseEnable column sorting
filterablebooleanNofalseEnable global filtering
perPagenumberNoundefinedNumber of rows per page
hiddenColumnsstring[]No[]Columns to hide
SlotPropsDescription
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 functionality
  • PUButton for pagination controls
  • PUIcon for sort indicators
  • Tailwind CSS for styling
  • Vue 3 Composition API