Skip to content

Button Toggles

Example

Basic Button Toggle

This example demonstrates a simple button toggle component with two text-based options. The component uses the mandatory property to ensure that one option is always selected. Rounded corners are applied and a custom color are used to highlight the selected state. This setup is useful for basic binary choices such as theme switching or mode selection.

Icon Options Button Toggle

This example shows a button toggle component that uses icons instead of text labels. Each button is defined with an icon reference, creating a compact and visually driven control suitable for toolbars or alignment actions.

Text & Icon Options Button Toggle

This example demonstrates an advanced button toggle configuration combining both text labels and icons with custom actions. Each button includes a label, an icon positioned on the right side, and an associated action that is emitted when selected. The component uses a tile shape, resulting in square edges instead of rounded corners. The mandatory property ensures that at least one button remains selected at all times, with the first button selected by default. Because multiple is set to false, only one button can be active at a time. Selecting another option automatically switches the active state.

Props

PropertyTypeDefaultDescription
visiblebooleantrueDetermines whether the button toggle group is displayed.
positionnumber[]0 0 0Specifies the component's position.Defines the component’s position in 3D space as an array of coordinates.
sizeenum (small, medium, large, extra-large)mediumControls the size of all toggle buttons, including padding, font size, and spacing.
opacitynumber1Sets the transparency level of the component.
colorstring (blue, #fff)#00BA92Defines the color applied to selected buttons. Unselected buttons use a neutral style by default (white background and black text color).
modestring (light, dark)""Applies a light or dark visual theme to selected buttons for consistent styling.
buttonsarray[{ label: "Close", icon: "", iconpos: "left", action: "close" }]Defines the buttons displayed in the toggle group. Each button may include a label, icon, icon position, and action. When selected, a buttonAction event is emitted with the associated action value.
mandatorybooleanfalseEnsures that at least one button remains selected at all times.
multiplebooleanfalseAllows multiple buttons to be selected simultaneously when enabled.
roundedbooleanfalseApplies rounded corners to the entire toggle group. Takes precedence over the tile property.
tilebooleanfalseRenders the toggle group with square edges instead of rounded corners.