Mixins / foldkit-mixins-ui

TableColumn

interface · packages/mixins-ui/src/table.ts:75

interface TableColumn<Row, Key extends string = string> {
  readonly header: string | Html
  readonly footer?: string | Html | undefined
  readonly numeric?: boolean | undefined
  readonly value: (row: Row) => Html | string
  readonly rowHeader?: boolean | undefined
  readonly sortKey?: Key | undefined
}

One column: its heading, and each row's cell for it. Key is the type of its sortKey.

Members

property · packages/mixins-ui/src/table.ts:77

readonly header: string | Html

The heading: text, or markup for an icon beside it.

property · packages/mixins-ui/src/table.ts:79

readonly footer?: string | Html | undefined

Drawn under the column in a totals row: a sum, a count, a note.

TableColumn.numeric

property · packages/mixins-ui/src/table.ts:81

readonly numeric?: boolean | undefined

Right-align values that read as numbers.

TableColumn.value

property · packages/mixins-ui/src/table.ts:83

readonly value: (row: Row) => Html | string

The cell's content: text, or markup for a link, a badge or an avatar.

TableColumn.rowHeader

property · packages/mixins-ui/src/table.ts:85

readonly rowHeader?: boolean | undefined

Draws the cell as the row's heading (th scope="row"), so a screen reader names a row by it.

TableColumn.sortKey

property · packages/mixins-ui/src/table.ts:87

readonly sortKey?: Key | undefined

Makes the heading a button that sends sort.onSort with this key.