Skip to content

KSegmented

When displaying multiple options and user can select a single option.

Install

bash
pnpm add @ikun-ui/segmented
bash
yarn add @ikun-ui/segmented
bash
npm install @ikun-ui/segmented

Basic usage

The most basic usage.

Block segmented

block property will make the Segmented fit to its parent width.

Disabled

Disabled Segmented.

Custom render

Custom each Segmented Item by slot.

Sizes

There are three sizes of an Segmented

Icon

Set icon for Segmented Item.

Just Only icon

Set icon without label for Segmented Item.

Segmented Props

NameTypeDefaultDescription
valuestring | number''Selected value.
sizesm | md | lgmdSize of segmented
blockbooleanfalseOption to fit width to its parent's width.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Segmented Events

NameDescriptionType
changeThe callback function that is triggered when the state changes.(value: string | number)=> void

Segmented Slots

NameDescription
defaultcontent of segmented component

SegmentedItem Props

NameTypeDefaultDescription
valuestring | number-The callback value of SegmentedItem. Clicking on SegmentedItem will be passed to the event as a parameter..
disabledbooleanfalseWhether the SegmentedItem is disabled.
labelstring-Display value of SegmentedItem.
iconstring-The front icon of SegmentedItem, which should comply with unocss standard.
onlyIconbooleanfalseShow only icons.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

SegmentedItem Events

NameDescriptionType
clickThe callback function that is triggered when click segmentedItem.(value: string | number)=> void

SegmentedItem Slots

NameDescription
defaultcontent of segmentedItem component

MIT Licensed