Segmented controller

Updated at:

Introduction

The segmented controller is a component that displays multiple options and allows a user to select a single option. Selecting a different option updates the content in the associated area.

Configuration items

Category

Configuration

Example

Description

Content

Mode

The configuration mode for the segmented controller.

Manual configuration

Configure the parameters of the component to control the behavior, configuration, and logic of each segment.

Mapping configuration

Use external data, such as an array or object, to automatically generate the content for each segment.

Title

The display text for a segment.

Value

The value of a segment.

Default value

Sets the initial value of the segmented controller.

Interaction

Hide

Hides the component. For more information, see Common properties.

Keep layout when hidden

Keeps the layout of the component when it is hidden. For more information, see Common properties.

Style

Margin

The margin. For more information, see Common properties.

CSS Style

Control container padding

The padding. For more information, see Common properties.

Control container background color

Sets the background color of the control container. For more information, see Common properties.

Text color of selected option

Sets the text color of the selected option. This corresponds to the CSS color property. For more information, see the MDN documentation.

Background color of selected option

Sets the background color of the selected option. For more information, see Common properties.

Text color on hover

Sets the text color when you hover over an option. This corresponds to the CSS color property. For more information, see the MDN documentation.

Background color on hover

Sets the background color when you hover over an option. For more information, see Common properties.

Option text color

Sets the text color of the options. This corresponds to the CSS color property. For more information, see the MDN documentation.

Background color of selected option

Sets the background color of the selected option. For more information, see Common properties.

Properties and methods

Name

Type

Example

Description

value

string

segmented.value

Content for the selected segment

data

array

segmented.data

Data for the current drop-down menu component

clearValue

func

segmented.clearValue()

Clears the value of the component.

setValue

func

segmented.setValue('1')

Sets the value of the segmented controller.

Event callbacks

Event name

Configuration

Description

Change

The callback event that is triggered when the selected option changes.