Components
BaseMatrixTable
A grid of rows by columns for settings and comparisons, such as notifications by channel or plans by feature.
components/ui/table/BaseMatrixTable.vue
View in the demo
Example
| Event | In app | Push | |
|---|---|---|---|
| Activity | |||
MentionsSomeone @mentions you | |||
Comments | |||
| Billing | |||
Invoices | |||
| Event | In app | Push | |
|---|---|---|---|
MentionsSomeone @mentions you | |||
Comments | |||
Invoices | |||
When the columns do not fit (measured after the fonts load), each row stacks: its header on top and its cells in one line below, each followed by the column label, and the column headers move to a strip above the rows. Turn that strip off with stacked-header when the headers only repeat the labels.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
columnsrequired | MatrixColumn[] | — | The columns, each { key, label, highlighted? }. |
rowsrequired | MatrixRow[] | — | The rows, each { key, label, hint?, group? }. Rows with the same group get a group header. |
row-header | string | — | The title of the first column. |
caption | string | — | A caption for screen readers. |
collapsible | boolean | false | Lets the user collapse each group. |
stacked-header | boolean | true | Shows the column headers as a strip above the rows when the table stacks. Turn it off when they hold only the labels. |
Slots
Name | Slot props | Description |
|---|---|---|
#column-header | { column: MatrixColumn; } | A custom column header. |
#group | { group: any; } | A custom group header. |
#row-header | { row: any; } | A custom row label. |
#cell | { row: any; column: MatrixColumn; } | The content of a cell; receives row and column. |
The notifications settings and the plan comparison of the pricing page are built on it.