codewithkyle / brixi-ui

A sleek & slender design system built on web components.
https://ui.brixi.dev
MIT License
2 stars 0 forks source link

Data Tables #22

Open codewithkyle opened 3 years ago

codewithkyle commented 3 years ago

Data tables should support these features:

Functionality reference

codewithkyle commented 2 years ago

Data tables should accept an array of header/body cell render functions. Functions should return a TemplateResult or string type.

type Cell = (cell:any) => TemplateResult | string;
interface DataTableSettings {
    headerCells: Array<Cell>,
    bodyCells: Array<Cell>,
}

We will never be able to create a "prefect" table component. A developer will always need something unique, something custom based on their data set. If we defer the templating logic to the developer they can add as many cells as they wish while being able to strictly control the output and functionality of each cell.