New to Kendo UI for Vue? Start a free 30-day trial

Represents the Kendo UI for Vue SegmentedControl component. Accepts properties of type SegmentedControlProps. Use the SegmentedControl to show a row of button segments from which the user selects one option at a time.

Definition

Package:@progress/kendo-vue-buttons

Properties Interface:SegmentedControlProps

Syntax:

vue
<SegmentedControl :items="[{ value: 'day', text: 'Day' }, { value: 'week', text: 'Week' }]" :default-value="'day'" />

Properties

Sets the value of the initially selected item when you do not set value. The component ignores later changes to defaultValue.

Example:
vue
<SegmentedControl :default-value="'option2'" :items="items" />

Sets the items that the SegmentedControl renders as buttons.

Default:

[]

Example:
vue
<SegmentedControl :items="[{ value: 'opt1', text: 'Option 1' }, { value: 'opt2', text: 'Option 2' }]" />

itemTemplate?

string | (itemData: SegmentedItemProps) => any

Sets a custom template for the item content. When you set it, it replaces the default content (start icon, text, and end icon).

Accepts a slot name or a render function. The slot receives { props: { item } }, where item is the full item object.

Example:
vue
<SegmentedControl :items="items" :item-template="'myTemplate'">
    <template #myTemplate="{ props }">
        <span>{{ props.item.text }}</span>
    </template>
</SegmentedControl>

layoutMode?

"compact" | "stretch"

Sets the layout mode of the SegmentedControl.

  • compact: The items take the width of their content (default).
  • stretch: The items stretch to fill the available width. The component adds the k-segmented-control-stretched CSS class.
Default:

"compact"

Example:
vue
<SegmentedControl :layout-mode="'stretch'" :items="items" />

rounded?

"small" | "medium" | "large" | "none" | "full"

Sets the border radius of the SegmentedControl. The component maps the value through kendoThemeMaps.roundedMap to the matching k-rounded-* CSS class.

The available options are:

  • none
  • small
  • medium
  • large
  • full
Default:

undefined (theme-controlled)

Example:
vue
<SegmentedControl :rounded="'medium'" :items="items" />

size?

"xs" | "small" | "medium" | "large"

Sets the size of the SegmentedControl items. The component maps the value through kendoThemeMaps.sizeMap to the matching CSS size class.

The available options are:

  • xs
  • small
  • medium
  • large
  • null — Does not set a size className.
Example:
vue
<SegmentedControl :size="'large'" :items="items" />

value?

string

Sets the value of the selected item. When you set it, you control the selection. Use the change event to update the value. The item whose value matches this property gets the k-selected CSS class.

Example:
vue
<SegmentedControl :value="selectedValue" @change="(val) => selectedValue = val" :items="items" />