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

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