A cell in an orb-grid. Put cells directly inside the grid, in reading order, and the grid places them in rows.
| Description |
Aligns the cell’s content. On a header cell that covers one column, the body and footer cells in its column are aligned the same way, unless they set their own. |
| Attribute |
align |
| Type |
"center" | "end" | "start" |
| Default |
undefined |
| Description |
Number of columns the cell covers, like a table cell’s colspan |
| Attribute |
colspan |
| Type |
number |
| Default |
1 |
| Description |
Makes the grid a tree grid. Set it on a row’s first cell: 0 is the top level, and a row is the child of the closest row above it with a smaller depth. |
| Attribute |
depth |
| Type |
number |
| Default |
0 |
| Description |
Gives a tree row a chevron before it has children, so the children can be added when it’s first expanded. Set it on the row’s first cell. |
| Attribute |
expandable |
| Type |
boolean |
| Default |
false |
| Description |
Whether a tree row’s children are showing. Set it on the row’s first cell. The grid sets it when the row’s chevron is clicked. |
| Attribute |
expanded |
| Type |
boolean |
| Default |
false |
| Description |
Gives a header cell a filter for its column, in a popover that opens from a funnel button. text shows cells containing the text, number and date show cells within a range, and select shows cells whose value is checked in a list of the column’s values. |
| Attribute |
filter |
| Type |
"date" | "number" | "select" | "text" |
| Default |
undefined |
| Description |
The values a select filter lists. The grid sets it from the column’s cells. With a server-side grid, which only has one page of cells, set it yourself. |
| Attribute |
– |
| Type |
{ value: string; label: string; }[] |
| Default |
[] |
| Description |
The filter’s value: a string for text, { min, max } for number and date, and the checked values for select, where undefined means every value is checked. Set it to filter from code. |
| Attribute |
filter-value |
| Type |
string | string[] | { min?: string; max?: string; } |
| Default |
undefined |
| Description |
On a header cell, the key its column’s values are submitted under when the grid is in a form, such as name="salary" for employees[0][salary]. Without it, the key is the header’s text. |
| Attribute |
name |
| Type |
string |
| Default |
undefined |
| Description |
Aligns the content to the end, with digits of equal width, so numbers line up. On a header cell that covers one column, it applies to the whole column. |
| Attribute |
numeric |
| Type |
boolean |
| Default |
false |
| Description |
Makes a body cell its row’s header, like a th with scope="row". Screen readers read it with the other cells in the row. |
| Attribute |
row-header |
| Type |
boolean |
| Default |
false |
| Description |
Tints the whole row to show a meaning. Set it on the row’s first cell. Don’t rely on color alone. |
| Attribute |
row-status |
| Type |
"danger" | "success" | "warning" |
| Default |
undefined |
| Description |
Number of rows the cell covers, like a table cell’s rowspan. It stops at the end of the cell’s section. |
| Attribute |
rowspan |
| Type |
number |
| Default |
1 |
| Description |
Which part of the grid the cell belongs to. Header cells name their columns, and their column spans set the number of columns. |
| Attribute |
section |
| Type |
"body" | "foot" | "head" |
| Default |
"body" |
| Description |
How a sortable header is sorting its column. The grid sets it, and only one header sorts at a time. Set it in the markup to start out sorted. |
| Attribute |
sort |
| Type |
"ascending" | "descending" |
| Default |
undefined |
| Description |
Makes a header cell sort the body rows by its column. Clicking it, or pressing Enter on it, sorts ascending, then descending, then back to the markup order. |
| Attribute |
sortable |
| Type |
boolean |
| Default |
false |
| Description |
Tints the cell to show a meaning. Don’t rely on color alone. |
| Attribute |
status |
| Type |
"danger" | "success" | "warning" |
| Default |
undefined |
| Description |
The cell’s value for sorting and filtering, when its text isn’t the real value, such as an ISO date for a cell that shows “May 3”, or a number for “48 KB”. Searches match both the text and the value. |
| Attribute |
value |
| Type |
string |
| Default |
undefined |
| Description |
The column’s width. Set it on a header cell that covers one column. xs to xl are fixed widths from --grid-col-width-xs to --grid-col-width-xl, auto sizes to the content, and min is only as wide as the content, without wrapping. |
| Attribute |
width |
| Type |
"auto" | "lg" | "md" | "min" | "sm" | "xl" | "xs" |
| Default |
undefined |
| Description |
Emits when a header’s filter value changes, from its popover or from code. The grid listens for it. |
| Type |
CustomEvent<void> |
| Description |
Opens the header’s filter, and moves focus into it. |
| Signature |
openFilter() => Promise<void> |
| Slot |
Description |
|
The cell’s content |
| Part |
Description |
"filter-button" |
The funnel button that opens a header’s filter |
"filter-panel" |
The filter’s content, inside its popover |
"label" |
The column’s name, shown before the content when the grid shows cards |
"sort-icon" |
The arrow showing a sortable header’s sort direction |
"tree-toggle" |
The chevron and indent at the start of a tree row’s first cell |
| State |
Initial Value |
Description |
:state(card) |
false |
The grid shows its rows as cards, and the cell is in one |
:state(current) |
false |
The cell is the grid’s Tab stop, even while focus is elsewhere. With navigation="row", every cell in the row that’s the Tab stop |
:state(details-open) |
false |
The cell’s row has its details showing |
:state(editing) |
false |
The cell’s content has been entered, with Enter, F2, or a click inside |
:state(filter-open) |
false |
A header whose filter popover is open |
:state(filtered) |
false |
A header whose filter has a value |
:state(first-column) |
false |
The cell is at the grid’s start edge. The selection, details, and drag handle columns count |
:state(first-row) |
false |
The cell is at the grid’s top edge |
:state(last-column) |
false |
The cell is at the grid’s end edge |
:state(last-row) |
false |
The cell is at the grid’s bottom edge |
:state(leaf) |
false |
The first cell of a tree row without children |
:state(match) |
false |
The cell has text that matches the search, or its column’s text filter |
:state(moving) |
false |
The cell’s row is picked up or being dragged |
:state(open) |
false |
The first cell of an expanded tree row |
:state(parent) |
false |
The first cell of a collapsed tree row that has children |
:state(selected) |
false |
The cell’s row is selected |
:state(stripe) |
false |
The cell is in every other body row that shows, whether or not the grid is striped |
graph TD;
orb-cell --> orb-textbox
orb-cell --> orb-checkbox-group
orb-cell --> orb-checkbox
orb-cell --> orb-popover
orb-cell --> orb-button
orb-textbox --> orb-label
orb-textbox --> orb-button
orb-textbox --> orb-note
orb-button --> orb-loading
orb-checkbox-group --> orb-label
orb-checkbox-group --> orb-note
style orb-cell fill:#f9f,stroke:#333,stroke-width:4px