Sortable header
Header for sorting table columns
Demo
Cell text | Cell text |
Cell text | Cell text |
Cell text | Cell text |
Cell text | Cell text |
API
Tag
Name | Description |
<s-header-sortable>
|
Custom element |
Attributes
Name | Value | Required | Description |
active |
Boolean attribute |
Indicates the active sortable header. |
|
ascending |
Boolean attribute |
Indicates the arrow-up icon should be displayed. |
|
descending |
Boolean attribute |
Indicates the arrow-down icon should be displayed. |
|
text |
String |
Sets the text content of the header. Header-sortable's text content can alternatively be provided inside a |
|
nodefaultsort |
Boolean attribute |
Indicates that there is a default unsorted state for the table, and the header should cycle through an unsorted state when clicked (ascending sort -> descending sort -> unsorted -> repeat). |
Properties
Name | Value | Required | Description |
active |
Boolean attribute |
Indicates the active sortable header. |
|
ascending |
Boolean attribute |
Indicates the arrow-up icon should be displayed. |
|
descending |
Boolean attribute |
Indicates the arrow-down icon should be displayed. |
|
text |
String |
Sets the text content of the header. Header-sortable's text content can alternatively be provided inside a |
|
noDefaultSort |
Boolean attribute |
Indicates that there is a default unsorted state for the table, and the header should cycle through an unsorted state when clicked (ascending sort -> descending sort -> unsorted -> repeat). |
Classes
Name | Description |
---|---|
align-right
|
Aligns header text to the right and places arrow icon on left. |
Events
Name | Detail | Description |
---|---|---|
s-sort |
The header's |
Fired after the header is clicked. |
s-unsort |
The header's |
Fired after a header with the |
Demo
API
Tag
Name |
<SHeaderSortable>
|
Props
Name | Value | Required | Description |
---|---|---|---|
active |
Boolean |
Indicates the active sortable header. |
|
ascending |
Boolean |
Indicates the arrow-up icon should be displayed. |
|
descending |
Boolean |
Indicates the arrow-down icon should be displayed. |
|
text |
String |
Sets the text content of the header. Text content can alternatively be provided inside a |
|
noDefaultSort |
Boolean |
Indicates that there is a default unsorted state for the table, and the header should cycle through an unsorted state when clicked (ascending sort -> descending sort -> unsorted -> repeat). |
|
onS-sort |
Function | Handles the |
|
onS-unsort |
Function | Handles the |
Classes
Name | Description |
---|---|
align-right
|
Aligns header text to the right and places arrow icon on left. |
Skylab React links
Typescript
Exported types
Guidelines
Parent element required
The sortable header must be enclosed in a <th>
element.
Design
Design resources can be found on the Skylab design documentation site: skylab.avalara.com