Sort Array
Last updated
Last updated
Arranges items in a list in a specific order, either ascending or descending. It can sort by a specific property for complex objects, helping to organize collections.
array
The list to be sorted
List
Yes
order
Direction of sort ("asc" or "desc")
Text
No
sortBy
Property name to sort by (for object elements)
Text
Yes
value
The sorted list
List
Drag the Sort Array node into your graph.
Connect your list (like [16, 18, 21, 24, 28, 32]
) to the "array" input.
Set "sortBy" to the property to sort on (e.g., "value").
Optionally change "order" to "desc" for descending order (default is "asc").
For simple lists (numbers or strings), use an empty string for the "sortBy" value.
The sort is stable, meaning equal items maintain their relative order.
Color Organization: Sort colors by brightness, hue, or other properties.
Token Prioritization: Arrange design tokens by their importance or frequency of use.
Size Sequencing: Order spacing or sizing tokens from smallest to largest for consistent scales.
: For simply flipping the order of items without sorting.
: For selecting items rather than reordering them.