Skip to content

KSteps

Steps is a navigation bar that guides users through the steps of a task. It contains two components KStep and KSteps

Install

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

Basic usage

Vertical display

Use direction to set Steps to vertical

Vertical title

Use labelPlacement to set the title vertically

Dot style

Use the dot attribute to switch dot styles

Use the navigation attribute to switch navigation styles

Clickable Step

Make Step clickable through the canClick attribute

Different status

The status field in the items attribute can forcefully set the status of the Step

Custom rendering

By using the slots of the component KStep you can customize the rendering content

TIP

In most cases you won't need custom rendering as this will require you to manage the styles yourself

Steps Props

NameTypeDefaultDescription
activenumber | string0The currently activated step, its value should be the index field in the attribute items
directionvertical | horizontalhorizontalDisplay direction of Steps.
labelPlacementvertical | horizontalhorizontalThe display direction of title, subTitle and description in Steps. It is only valid when the value of direction is horizontal.
dotbooleanfalseWhether Step is displayed as dots
navigationbooleanfalsenavigation mode for Steps. After setting, the steps become connected by arrows.
canClickbooleanfalseWhether Step can be clicked to interact.
itemsKStepsItems[]item of Steps, used to render step.
clsstring''Additional class for component
attrsany{}Additional attributes
typescript
export interface KStepsItem {
	// The index value of `item`,
	// which will match `active` to determine which `Step` is currently
	index: string | number;
	// Step title
	title: string;
	// Step sub title
	subTitle?: string;
	// Step description
	description?: string;
	// If not set, the state of the previous `step` defaults to 'finish',
	// the state of the next `step` defaults to 'wait',
	// and the state of the current `step` defaults to 'process'
	status?: KStepStatus;
}
export type KStepStatus = 'wait' | 'process' | 'finish' | 'error';

export type KStepsItems = Array<KStepsItem>;

Steps Events

NameDescriptionType
changeWhen the attribute canClick is true, it is triggered when Step is clicked.(item: KStepsItem)=> void

Steps Slots

NameDescription
defaultThe default slot of the KSteps component. Generally, you do not need to use it. If you want to customize rendering, please pass in the KStep component.

Step Props

NameTypeDefaultDescription
activenumber | string0Same as the KSteps component, just pass in the same value when using it
directionvertical | horizontalhorizontalSame as the KSteps component, just pass in the same value when using it
labelPlacementvertical | horizontalhorizontalSame as the KSteps component, just pass in the same value when using it
dotbooleanfalseSame as the KSteps component, just pass in the same value when using it
navigationbooleanfalseSame as the KSteps component, just pass in the same value when using it
canClickbooleanfalseSame as the KSteps component, just pass in the same value when using it
itemKStepsItem{ title: '', index: '' }item of Step, used to render step.
indexnumber0Just pass in the same value as the index field of item.
eachIndexnumber0Numbers displayed by Step.
lastbooleanfalseWhether it is the last Step.
clsstring''Additional class for component
attrsany{}Additional attributes

Step Events

NameDescriptionType
changeWhen the attribute canClick is true, it is triggered when Step is clicked.(item: KStepsItem)=> void

Step Slots

NameDescription
iconCustomize the icon content of rendering Step
titleCustomize the title content of rendering Step
subTitleCustomize the subTitle content of rendering Step
descriptionCustomize the description content of rendering Step

MIT Licensed