Skip to content

SortChip

Overview

Renders a single active sort field as a removable pill. A leading priority ordinal (shown only when showOrdinal is set) doubles as the drag handle for reordering within the host strip. The label segment shows the field's human label and a direction glyph; clicking it toggles ascending/descending. The trailing segment removes the field from the sort, and is present only when removable is set. This is the sort-side counterpart to FilterChip: neutral-tinted, since ordering is not a predicate and the accent is reserved for filters, actions, and selection.

Theme entry: SortChip

Props

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
fieldstringyesSort entry to render, e.g. "updated" (ascending) or "-updated" (descending).
indexnumberyesZero-based position in the sort order; the displayed priority ordinal is index + 1.
fieldDetailsobject{}Map of field name to field metadata (e.g. { label }) used to derive the human label.
showOrdinalbooleantrueShow the priority ordinal. The ordinal doubles as the drag handle, so it is shown only when reordering is meaningful (more than one active sort field). The host strip (SortGroup) passes false for a lone chip.
removablebooleantrueShow the remove ("x") control. The host strip (SortGroup) passes false for a lone chip, so the last active sort field can't be removed from the chip itself — clearing it would leave the strip with no chips to read the sort from, while the server would still sort by its own default. Reset sort is the way back instead.

Slots

NameScopedDescription
drag-handleOverride the drag-handle glyph.

Full slot reference

Events

NameDescription
toggleEmitted when the label segment is clicked to flip this field's direction.
removeEmitted when the remove segment is clicked.

Full event reference

Source

client/lib/display/sort/SortChip.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2