openui / openui/open-ui

Data tables (with sorting, filtering, etc.)

Open
#903 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
MDX
Stars
4.5k
Forks
226
Avg merge
2d 22h
Merged PRs (30d)
4

Description

From the preliminary State of HTML 2023 data, it looks like the missing element respondents seem to need the most (even more than tabs!) is …a humble data table:

image

(34,794 total selections spread across 12,472 responses)

For context, this was the question: image

There have been a few issues discussing aspects of data tables:

There has been some discussion about doing this in a new element (e.g. <datagrid>), or augmenting the existing <table> element. The former allows us to start from a clean slate and avoid the many warts of tables, but ultimately, I think progressive enhancement should prevail. Doing it by augmenting <table> also allows us to ship this as individual composable features, rather than one monolithic new element that will take years.

That said, there are relationships between them: Sorting would require some mechanism of specifying what value to sort by (otherwise we're either stuck with lexicographical sorting, which is rarely what you want, or parsing numbers from contents which is another can of worms), which filtering could also take advantage of.

In terms of the features discussed above, it seems that if we want to tackle from easiest to hardest, the order would be:

  1. Show/hide columns (just a matter of allowing existing primitives to work together)
  2. Sorting (well established UI conventions, minimal UI surface)
  3. Searching
  4. Filtering (requires a lot of UI, which to be useful needs to be stylable)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issues 803, 800, and 799, then compare the proposed approaches of augmenting

and introducing . Define the scope and relationships among column visibility, sorting, searching, and filtering; done means the project has an agreed direction for the data-table work.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.