PyBlade/ui
Menu⌄
DocsComponentsData table

Data table

A table with filtering, sorting, pagination and row selection, from Python data.

Alpine.js1 file

Installation

pyblade-ui add data-table

Usage

The tag <pb-ui.data-table> is available in all your templates.

<pb-ui.data-table selectable search="email" :page_size="5"
  :columns="[{'key': 'email', 'label': 'Email', 'sortable': True}, {'key': 'amount', 'label': 'Amount', 'sortable': True, 'align': 'right', 'format': 'currency'}]"
  :rows="[{'id': 1, 'email': 'ada@example.com', 'amount': 316}, {'id': 2, 'email': 'grace@example.com', 'amount': 242}]" />

Props

PropDefault
rows
columns
page_size10
search''
search_placeholder'Filter...'
selectableFalse
locale'en-US'
currency'USD'
empty'No results.'

Any other attribute (class, id, x-on:click, hx-post…) is passed to the root element; your Tailwind classes win over the component's.