Penpot plugins API
    Preparing search index...

    Interface TokenSet

    A collection of Design Tokens.

    Inside a set, tokens have an unique name, that will designate what token to use if the name is applied to a shape and this set is active.

    interface TokenSet {
        id: string;
        name: string;
        active: boolean;
        tokens: Token[];
        tokensByType: [string, Token[]][];
        toggleActive(): void;
        getTokenById(id: string): Token | undefined;
        addToken(
            type: { type: TokenType; name: string; value: TokenValueString },
        ): Token;
        duplicate(): TokenSet;
        remove(): void;
    }
    Index

    Properties

    id: string

    The unique identifier for this set, used only internally inside Penpot. This one is not exported or synced with external Design Token sources.

    name: string

    The name of the set. It may include a group path separated by /.

    active: boolean

    Indicates if the set is currently active.

    tokens: Token[]

    The tokens contained in this set, in alphabetical order.

    tokensByType: [string, Token[]][]

    The tokens contained in this set, grouped by type.

    Methods

    • Toggles the active status of this set.

      Returns void

    • Retrieves a token.

      Parameters

      • id: string

        the id of the token.

      Returns Token | undefined

      Returns the token or undefined if not found.

    • Removes this set from the catalog.

      Returns void