Skip to main content

Skeletons.Button

Interactive elements that combine an icon with optional text or behavior. Three variants exist, each suited for a different visual pattern.


Variants

VariantRendersUse for
Skeletons.Button.SvgIcon onlyToolbar buttons, action icons, close/pin/save
Skeletons.Button.LabelIcon + text labelMenu items, navigation, checkboxes, form options
Skeletons.Button.IconIcon with fixed sizeCompact icon buttons with custom dimensions

Common Props

All three variants share these props:

PropTypeDescription
icoStringIcon identifier (mapped to chartId internally)
classNameStringCSS class(es) to apply
serviceStringService name triggered on click
uiHandlerWidgetRoutes interaction events to onUiEvent
sys_pnStringNamed part — enables onPartReady and ensurePart
datasetObjectdata-* attributes set on the element
stateNumberInitial toggle state (0 or 1)
hapticNumberHaptic feedback delay in ms
tooltipsStringTooltip text shown on hover
srcStringDirect SVG URL (overrides ico)

Skeletons.Button.Svg

An icon-only button. The most common button type — used for toolbars, action icons, and any button that does not need a visible label.

Skeletons.Button.Svg({
ico: "my-icon",
service: "my-action",
uiHandler: ui,
className: `${fig}__my-button`,
});

With tooltip and haptic feedback

Skeletons.Button.Svg({
ico: "my-icon",
service: "my-action",
haptic: 1000,
tooltips: LOCALE.MY_ACTION_LABEL,
className: `${fig}__my-button`,
});

With direct SVG source

Skeletons.Button.Svg({
ico: "my-icon",
src: `${protocol}://${domain}/images/icons/my-icon.svg`,
className: `${fig}__my-icon`,
uiHandler: ui,
});

Skeletons.Button.Label

An icon + text label button. Used for menus, navigation items, checkboxes, and any button where a visible label is needed alongside an icon.

Skeletons.Button.Label({
ico: "my-icon",
label: LOCALE.MY_LABEL,
service: "my-action",
uiHandler: ui,
className: `${fig}__my-item`,
});

Additional props

PropTypeDescription
labelStringText label displayed next to the icon
labelClassStringCSS class applied to the label element
hrefStringNavigates to this URL on click (instead of a service)
priorityStringVisual priority — e.g. "primary"
bubbleBooleanWhether the event should bubble up
radioStringRadio channel name for grouped toggle behavior
initialStateNumberInitial state for radio/toggle buttons
referenceStringModel attribute to bind state to
svgSourceStringExternal SVG URL for the icon (e.g. flag images)
valueAnyValue associated with this button
formItemStringModel key this button controls in a form
Skeletons.Button.Label({
ico: "my-icon",
label: LOCALE.MY_PAGE,
href: "#/desk/my-page",
});

With radio toggle state

Skeletons.Button.Label({
ico: "my-icon",
label: LOCALE.MY_OPTION,
radio: MY_CHANNEL,
initialState: currentState,
service: "update",
uiHandler: ui,
className: `${fig}__checkbox`,
});

Conditionally disabled

Skeletons.Button.Label({
ico: "my-icon",
label: LOCALE.MY_ACTION,
service: isEnabled ? "my-action" : null,
state: isEnabled ? 1 : 0,
dataset: isEnabled ? undefined : { disabled: 1 },
uiHandler: ui,
});

Skeletons.Button.Icon

An icon button with explicit dimensions. Identical to Button.Svg but accepts a style argument for custom width, height, and padding. Default size is 40×40px with 10px padding.

Skeletons.Button.Icon(
{
ico: "my-icon",
service: "my-action",
uiHandler: ui,
},
{
width: 30,
height: 30,
padding: 7,
},
);

Use Button.Icon when the default 40×40 size does not fit the layout. For all other cases, Button.Svg is sufficient.


Choosing the Right Variant

Need icon only? → Button.Svg
Need icon + text label? → Button.Label
Need icon only with custom dimensions? → Button.Icon
Need a navigation link? → Button.Label with href
Need a toggle / radio button? → Button.Label with radio + initialState