Segmented
Display a segmented control.
{
"title": "Button Style",
"id": "buttonStyle",
"segmented": {
"default": "solid",
"items": [{
"value": "solid",
"icon": "rectangle.fill"
}, {
"value": "outline",
"icon": "rectangle"
}, {
"value": "ghost",
"icon": "square.dashed"
}]
}
}{
"groups": [{
"title": "Button",
"properties": [{
"title": "Button Style",
"id": "buttonStyle",
"segmented": {
"default": "solid",
"items": [{
"value": "solid",
"icon": "rectangle.fill"
}, {
"value": "outline",
"icon": "rectangle"
}, {
"value": "ghost",
"icon": "square.dashed"
}]
}
}]
}]
}You can also use the following title key to display text instead of icons.
{
"groups": [{
"title": "Layout",
"properties": [{
"title": "Content Alignment",
"id": "contentAlignment",
"segmented": {
"items": [{
"value": "text-left",
"title": "Left"
}, {
"value": "text-center",
"title": "Center",
"default": true
}, {
"value": "text-right",
"title": "Right"
}]
}
}]
}]
}Supported Options
The segmented control supports the following options.
Key
Type
Notes
default
string
Value of the segment selected by default. An object of per-breakpoint values when the control is responsive.
items
array
The segments to display. See the item schema below.
Each item in items supports these keys:
Key
Type
Notes
value
string
The value to be returned when this segment is selected.
title
string
The text label for the segment.
default
boolean
Alternative way to mark this item as the default selection.
Value
Last updated
Was this helpful?

