Flatten Token Sets
Last updated
Last updated
The Flatten Token Sets node combines multiple arrays of tokens into a single flat array, removing any duplicate tokens by name. If tokens with the same name appear in multiple input arrays, only the token from the array with higher precedence is kept.
Array of Tokens
A nested array containing multiple token arrays to be flattened
List of Lists
Yes
Tokens
A single flattened array of tokens with duplicates removed
List
Drag the Flatten Token Sets node into your graph.
Connect multiple token arrays to the "Array of Tokens" input.
The node will combine all tokens into a single array, removing duplicates based on token names.
The resulting flat array contains unique tokens, with precedence given to tokens that appear later in the input arrays.
The order of input arrays matters - tokens from later arrays will override tokens with the same name from earlier arrays.
This node is useful for merging multiple token sets while handling conflicts.
Use this node when you need to merge tokens from different sources or components of a design system.
Token set to token array: For flattening hierarchical token structures.
Array to Set: For converting a flat array back to a hierarchical structure.
Token Merging: Combine tokens from multiple sources while handling naming conflicts.
Theme Construction: Merge base tokens with theme-specific tokens, allowing theme tokens to override base tokens.
Token Deduplication: Remove duplicate tokens from multiple collections while preserving the most important ones.