Headless UI for building powerful tables
Project description
reactpy-table
Headless UI for building powerful tables with ReactPy. The project takes its design ideas from the hugely popular, ReactJS based, TanStack Table.
The initial release supports the following features:
- Headless UI, CSS agnostic
- Freeform text search
- Forward/Reverse column based sort
- Pagination
- Integration with Pandas (in progress)
- Remote large dataset support
Usage
pip install reactpy-table
@component
def THead(table: Table):
cols = table.data.cols
return html.thead(
html.th(cols[0].label),
html.th(cols[1].label),
html.th(cols[2].label),
html.th(cols[3].label)
)
@component
def TRow(index: int, row: CompanyModel):
return html.tr(
html.td(str(row.index)),
html.td(row.symbol),
html.td(row.name),
html.td(row.sector),
)
@component
def TBody(table: List[CompanyModel]):
return html.tbody(
For(TRow, iterator=enumerate(table))
)
@component
def AppMain():
table_data = use_memo(lambda:get_sp500(rows=50))
table = use_reactpy_table(Options(
rows=table_data,
cols = COLS
))
return html.div(
html.br(),
html.h2('ReactPy Table Example'),
html.table({"role": "grid"},
THead(table),
TBody(table.data.rows)
),
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reactpy_table-0.0.11.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for reactpy_table-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6349a2905323cda6f8d4613ce4f7d42557a8b9372b41e2ce8096b6dd3839f0b3 |
|
MD5 | a546b4077186682a2bd05ce537a05190 |
|
BLAKE2b-256 | 43a40057ef0dd29818e4ccddbf1bfa1c1181c7c544bc4f6c154245aef33414a1 |