@mermaid-editor-sdk/headless


@mermaid-editor-sdk/headless / addStatePaletteItem

Function: addStatePaletteItem()

addStatePaletteItem(source, item, stateId?, label?): string

Defined in: source/state-mutations.ts:395

Adds a state palette item to the source.

Parameters

ParameterTypeDefault valueDescription
sourcestring—Mermaid source to inspect or update.
itemStatePaletteItemId—Identifier of the palette item to add.
stateId?stringundefinedOptional state identifier used by the palette item.
label?string''Displayed label.

Returns

string