Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Custom Inputs
Select
Components
Components
78
Micro Charts
Navigation
Libraries
Content Editor
Data View
Form Builder
Image Designer
Kanban Board
PDF Builder
PDF Viewer
Video Player
Latest npm version of @ngstarter-ui/componentsWeekly npm downloads of @ngstarter-ui/components
Buy License

Sort

Sort coordinates sortable column headers and emits the active column with its direction. Use it with Table when a simple local table or a server-driven query needs clickable sorting controls.

Apply ngsSort to the table or sorting region, then add ngs-sort-header to each sortable header.

Sort Directive

PropTypeDefault
ngsSortActive
The id of the currently sorted header.
string''
ngsSortStart
The direction used when a header becomes active for the first time.
'asc' | 'desc' | '''asc'
ngsSortDirection
The current sort direction.
'asc' | 'desc' | ''''
ngsSortDisableClear
Whether clicking a descending header cycles back to ascending instead of clearing the sort.
booleanfalse
ngsSortDisabled
Whether all headers connected to this sort directive are disabled.
booleanfalse
EventDescription
ngsSortChangeEmits the active header id and direction after sorting changes.

Sort Header

PropTypeDefault
ngs-sort-header
Unique id for the sortable header. This value is emitted as the active sort id.
string''
sortActionDescription
Accessible label for the sort action.
string''
disabled
Whether this individual sort header is disabled.
booleanfalse