# Kui Vue > Kui Vue is a Vue 3 desktop component library with TypeScript support. ## Install ```bash pnpm add kui-vue kui-icons ``` Import `kui-vue/style/index.css`, then import components from `kui-vue` or install the plugin globally. ## Machine-readable resources - [Complete AI documentation](https://k-ui.cn/llms-full.txt) - [Component metadata](https://k-ui.cn/kui-components.json) - [Documentation](https://k-ui.cn/components) - [GitHub](https://github.com/smallerqiu/kui-vue) ## Components - [Affix](https://k-ui.cn/components/affix): tags `Affix`, `KAffix`, `k-affix`, `affix` - [Popup](https://k-ui.cn/components/popup): tags `Popup`, `KPopup`, `k-popup`, `popup` - [Alert](https://k-ui.cn/components/alert): tags `Alert`, `KAlert`, `k-alert`, `alert` - [AutoComplete](https://k-ui.cn/components/auto-complete): tags `AutoComplete`, `KAutoComplete`, `k-auto-complete`, `auto-complete` - [Anchor](https://k-ui.cn/components/anchor): tags `Anchor`, `KAnchor`, `k-anchor`, `anchor` - [AnchorLink](https://k-ui.cn/components/anchor): tags `AnchorLink`, `KAnchorLink`, `k-anchor-link`, `anchor-link` - [Avatar](https://k-ui.cn/components/avatar): tags `Avatar`, `KAvatar`, `k-avatar`, `avatar` - [AvatarGroup](https://k-ui.cn/components/avatar): tags `AvatarGroup`, `KAvatarGroup`, `k-avatar-group`, `avatar-group` - [Breadcrumb](https://k-ui.cn/components/breadcrumb): tags `Breadcrumb`, `KBreadcrumb`, `k-breadcrumb`, `breadcrumb` - [BreadcrumbItem](https://k-ui.cn/components/breadcrumb): tags `BreadcrumbItem`, `KBreadcrumbItem`, `k-breadcrumb-item`, `breadcrumb-item` - [BackTop](https://k-ui.cn/components/back-top): tags `BackTop`, `KBackTop`, `k-back-top`, `back-top` - [Badge](https://k-ui.cn/components/badge): tags `Badge`, `KBadge`, `k-badge`, `badge` - [Button](https://k-ui.cn/components/button): tags `Button`, `KButton`, `k-button`, `button` - [ButtonGroup](https://k-ui.cn/components/button): tags `ButtonGroup`, `KButtonGroup`, `k-button-group`, `button-group` - [Cascader](https://k-ui.cn/components/cascader): tags `Cascader`, `KCascader`, `k-cascader`, `cascader` - [Card](https://k-ui.cn/components/card): tags `Card`, `KCard`, `k-card`, `card` - [CardMeta](https://k-ui.cn/components/card): tags `CardMeta`, `KCardMeta`, `k-card-meta`, `card-meta` - [Calendar](https://k-ui.cn/components/calendar): tags `Calendar`, `KCalendar`, `k-calendar`, `calendar` - [FeatureCard](https://k-ui.cn/components/feature-card): tags `FeatureCard`, `KFeatureCard`, `k-feature-card`, `feature-card` - [FlameWrap](https://k-ui.cn/components/flame-wrap): tags `FlameWrap`, `KFlameWrap`, `k-flame-wrap`, `flame-wrap` - [ListPanel](https://k-ui.cn/components/list-panel): tags `ListPanel`, `KListPanel`, `k-list-panel`, `list-panel` - [Carousel](https://k-ui.cn/components/carousel): tags `Carousel`, `KCarousel`, `k-carousel`, `carousel` - [CarouselItem](https://k-ui.cn/components/carousel-item): tags `CarouselItem`, `KCarouselItem`, `k-carousel-item`, `carousel-item` - [Checkbox](https://k-ui.cn/components/checkbox): tags `Checkbox`, `KCheckbox`, `k-checkbox`, `checkbox` - [CheckboxGroup](https://k-ui.cn/components/checkbox): tags `CheckboxGroup`, `KCheckboxGroup`, `k-checkbox-group`, `checkbox-group` - [CheckCard](https://k-ui.cn/components/check-card): tags `CheckCard`, `KCheckCard`, `k-check-card`, `check-card` - [CheckCardGroup](https://k-ui.cn/components/check-card): tags `CheckCardGroup`, `KCheckCardGroup`, `k-check-card-group`, `check-card-group` - [Collapse](https://k-ui.cn/components/collapse): tags `Collapse`, `KCollapse`, `k-collapse`, `collapse` - [CollapsePanel](https://k-ui.cn/components/collapse): tags `CollapsePanel`, `KCollapsePanel`, `k-collapse-panel`, `collapse-panel` - [ColorPickerPanel](https://k-ui.cn/components/color-picker-panel): tags `ColorPickerPanel`, `KColorPickerPanel`, `k-color-picker-panel`, `color-picker-panel` - [ColorPicker](https://k-ui.cn/components/color-picker): tags `ColorPicker`, `KColorPicker`, `k-color-picker`, `color-picker` - [DatePickerPanel](https://k-ui.cn/components/date-picker-panel): tags `DatePickerPanel`, `KDatePickerPanel`, `k-date-picker-panel`, `date-picker-panel` - [DatePicker](https://k-ui.cn/components/date-picker): tags `DatePicker`, `KDatePicker`, `k-date-picker`, `date-picker` - [Descriptions](https://k-ui.cn/components/descriptions): tags `Descriptions`, `KDescriptions`, `k-descriptions`, `descriptions` - [DescriptionsItem](https://k-ui.cn/components/descriptions): tags `DescriptionsItem`, `KDescriptionsItem`, `k-descriptions-item`, `descriptions-item` - [Drawer](https://k-ui.cn/components/drawer): tags `Drawer`, `KDrawer`, `k-drawer`, `drawer` - [Dropdown](https://k-ui.cn/components/dropdown): tags `Dropdown`, `KDropdown`, `k-dropdown`, `dropdown` - [DropdownButton](https://k-ui.cn/components/dropdown): tags `DropdownButton`, `KDropdownButton`, `k-dropdown-button`, `dropdown-button` - [Divider](https://k-ui.cn/components/divider): tags `Divider`, `KDivider`, `k-divider`, `divider` - [Empty](https://k-ui.cn/components/empty): tags `Empty`, `KEmpty`, `k-empty`, `empty` - [Form](https://k-ui.cn/components/form): tags `Form`, `KForm`, `k-form`, `form` - [FormItem](https://k-ui.cn/components/form): tags `FormItem`, `KFormItem`, `k-form-item`, `form-item` - [Flex](https://k-ui.cn/components/flex): tags `Flex`, `KFlex`, `k-flex`, `flex` - [Grid](https://k-ui.cn/components/grid): tags `Grid`, `KGrid`, `k-grid`, `grid` - [GridItem](https://k-ui.cn/components/grid): tags `GridItem`, `KGridItem`, `k-grid-item`, `grid-item` - [Image](https://k-ui.cn/components/image): tags `Image`, `KImage`, `k-image` - [ImageGroup](https://k-ui.cn/components/image): tags `ImageGroup`, `KImageGroup`, `k-image-group`, `image-group` - [Icon](https://k-ui.cn/components/icon): tags `Icon`, `KIcon`, `k-icon`, `icon` - [Input](https://k-ui.cn/components/input): tags `Input`, `KInput`, `k-input`, `input` - [InputGroup](https://k-ui.cn/components/input): tags `InputGroup`, `KInputGroup`, `k-input-group`, `input-group` - [TextArea](https://k-ui.cn/components/input): tags `TextArea`, `KTextArea`, `k-text-area`, `text-area` - [InputTag](https://k-ui.cn/components/input-tag): tags `InputTag`, `KInputTag`, `k-input-tag`, `input-tag` - [InputOTP](https://k-ui.cn/components/input-otp): tags `InputOTP`, `KInputOTP`, `k-input-otp`, `input-otp` - [InputNumber](https://k-ui.cn/components/input-number): tags `InputNumber`, `KInputNumber`, `k-input-number`, `input-number` - [Content](https://k-ui.cn/components/content): tags `Content`, `KContent`, `k-content`, `content` - [Footer](https://k-ui.cn/components/footer): tags `Footer`, `KFooter`, `k-footer`, `footer` - [Header](https://k-ui.cn/components/header): tags `Header`, `KHeader`, `k-header`, `header` - [Layout](https://k-ui.cn/components/layout): tags `Layout`, `KLayout`, `k-layout`, `layout` - [Sider](https://k-ui.cn/components/layout): tags `Sider`, `KSider`, `k-sider`, `sider` - [Menu](https://k-ui.cn/components/menu): tags `Menu`, `KMenu`, `k-menu`, `menu` - [MenuDivider](https://k-ui.cn/components/menu-divider): tags `MenuDivider`, `KMenuDivider`, `k-menu-divider`, `menu-divider` - [MenuGroup](https://k-ui.cn/components/menu): tags `MenuGroup`, `KMenuGroup`, `k-menu-group`, `menu-group` - [MenuItem](https://k-ui.cn/components/menu): tags `MenuItem`, `KMenuItem`, `k-menu-item`, `menu-item` - [SubMenu](https://k-ui.cn/components/menu): tags `SubMenu`, `KSubMenu`, `k-sub-menu`, `sub-menu` - [Mentions](https://k-ui.cn/components/mentions): tags `Mentions`, `KMentions`, `k-mentions`, `mentions` - [MessagePanel](https://k-ui.cn/components/message-panel): tags `MessagePanel`, `KMessagePanel`, `k-message-panel`, `message-panel` - [NoticePanel](https://k-ui.cn/components/notice-panel): tags `NoticePanel`, `KNoticePanel`, `k-notice-panel`, `notice-panel` - [ModalPanel](https://k-ui.cn/components/modal-panel): tags `ModalPanel`, `KModalPanel`, `k-modal-panel`, `modal-panel` - [Modal](https://k-ui.cn/components/modal): tags `Modal`, `KModal`, `k-modal`, `modal` - [Page](https://k-ui.cn/components/page): tags `Page`, `KPage`, `k-page`, `page` - [PageHeader](https://k-ui.cn/components/page-header): tags `PageHeader`, `KPageHeader`, `k-page-header`, `page-header` - [PoptipPanel](https://k-ui.cn/components/poptip-panel): tags `PoptipPanel`, `KPoptipPanel`, `k-poptip-panel`, `poptip-panel` - [Poptip](https://k-ui.cn/components/poptip): tags `Poptip`, `KPoptip`, `k-poptip`, `poptip` - [PopconfirmPanel](https://k-ui.cn/components/popconfirm-panel): tags `PopconfirmPanel`, `KPopconfirmPanel`, `k-popconfirm-panel`, `popconfirm-panel` - [Popconfirm](https://k-ui.cn/components/popconfirm): tags `Popconfirm`, `KPopconfirm`, `k-popconfirm`, `popconfirm` - [Progress](https://k-ui.cn/components/progress): tags `Progress`, `KProgress`, `k-progress`, `progress` - [Ripple](https://k-ui.cn/components/ripple): tags `Ripple`, `KRipple`, `k-ripple`, `ripple` - [QRCode](https://k-ui.cn/components/qrcode): tags `QRCode`, `KQRCode`, `k-qr-code`, `qr-code` - [Radio](https://k-ui.cn/components/radio): tags `Radio`, `KRadio`, `k-radio`, `radio` - [RadioButton](https://k-ui.cn/components/radio): tags `RadioButton`, `KRadioButton`, `k-radio-button`, `radio-button` - [RadioGroup](https://k-ui.cn/components/radio): tags `RadioGroup`, `KRadioGroup`, `k-radio-group`, `radio-group` - [Segmented](https://k-ui.cn/components/segmented): tags `Segmented`, `KSegmented`, `k-segmented`, `segmented` - [Rate](https://k-ui.cn/components/rate): tags `Rate`, `KRate`, `k-rate`, `rate` - [Result](https://k-ui.cn/components/result): tags `Result`, `KResult`, `k-result`, `result` - [FeedbackPanel](https://k-ui.cn/components/feedback-panel): tags `FeedbackPanel`, `KFeedbackPanel`, `k-feedback-panel`, `feedback-panel` - [Option](https://k-ui.cn/components/select): tags `Option`, `KOption`, `k-option`, `option` - [Select](https://k-ui.cn/components/select): tags `Select`, `KSelect`, `k-select`, `select` - [ConfigProvider](https://k-ui.cn/components/config): tags `ConfigProvider`, `KConfigProvider`, `k-config-provider`, `config-provider` - [Skeleton](https://k-ui.cn/components/skeleton): tags `Skeleton`, `KSkeleton`, `k-skeleton`, `skeleton` - [SkeletonAvatar](https://k-ui.cn/components/skeleton): tags `SkeletonAvatar`, `KSkeletonAvatar`, `k-skeleton-avatar`, `skeleton-avatar` - [SkeletonButton](https://k-ui.cn/components/skeleton): tags `SkeletonButton`, `KSkeletonButton`, `k-skeleton-button`, `skeleton-button` - [SkeletonImage](https://k-ui.cn/components/skeleton): tags `SkeletonImage`, `KSkeletonImage`, `k-skeleton-image`, `skeleton-image` - [SkeletonText](https://k-ui.cn/components/skeleton): tags `SkeletonText`, `KSkeletonText`, `k-skeleton-text`, `skeleton-text` - [StatCard](https://k-ui.cn/components/stat-card): tags `StatCard`, `KStatCard`, `k-stat-card`, `stat-card` - [StatNumber](https://k-ui.cn/components/stat-number): tags `StatNumber`, `KStatNumber`, `k-stat-number`, `stat-number` - [Slider](https://k-ui.cn/components/slider): tags `Slider`, `KSlider`, `k-slider`, `slider` - [Space](https://k-ui.cn/components/space): tags `Space`, `KSpace`, `k-space`, `space` - [Spin](https://k-ui.cn/components/spin): tags `Spin`, `KSpin`, `k-spin`, `spin` - [Step](https://k-ui.cn/components/steps): tags `Step`, `KStep`, `k-step`, `step` - [Steps](https://k-ui.cn/components/steps): tags `Steps`, `KSteps`, `k-steps`, `steps` - [Switch](https://k-ui.cn/components/switch): tags `Switch`, `KSwitch`, `k-switch` - [Splitter](https://k-ui.cn/components/splitter): tags `Splitter`, `KSplitter`, `k-splitter`, `splitter` - [SplitterPanel](https://k-ui.cn/components/splitter): tags `SplitterPanel`, `KSplitterPanel`, `k-splitter-panel`, `splitter-panel` - [Table](https://k-ui.cn/components/table): tags `Table`, `KTable`, `k-table`, `table` - [TableColumnSetting](https://k-ui.cn/components/table): tags `TableColumnSetting`, `KTableColumnSetting`, `k-table-column-setting`, `table-column-setting` - [Kanban](https://k-ui.cn/components/kanban): tags `Kanban`, `kanban` - [TooltipPanel](https://k-ui.cn/components/tooltip-panel): tags `TooltipPanel`, `KTooltipPanel`, `k-tooltip-panel`, `tooltip-panel` - [Tooltip](https://k-ui.cn/components/tooltip): tags `Tooltip`, `KTooltip`, `k-tooltip`, `tooltip` - [Tour](https://k-ui.cn/components/tour): tags `Tour`, `KTour`, `k-tour`, `tour` - [Transfer](https://k-ui.cn/components/transfer): tags `Transfer`, `KTransfer`, `k-transfer`, `transfer` - [Typography](https://k-ui.cn/components/typography): tags `Typography`, `KTypography`, `k-typography`, `typography` - [TypographyParagraph](https://k-ui.cn/components/typography-paragraph): tags `TypographyParagraph`, `KTypographyParagraph`, `k-typography-paragraph`, `typography-paragraph` - [TypographyText](https://k-ui.cn/components/typography-text): tags `TypographyText`, `KTypographyText`, `k-typography-text`, `typography-text` - [TypographyTitle](https://k-ui.cn/components/typography-title): tags `TypographyTitle`, `KTypographyTitle`, `k-typography-title`, `typography-title` - [TabPanel](https://k-ui.cn/components/tabs): tags `TabPanel`, `KTabPanel`, `k-tab-panel`, `tab-panel` - [Tabs](https://k-ui.cn/components/tabs): tags `Tabs`, `KTabs`, `k-tabs`, `tabs` - [TimeLine](https://k-ui.cn/components/time-line): tags `TimeLine`, `KTimeLine`, `k-time-line`, `time-line` - [TimeLineItem](https://k-ui.cn/components/time-line): tags `TimeLineItem`, `KTimeLineItem`, `k-time-line-item`, `time-line-item` - [Tree](https://k-ui.cn/components/tree): tags `Tree`, `KTree`, `k-tree`, `tree` - [TreeSelect](https://k-ui.cn/components/tree-select): tags `TreeSelect`, `KTreeSelect`, `k-tree-select`, `tree-select` - [Tag](https://k-ui.cn/components/tag): tags `Tag`, `KTag`, `k-tag`, `tag` - [Col](https://k-ui.cn/components/row-col): tags `Col`, `KCol`, `k-col`, `col` - [Row](https://k-ui.cn/components/row-col): tags `Row`, `KRow`, `k-row`, `row` - [Upload](https://k-ui.cn/components/upload): tags `Upload`, `KUpload`, `k-upload`, `upload` - [Watermark](https://k-ui.cn/components/watermark): tags `Watermark`, `KWatermark`, `k-watermark`, `watermark` - [VirtualList](https://k-ui.cn/components/virtual-list): tags `VirtualList`, `KVirtualList`, `k-virtual-list`, `virtual-list` --- # Affix Pin page elements within the visible range. ## When to Use When the content area is long and requires scrolling, the corresponding operations or navigation for this part of the content need to remain visible within the scrolling range. Commonly used for side menus and button combinations. Use this feature cautiously when the visible area of the page is small to avoid blocking page content. ## Examples [Basic Usage](./demo/basic.vue) - The simplest usage. [Fixed State Change Callback](./demo/callbacks.vue) - You can get whether it is fixed. [Scroll Container](./demo/container.vue) - Use `target` to set the element whose scroll event `Affix` listens to. Defaults to `window`. [Affix to Bottom](./demo/bottom.vue) - Use `offsetBottom` to pin an element to the bottom of the viewport. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | offsetTop | Affix after reaching the specified offset from the target top | `number` | 0 | | offsetBottom | Affix after reaching the specified offset from the target bottom; takes priority over `offsetTop` | `number` | - | | target | Scroll target observed by Affix | `() => Window \| HTMLElement \| null` | window | | change | Emitted when the affixed state changes | `(affixed: boolean) => void` | - | --- # Popup A generic anchored popup. Dropdown adds menu semantics on top; Popup can display forms, pickers, or arbitrary content. It does not supply a menu role, selection logic, or a focus trap. ```vue ``` ## When to use Use Popup for anchored custom forms, filters, and compound panels. Use Dropdown for menus, Poptip for titled cards, and Tooltip for brief text hints. Popup handles positioning and visibility, not selection, form validation, or focus trapping. Use Modal or Drawer when a modal interaction is needed. Use the default slot for the trigger and the scoped overlay slot for content; avoid h() in .vue examples. Bind v-model:open for controlled state. ## Examples [Basic usage and custom content](./demo/basic.vue) - Render inputs, buttons, or arbitrary content and call close from inside. Mounted content is retained by default; destroyOnClose unmounts it after the exit animation. [Trigger modes](./demo/trigger.vue) - Supports click, hover, focus, and contextmenu. Context menus use the pointer position. Hover supports opening/closing delays; see the controlled example for manual mode. [Placement and arrows](./demo/placement.vue) - Choose among 12 placements, toggle arrow, and set offset. Placement may adjust when space is limited. [Controlled state and instance methods](./demo/controlled.vue) - Interactions update internal visibility and emit changes for external synchronization. Instances expose open / close / updatePosition; this example displays the latest request reason. [Custom container](./demo/container.vue) - getPopupContainer selects the mount node, otherwise ConfigProvider or body is used. Establish a positioning context on custom containers. matchTriggerWidth matches the trigger's minimum width; ancestor overflow may clip the popup. [Nested popups and selectors](./demo/nested.vue) - Choosing a Select option keeps the outer popup open. Escape dismisses the topmost popup first; dismissing the parent also closes its nested popups. ## Popup API | Property | Description | Type | Default | | --- | --- | --- | --- | | open | Initial visibility; subsequent changes synchronize the state; Vue supports v-model:open | `boolean` | - | | disabled | Prevents opening and cancels delayed opening; does not override open | `boolean` | false | | placement | Popup placement; supports 12 positions | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right" \| "left" \| "left-bottom" \| "left-top" \| "right" \| "right-top" \| "right-bottom"` | bottom-left | | trigger | Trigger mode; manual uses open or instance methods | `"hover" \| "click" \| "focus" \| "contextmenu" \| "manual"` | click | | arrow | Show arrow | `boolean` | false | | offset | Position offset in pixels | `number` | 3 | | openDelay | Hover opening delay in milliseconds | `number` | 0 | | closeDelay | Hover / focus closing delay in milliseconds | `number` | 300 | | closeOnOutsideClick | Close on outside click; nested Popup content counts as inside | `boolean` | true | | closeOnEscape | Escape closes the top Popup and restores trigger focus | `boolean` | true | | matchTriggerWidth | Use trigger width as the minimum popup width | `boolean` | false | | getPopupContainer | Container; falls back to Config or body | `(() => HTMLElement \| null \| undefined)` | - | | destroyOnClose | Destroy after exit; preserves form state by default | `boolean` | false | | target | Optional external positioning anchor; no event binding, use with manual and open | `HTMLElement \| Ref` | - | | overlay | Overlay content; prefer the overlay slot in Vue | `VNodeChild` | - | | onOpenChange | Visibility change request with reason and native event | `((open: boolean, detail: PopupOpenChangeDetail) => void)` | - | | onAfterOpen | Called after entering | `(() => void)` | - | | onAfterClose | Called after leaving | `(() => void)` | - | The default slot renders the trigger; the overlay slot renders popup content. Both receive PopupRef methods. ## Adapter options Used by Dropdown, Tooltip, Poptip and Popconfirm to preserve existing appearance. | Property | Description | Type | Default | | ----------------------- | -------------------------------------------------------------------- | ----------------------------------------------- | --------- | | prefixCls | Root CSS prefix | string | k-popup | | transitionName | Transition CSS prefix | string | prefixCls | | panelOnly | Inline content only; no positioning, trigger, or global listeners | boolean | false | | respectDefaultPrevented | Honor preventDefault on trigger click | boolean | true | | contentStyle | Content container styles | CSSProperties | - | | hideWhenDetached | Hide when the anchor is outside the viewport | boolean | false | | triggerAttrs | Attributes forwarded to the trigger | Record | - | | onTriggerKeydown | Business keyboard handler; preventDefault cancels the default action | (event: KeyboardEvent, popup: PopupRef) => void | - | ## Types and instance methods | Property | Description | Type | Default | | ------------------ | ------------------------------------------------------------------------ | -------------------------------------- | ------------ | | raw | Reuse the single overlay root and preserve its DOM ref; no extra wrapper | boolean | false | | outsideEvent | Outside pointer event used by legacy selector adapters | `click` \| `mousedown` | click | | transitionDuration | Transition duration in milliseconds | number | CSS duration | | getAnchorPosition | Optional viewport point resolver, for caret-anchored Mentions | () => { x: number; y: number } \| null | - | Select, TreeSelect, Cascader, AutoComplete, Mentions, DatePicker and ColorPicker share this positioning and lifecycle implementation. Their selection, search and keyboard logic remains inside the business components. - PopupTrigger: hover / click / focus / contextmenu / manual. - PopupOpenChangeDetail: { reason: PopupOpenReason; event?: Event }. - PopupOpenReason: trigger / hover / focus / contextmenu / outside / escape / programmatic / host. - PopupRef: open(), close(), updatePosition(), cancelClose(), scheduleClose(), getTriggerElement(), getPopupElement(). - PopupTarget: HTMLElement or Ref. - PopupContent: VNodeChild. Use open to initialize and synchronize visibility. Interactions update internal state and emit onOpenChange. Only hover uses openDelay. External target anchors are position-only. Custom trigger components must forward attributes, events, and the DOM ref. --- # Alert Warning prompts to display information that needs attention. ## When to Use - When a page needs to display warning information to the user. - A non-overlay static display form, always displayed, does not disappear automatically, users can click to close. ## Examples [Basic Usage](./demo/basic.vue) - Control the display type via `type`. [Icon](./demo/icon.vue) - Use `showIcon` to control whether the icon is displayed. [Closable](./demo/close.vue) - Use `closable` to control whether the close button is displayed, with smooth and natural closing animation. [Custom Icon](./demo/custom-icon.vue) - Use `showIcon` to control whether the icon is displayed. ## Closing Clicking the close button triggers `close`. After the exit animation, the content is removed and `afterClose` fires. To unmount the entire component after closing, update the parent state in `afterClose` and use `v-if`. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | type | Alert type, optional values are `success`, `info`, `warning`, `error` or not set | `"info" \| "success" \| "warning" \| "error"` | warning | | message | Alert content | `string` | - | | description | Auxiliary text introduction for the alert | `string` | - | | showIcon | Whether to show the icon | `boolean` | false | | closable | Whether to show the close button | `boolean` | false | | bordered | Whether to display the border | `boolean` | false | | onClose | Triggered when the close button is clicked | `(event: MouseEvent) => void` | - | | onAfterClose | Triggered after the exit animation | `() => void` | - | | icon | Custom icon | `IconType[]` | - | | theme | Appearance: `default`, `fill`, `outline`, or `plain` | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | default | | shape | Shape: `round`, `circle`, or `square` | `"default" \| "circle" \| "square" \| "round"` | round | --- # AutoComplete Provide candidates based on the input while retaining the ability for free text entry. ## Examples [Basic](./demo/basic.vue) - Supports free input, filtering, and keyboard selection. [Controlled value](./demo/controlled.vue) - Manage and update the input through v-model. [Custom filter](./demo/filter.vue) - Define matching behavior with filterOption. [Size, theme and shape](./demo/appearance.vue) - Shows several appearance combinations. [Show on empty](./demo/show-on-empty.vue) - The dropdown stays closed for an empty input by default; enable `showOnEmpty` to show all suggestions. [Remote search](./demo/remote.vue) - Fetch suggestions on `search` and display the loading state with `loading`. ## AutoComplete API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Value (v-model) | `string` | - | | value | Initial value | `string` | '' | | options | Suggestions | `(string \| AutoCompleteOption)[]` | [] | | open | open state | `boolean` | - | | showOnEmpty | Show suggestions when an empty input is focused | `boolean` | false | | clearable | Show the clear button on hover when a value exists | `boolean` | false | | disabled | Disabled | `boolean` | false | | readonly | Read-only; prevents editing, clearing and opening | `boolean` | false | | loading | Loading state | `boolean` | false | | loadingText | Loading text | `string` | Loading | | placeholder | Placeholder | `string` | - | | size | Size | `"small" \| "medium" \| "large"` | medium | | theme | Theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | shape | Shape | `"default" \| "circle" \| "square" \| "round"` | default | | filterOption | Filter strategy | `boolean \| ((input: string, option: AutoCompleteOption) => boolean)` | true | | onChange | Value change | `(value: string) => void` | - | | onClear | Clear callback | `() => void` | - | | onSearch | Search callback | `(value: string) => void` | - | | onSelect | Option selection | `(value: string, option: AutoCompleteOption) => void` | - | | onOpenChange | Open state change | `(open: boolean) => void` | - | --- # Anchor It is necessary to display the anchor links available for navigation on the current page and enable quick jumps between anchors. ## Examples [Basic Usage (Sidebar Navigation)](./demo/basic.vue?show=vertical) - The most common scenario: displaying a long article on the right with fixed anchor navigation on the left or right side. [Nested Anchors (Complex Document Structure)](./demo/nested-anchors.vue?show=vertical) - Suitable for documents with multi-level headings. [Specify container (positioning within a scrolling container)](./demo/within-container.vue?show=vertical) - If your page does not scroll in full screen but within a specific div. ## Anchor API | Property | Description | Type | Default | | --- | --- | --- | --- | | affix | Whether to use sticky positioning | `boolean` | true | | offsetTop | Offset from the container top for positioning and activation | `number` | 0 | | bounds | Anchor activation boundary | `number` | 5 | | container | Scroll container | `string \| Window \| HTMLElement` | window | | change | Emitted when the active anchor changes | `(activeLink: string) => void` | - | | click | Emitted when an anchor is clicked | `(link: string) => void` | - | ## AnchorLink API | Property | Description | Type | Default | | --- | --- | --- | --- | | href | Anchor link | `string` | - | | title | Text content, customizable via the named slot | `string` | - | --- # Anchor It is necessary to display the anchor links available for navigation on the current page and enable quick jumps between anchors. ## Examples [Basic Usage (Sidebar Navigation)](./demo/basic.vue?show=vertical) - The most common scenario: displaying a long article on the right with fixed anchor navigation on the left or right side. [Nested Anchors (Complex Document Structure)](./demo/nested-anchors.vue?show=vertical) - Suitable for documents with multi-level headings. [Specify container (positioning within a scrolling container)](./demo/within-container.vue?show=vertical) - If your page does not scroll in full screen but within a specific div. ## Anchor API | Property | Description | Type | Default | | --- | --- | --- | --- | | affix | Whether to use sticky positioning | `boolean` | true | | offsetTop | Offset from the container top for positioning and activation | `number` | 0 | | bounds | Anchor activation boundary | `number` | 5 | | container | Scroll container | `string \| Window \| HTMLElement` | window | | change | Emitted when the active anchor changes | `(activeLink: string) => void` | - | | click | Emitted when an anchor is clicked | `(link: string) => void` | - | ## AnchorLink API | Property | Description | Type | Default | | --- | --- | --- | --- | | href | Anchor link | `string` | - | | title | Text content, customizable via the named slot | `string` | - | --- # Avatar Used to represent users or things, supports image, icon, or character display. ## Examples [Basic](./demo/basic.vue) - Avatars support preset and custom sizes, with three available shapes. [Types](./demo/types.vue) - Three types are supported: Image, Icon, and Text. Icon and Text avatars support custom icon color and background color. [With logo and grouping](./demo/badge-group.vue) - Typically used for message prompts and avatar combination display. [Auto Font Size Adjustment](./demo/change.vue) - For text avatars, when the string is long, the font size automatically adjusts based on the avatar width. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | icon | Avatar icon; overrides the default User fallback when an image fails | `IconType[]` | - | | shape | Avatar shape | `"circle" \| "square" \| "round"` | circle | | size | Avatar size | `AvatarSize` | default | | src | Image source | `string` | - | | alt | Alternative text when the image cannot be displayed | `string` | - | | onError | Image error callback; return `false` to prevent rendering fallback | `((event: Event) => boolean \| void)` | - | ## AvatarGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | maxCount | Maximum number of avatars to display | `number` | - | | size | Sets child size and adjusts their overlap proportionally | `AvatarSize` | default | | spacing | Child avatar overlap in pixels; `0` disables overlap | `number` | auto | | shape | Sets the shape of all child avatars | `"circle" \| "square" \| "round"` | circle | --- # Avatar Used to represent users or things, supports image, icon, or character display. ## Examples [Basic](./demo/basic.vue) - Avatars support preset and custom sizes, with three available shapes. [Types](./demo/types.vue) - Three types are supported: Image, Icon, and Text. Icon and Text avatars support custom icon color and background color. [With logo and grouping](./demo/badge-group.vue) - Typically used for message prompts and avatar combination display. [Auto Font Size Adjustment](./demo/change.vue) - For text avatars, when the string is long, the font size automatically adjusts based on the avatar width. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | icon | Avatar icon; overrides the default User fallback when an image fails | `IconType[]` | - | | shape | Avatar shape | `"circle" \| "square" \| "round"` | circle | | size | Avatar size | `AvatarSize` | default | | src | Image source | `string` | - | | alt | Alternative text when the image cannot be displayed | `string` | - | | onError | Image error callback; return `false` to prevent rendering fallback | `((event: Event) => boolean \| void)` | - | ## AvatarGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | maxCount | Maximum number of avatars to display | `number` | - | | size | Sets child size and adjusts their overlap proportionally | `AvatarSize` | default | | spacing | Child avatar overlap in pixels; `0` disables overlap | `number` | auto | | shape | Sets the shape of all child avatars | `"circle" \| "square" \| "round"` | circle | --- # Breadcrumb Displays the current page's position in the system hierarchy and allows navigation upwards. ## When to Use - When the system has more than two levels of hierarchy. - When you need to inform the user 'where you are'. - When upward navigation functionality is needed. ## Examples [Basic Usage](./demo/basic.vue) - Add navigation links via `href`. [Set Icon](./demo/icon.vue) - Set the icon via `icon`. [Separator](./demo/separator.vue) - Set the separator via the `separator` property or slot. ## Breadcrumb API | Property | Description | Type | Default | | --- | --- | --- | --- | | separator | Custom separator | `string \| number \| boolean \| void \| VNode \| VNodeArrayChildren \| null` | `/` | ## BreadcrumbItem API | Property | Description | Type | Default | | --- | --- | --- | --- | | href | Link URL | `string` | - | | target | Link browsing context | `string` | - | | rel | Link relationship | `string` | - | | icon | Item icon | `IconType[]` | - | | onClick | Called when the item is clicked | `(event: MouseEvent) => void` | - | --- # Breadcrumb Displays the current page's position in the system hierarchy and allows navigation upwards. ## When to Use - When the system has more than two levels of hierarchy. - When you need to inform the user 'where you are'. - When upward navigation functionality is needed. ## Examples [Basic Usage](./demo/basic.vue) - Add navigation links via `href`. [Set Icon](./demo/icon.vue) - Set the icon via `icon`. [Separator](./demo/separator.vue) - Set the separator via the `separator` property or slot. ## Breadcrumb API | Property | Description | Type | Default | | --- | --- | --- | --- | | separator | Custom separator | `string \| number \| boolean \| void \| VNode \| VNodeArrayChildren \| null` | `/` | ## BreadcrumbItem API | Property | Description | Type | Default | | --- | --- | --- | --- | | href | Link URL | `string` | - | | target | Link browsing context | `string` | - | | rel | Link relationship | `string` | - | | icon | Item icon | `IconType[]` | - | | onClick | Called when the item is clicked | `(event: MouseEvent) => void` | - | --- # BackTop Button to return to the top of the page. ## When to Use - When the page content area is relatively long. - When users need to frequently return to the top to view related content. ## Examples [Basic Usage](./demo/basic.vue) - The default position is 50px from the right and bottom of the page. It appears after scrolling 100px. [Custom button](./demo/custom.vue) - You can customize the back-to-top button style, for example setting `bottom` to `100px`. [Custom scroll container](./demo/target.vue) - Use `target` to specify the scroll container to observe and return to the top. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | height | The BackTop component is displayed only when the scroll height reaches this value | `number` | 100 | | bottom | Distance from the bottom | `string \| number` | 50 | | right | Distance from the right | `string \| number` | 50 | | behavior | Scroll behavior | `"auto" \| "instant" \| "smooth"` | smooth | | onClick | Triggered when the button is clicked | `(event: MouseEvent) => void` | - | | onVisibleChange | Triggered when visibility changes | `(visible: boolean) => void` | - | | target | Scroll container | `() => HTMLElement \| null` | () => document.body | --- # Badge Circular badge number in the upper right corner of an icon. ## When to Use Generally appears in the upper right corner of notification icons or avatars, used to display the number of messages that need processing, attracting user attention through eye-catching visual forms. ## Examples [Basic Usage](./demo/basic.vue) - Basic usage of `Badge`. [Dot](./demo/dot.vue) - Set `dot` to display a dot. [Max Value / Custom](./demo/max.vue) - Use `max-count` with `count`. In numeric mode, values exceeding the max will be hidden. If `count` is not a number, it will not be calculated. [Standalone Usage](./demo/mark.vue) - Using without wrapping any element makes it standalone and allows custom styling. The badge in the top-right corner is limited to red. [Controlled](./demo/dynamic.vue) - Numeric counts roll upward when increasing and downward when decreasing. Text counts and overflow labels such as `99+` update without rolling. [Status Dot](./demo/status.vue) - A small dot used to indicate status. [Colorful Badge](./demo/color.vue) - Multiple preset color styles for different scenarios. If presets do not meet your needs, you can set a specific color value. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | count | The text to display | `string \| number` | - | | color | Badge color | `string` | - | | maxCount | The maximum numeric value to display. Values above this will be shown with a '+' sign | `number` | 99 | | dot | Do not display the number, only a small red dot | `boolean` | false | | pill | Use a pill appearance for a status badge | `boolean` | false | | text | If status is set, text sets the display text of the status dot | `string \| VNode` | '' | | status | Set Badge as a status dot | `"default" \| "success" \| "warning" \| "error"` | '' | | active | The dot is in the active state. | `boolean` | false | --- # Button The icon prop accepts icon data imported from `kui-icons`, not a string or rendered `Icon` element. Use `:icon="Search"`, not `icon="Search"` or `:icon="h(Icon, ...)"`. Custom components belong in the default slot. Buttons are used to initiate an immediate operation. ## When to Use Marks one (or encapsulates a group of) operation commands, responds to user click behavior, and triggers the corresponding business logic. ## Component Registration ```js import { Button } from "kui-vue"; Vue.use(Button); ``` ## Examples [Basic Usage](./demo/basic.vue) - Use the `type` property to define a `Button`. [Theme](./demo/theme.vue) - Use `theme` to display different appearances. [Color Variants](./demo/color.vue) - Use `color` to create more button variants. [With Icon](./demo/with-icon.vue) - Set the button icon by adding the `icon` property. [Size](./demo/size.vue) - `small` for small size, `large` for large size. [Disabled](./demo/disabled.vue) - Add the `disabled` property to make the button unavailable. [Loading State](./demo/loading.vue) - Add the `loading` property to put the button in a loading state. [Block Button](./demo/block.vue) - The `block` property makes the button fit the width of its parent. [Button Group](./demo/group.vue) - Place multiple `Button` components inside `ButtonGroup` to group them. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | type | Set the button type | `"default" \| "link" \| "warning" \| "text" \| "primary" \| "danger"` | - | | htmlType | Set the native type value of the button | `"button" \| "submit" \| "reset"` | button | | disabled | Disabled state of the button | `boolean` | false | | size | Button size, | `"small" \| "medium" \| "large"` | - | | color | Preset semantic color | `"default" \| "red" \| "orange" \| "yellow" \| "olive" \| "green" \| "teal" \| "blue" \| "volcano" \| "violet" \| "cyan" \| "gold" \| "lime" \| "magenta" \| "purple" \| "pink" \| "brown" \| "gray"` | - | | shape | When shape=circle, presents a circular button | `"default" \| "circle" \| "square" \| "round"` | false | | theme | Button theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | - | | icon | Icon definition imported from kui-icons (e.g. Search), not a string or rendered Icon element | `IconType[]` | - | | loading | Whether the button is in loading mode | `boolean` | false | | href | The address to jump to when clicked. Specifying this property makes the button behave like an a link | `string` | - | | target | Equivalent to the target attribute of an a link, takes effect when href exists | `string` | - | | block | Option to fit button width to its parent width | `boolean` | false | --- # Button The icon prop accepts icon data imported from `kui-icons`, not a string or rendered `Icon` element. Use `:icon="Search"`, not `icon="Search"` or `:icon="h(Icon, ...)"`. Custom components belong in the default slot. Buttons are used to initiate an immediate operation. ## When to Use Marks one (or encapsulates a group of) operation commands, responds to user click behavior, and triggers the corresponding business logic. ## Component Registration ```js import { Button } from "kui-vue"; Vue.use(Button); ``` ## Examples [Basic Usage](./demo/basic.vue) - Use the `type` property to define a `Button`. [Theme](./demo/theme.vue) - Use `theme` to display different appearances. [Color Variants](./demo/color.vue) - Use `color` to create more button variants. [With Icon](./demo/with-icon.vue) - Set the button icon by adding the `icon` property. [Size](./demo/size.vue) - `small` for small size, `large` for large size. [Disabled](./demo/disabled.vue) - Add the `disabled` property to make the button unavailable. [Loading State](./demo/loading.vue) - Add the `loading` property to put the button in a loading state. [Block Button](./demo/block.vue) - The `block` property makes the button fit the width of its parent. [Button Group](./demo/group.vue) - Place multiple `Button` components inside `ButtonGroup` to group them. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | type | Set the button type | `"default" \| "link" \| "warning" \| "text" \| "primary" \| "danger"` | - | | htmlType | Set the native type value of the button | `"button" \| "submit" \| "reset"` | button | | disabled | Disabled state of the button | `boolean` | false | | size | Button size, | `"small" \| "medium" \| "large"` | - | | color | Preset semantic color | `"default" \| "red" \| "orange" \| "yellow" \| "olive" \| "green" \| "teal" \| "blue" \| "volcano" \| "violet" \| "cyan" \| "gold" \| "lime" \| "magenta" \| "purple" \| "pink" \| "brown" \| "gray"` | - | | shape | When shape=circle, presents a circular button | `"default" \| "circle" \| "square" \| "round"` | false | | theme | Button theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | - | | icon | Icon definition imported from kui-icons (e.g. Search), not a string or rendered Icon element | `IconType[]` | - | | loading | Whether the button is in loading mode | `boolean` | false | | href | The address to jump to when clicked. Specifying this property makes the button behave like an a link | `string` | - | | target | Equivalent to the target attribute of an a link, takes effect when href exists | `string` | - | | block | Option to fit button width to its parent width | `boolean` | false | --- # Cascader A cascading selection box. ## When to Use - Used for selecting from a set of related data collections, such as provinces/cities/districts, company hierarchies, or category classifications. - Ideal for selecting from large datasets by separating them into multiple hierarchical levels for easier navigation. - Offers a better user experience compared to the Select component by allowing selections to be completed within a single floating layer. ## Examples [Basic](./demo/basic.vue) - The most basic cascader usage. Enable `showAllLevels` to display the complete administrative path selected by the user in the input box. [Trigger and Levels](./demo/hover.vue) - Hover trigger + Display only the last level. In e-commerce back-office systems when managing products or publishing listings, category trees are often extremely deep. Using `expandTrigger="hover"` significantly reduces the number of clicks required, while `showAllLevels="false"` keeps the interface cleaner after selection. [Disabled](./demo/disabled.vue) - When assigning system permissions or dispatching work orders, certain departments or inactive sub-branches (e.g., subsidiaries under rectification) need to be grayed out entirely. Utilizing the `disabled` property allows locking all paths underneath with one setting. [Async Loading](./demo/async.vue) - Load child options on demand. Loading state is shown and failed loads can be retried. [Size](./demo/size.vue) - Demonstrates the component's strong visual adaptability across different `size` constraints, suitable for various layouts such as compact modal forms or spacious configuration panels. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Array of path values bound through `v-model` (e.g., `['zhejiang', 'hangzhou', 'xihu']`). | `CascaderValue` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `CascaderValue` | `[]` | | options | Tree-structured data source for cascading options. | `CascaderOption[]` | `[]` | | placeholder | Fallback placeholder text displayed when no path is selected. | `string` | `"Please select"` | | disabled | Whether to completely disable interaction for the entire component. | `boolean` | `false` | | readonly | Read-only; prevents opening, clearing and changing. | `boolean` | `false` | | clearable | Whether to support clearing the selected path with one click. | `boolean` | `true` | | size | Size specification of the component. Options: `'large'` \| `'small'` \| `undefined`. | `"small" \| "medium" \| "large"` | `undefined` | | expandTrigger | Interaction mode for expanding the next-level menu. Options: `'click'` or `'hover'`. | `"hover" \| "click"` | `'click'` | | showAllLevels | Whether to display the full selected ancestor path. If `false`, only the final leaf node is shown in the input box. | `boolean` | `true` | | separator | Separator between labels of different levels when `showAllLevels` is enabled. | `string` | `" / "` | | bordered | Whether to display borders | `boolean` | true | | theme | Theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | showArrow | Whether to display the dropdown button | `boolean` | true | | icon | Custom Icon | `IconType[]` | - | | shape | shape='circle' 时呈现圆角 | `"default" \| "circle" \| "square" \| "round"` | - | | placement | Dropdown orientation | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | - | | emptyText | No data available. | `string` | 'No Data' | | loadData | Loads children asynchronously; return them or update `option.children` | `CascaderLoadData` | - | | arrowIcon | Custom arrow icon | `IconType[]` | - | ## Events | Event | Description | Signature | | ------------ | ----------------------------------------- | -------------------------------- | | change | Called when a path is selected or cleared | `(value: CascaderValue) => void` | | expandChange | Called when the expanded path changes | `(value: CascaderValue) => void` | | openChange | Called when dropdown visibility changes | `(open: boolean) => void` | ## CascaderOption When configuring the `options` data source for `Cascader`, each node must conform to the `CascaderOption` object specification. It supports infinite nesting: | Property | Description | Type | Default | | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------- | :---------- | | value | **Required.** Unique identifier for the current node (often corresponds to backend `id` or `code`). When the full path is selected, `v-model` collects an array composed of these values. | string \| number | - | | label | **Required.** Plain text content displayed to users in the dropdown menu and input box (e.g., `"Zhejiang"`, `"Hangzhou"`). | string | - | | disabled | Whether to disable the current option. When enabled, the row appears grayed out and unclickable, and all its child levels will be locked synchronously. | boolean | `false` | | children | Data source for the next-level child nodes. When this property exists and the array is not empty, a right-facing expansion arrow is automatically rendered on the component. | CascaderOption[] | `undefined` | | isLeaf | Whether this is a leaf node. Set to `false` when children can be loaded. | boolean | `undefined` | --- # Card Universal card container. ## When to Use The most basic card container, can carry text, lists, images, paragraphs, often used in backend overview pages. ## Examples [Basic Usage](./demo/basic.vue) - Set the title and icon via `title` and `icon`. [Card Size](./demo/size.vue) - Use `size` to adjust the spacing density of the card header and content. [Border](./demo/border.vue) - Use `bordered` to control whether the border is displayed. [Border and Title](./demo/notitle.vue) - Control the border with the `bordered` property and the title with the `title` property. [Cover and Meta](./demo/cover.vue?show=vertical) - Display a cover image with `cover`, and use `CardMeta` for an avatar, title, and description. [Appearance](./demo/appearance.vue) - Card shares the common `theme` and `shape` appearance system. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | title | Card title | `string` | - | | icon | Icon for the card title | `IconType[]` | - | | bordered | Whether the card displays a border | `boolean` | true | | theme | Surface theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | shape | Surface shape | `"square" \| "round"` | round | | size | Card size | `"small" \| "medium" \| "large"` | medium | | extra | Card title extension | slot | - | | cover | Card cover; hides the card header when set | `VNodeChild` | - | ## CardMeta API | Property | Description | Type | Default | | --- | --- | --- | --- | | avatar | Avatar | `VNodeChild` | - | | title | Title | `VNodeChild` | - | | description | Description | `VNodeChild` | - | --- # Card Universal card container. ## When to Use The most basic card container, can carry text, lists, images, paragraphs, often used in backend overview pages. ## Examples [Basic Usage](./demo/basic.vue) - Set the title and icon via `title` and `icon`. [Card Size](./demo/size.vue) - Use `size` to adjust the spacing density of the card header and content. [Border](./demo/border.vue) - Use `bordered` to control whether the border is displayed. [Border and Title](./demo/notitle.vue) - Control the border with the `bordered` property and the title with the `title` property. [Cover and Meta](./demo/cover.vue?show=vertical) - Display a cover image with `cover`, and use `CardMeta` for an avatar, title, and description. [Appearance](./demo/appearance.vue) - Card shares the common `theme` and `shape` appearance system. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | title | Card title | `string` | - | | icon | Icon for the card title | `IconType[]` | - | | bordered | Whether the card displays a border | `boolean` | true | | theme | Surface theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | shape | Surface shape | `"square" \| "round"` | round | | size | Card size | `"small" \| "medium" \| "large"` | medium | | extra | Card title extension | slot | - | | cover | Card cover; hides the card header when set | `VNodeChild` | - | ## CardMeta API | Property | Description | Type | Default | | --- | --- | --- | --- | | avatar | Avatar | `VNodeChild` | - | | title | Title | `VNodeChild` | - | | description | Description | `VNodeChild` | - | --- # Calendar A monthly calendar for dates and events. ## Demos [Basic](./demo/basic.vue?show=vertical) - Display events, select a date and handle event clicks. [Custom content](./demo/custom.vue?show=vertical) - Customize events, overflow content and the toolbar with slots. [Locale](./demo/locale.vue?show=vertical) - Calendar and DatePicker read the same ConfigProvider locale while allowing local overrides. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Selected date in `YYYY-MM-DD` format; supports `v-model` | `string` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `string` | - | | events | Calendar events | `CalendarEventData[]` | `[]` | | firstDayOfWeek | First weekday, where 0 is Sunday | `number` | locale | | maxEvents | Maximum visible events per day | `number` | 3 | | showToolbar | Show the calendar toolbar | `boolean` | true | | todayText | Today button text | `string` | locale | | weekdays | Labels ordered from Sunday to Saturday | `string[]` | locale | | title | Custom month title, scoped with `{ year, month }` | VNodeChild | - | | extra | Extra toolbar content | VNodeChild | - | | dateCell | Custom date-cell heading, scoped with `CalendarDateCell` | VNodeChild | - | | event | Custom event content, scoped with `{ event, cell }` | VNodeChild | - | | more | Custom overflow indicator, scoped with `{ count, cell }` | VNodeChild | - | Calendar and DatePicker do not share internal state, but both read the same `ConfigProvider locale`. DatePicker selects dates or times; Calendar presents a month and its events, so they can be used together. When a date cell is focused, use the arrow keys to move, `Home` or `End` to move within the current week, and `Enter` or Space to select. Selecting a date from an adjacent month also changes the displayed month. ### CalendarEventData | Field | Description | Type | Required | | ----- | --------------------------------- | ---------------- | -------- | | key | Unique event key | string \| number | yes | | date | Event date in `YYYY-MM-DD` format | string | yes | | title | Event title | string | yes | | time | Time text | string | no | | color | Event indicator color | string | no | ## Events | Event | Description | Callback | | ----------- | --------------------------------------------------- | ------------------------------------------------------------ | | change | Emitted when a date or the Today button is selected | `(date: string, cell: CalendarDateCell) => void` | | monthChange | Emitted when the displayed month changes | `(value: { year: number; month: number }) => void` | | eventClick | Emitted when an event is clicked | `(event: CalendarEventData, cell: CalendarDateCell) => void` | --- # FeatureCard Used to present product features, navigation entries, or capability descriptions. ## Examples [Basic Usage](./demo/basic.vue?show=vertical) - Use `icon`, `title`, and `desc` to present feature information. [Border](./demo/bordered.vue?show=vertical) - Use `bordered` to control whether the border is displayed. [Sizes](./demo/size.vue?show=vertical) - Use `size` to scale padding, icon and typography together. [Navigation entry](./demo/interactive.vue?show=vertical) - Combine `direction="vertical"` and `clickable` for a keyboard-accessible feature entry. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | icon | Icon, customizable via the named slot | `IconType[]` | - | | title | Title, customizable via the named slot | `string` | - | | desc | Description, customizable via the named slot | `string` | - | | bordered | Whether to show border | `boolean` | false | | theme | Appearance theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | shape | Card shape | `"square" \| "round"` | round | | size | Card size | `"small" \| "medium" \| "large"` | medium | | direction | Content direction | `"horizontal" \| "vertical"` | horizontal | | clickable | Enable interaction and keyboard semantics | `boolean` | false | | disabled | Disable interaction | `boolean` | false | | color | Icon accent color | `string` | primary | | iconBackground | Icon container background; derived from `color` when omitted | `string` | auto | | extra | Trailing content | VNodeChild | - | ## Events | Event | Description | Callback | | ----- | -------------------- | ----------------------------- | | click | Emitted when clicked | `(event: MouseEvent) => void` | --- # FlameWrap Draws animated flames, sparks, smoke, and heat refraction around live content. ## Browser support Full burning and refraction rely on the experimental HTML-in-Canvas API. Test it in Chrome Canary 149+ with `chrome://flags/#canvas-draw-element` enabled. Production usage requires the HTML-in-Canvas Origin Trial. Other browsers preserve the content and fall back to the outer flame effect. [Basic](./demo/basic.vue?show=vertical) - Wraps interactive content with the default cool flame. [Custom flame](./demo/custom.vue?show=vertical) - Configures warm color, sparks, smoke, and animation speed. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | color | Flame RGB values in the 0–1 range | `[number, number, number]` | `[0.31, 0.54, 1]` | | intensity | Overall brightness | `number` | `0.5` | | height | Top flame reach in px | `number` | `170` | | spread | Side and bottom glow reach | `number` | `8` | | radius | Burning outline radius | `number` | `40` | | speed | Animation speed multiplier | `number` | `0.25` | | scale | Flame detail | `number` | `0.75` | | turbulence | Turbulence amplitude | `number` | `0.5` | | turbulenceScale | Turbulence frequency | `number` | `0.5` | | turbulenceReach | Heat distortion reach | `number` | `25` | | sparks | Spark brightness; `0` disables it | `number` | `1.5` | | sparkSize | Spark size multiplier | `number` | `0.35` | | sparkDensity | Spark density multiplier | `number` | `1` | | sparkSpeed | Spark movement speed | `number` | `1` | | rim | Molten rim strength | `number` | `2.5` | | melt | Distance flames eat into the outline | `number` | `4.5` | | distortion | Heat-refraction strength | `number` | `10` | | smoke | Smoke amount | `number` | `1.5` | | ember | Ember brightness | `number` | `2` | | scorch | Charring strength | `number` | `0` | Use the default slot for content wrapped by the effect. --- # ListPanel Provides a consistent layout for filters, result summaries, list content and pagination. It can contain a Table, Kanban or card list. ## Demos [Query list](./demo/basic.vue?show=vertical) - Organize filters and result counts with `filters` and `summary`. [Toolbar actions](./demo/actions.vue?show=vertical) - Place reset, create and other list-level controls in `actions`. [Pagination and appearance](./demo/footer.vue?show=vertical) - Put pagination in `footer` and adjust appearance with `size`, `shape` and `theme`. [Bulk actions](./demo/selection.vue?show=vertical) - Replace the regular toolbar with `selection` while Table rows are selected. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | summary | Result summary, customizable via the named slot | `VNodeChild` | - | | bordered | Show border | `boolean` | true | | theme | Panel theme | `"fill" \| "outline" \| "plain"` | outline | | shape | Panel shape | `"square" \| "round"` | round | | size | Panel size | `"small" \| "medium" \| "large"` | medium | | selectedCount | Current selection count used to show bulk actions | `number` | 0 | | filters | Query controls | VNodeChild | - | | actions | Toolbar actions | VNodeChild | - | | selection | Bulk action toolbar, scoped with `{ count }` | VNodeChild | - | | footer | Pagination or footer actions | VNodeChild | - | --- # Carousel A set of rotating/carousel areas. ## When to Use - When there is a set of peer content. - When content space is insufficient, it can be accommodated in a carousel form for rotational display. - Often used for a set of image or card carousels. ## Examples [Basic Usage](./demo/basic.vue?show=vertical) - The simplest usage. You can specify the initial value via `value (v-model)`. [Vertical](./demo/vertical.vue?show=vertical) - Enable vertical mode by setting `vertical`. In this mode, left and right arrows are hidden. [Autoplay](./demo/autoplay.vue?show=vertical) - Enable timed autoplay by setting `autoplay`. Use `delay` to set the interval. The default is `3000` milliseconds. ## API Touch swiping and mouse dragging are enabled by default; set `swipeable` to `false` to disable both. Both horizontal and `vertical` modes follow the pointer. Movement below 5px is ignored. Short swipes within 300ms advance in the gesture direction; longer gestures advance when their own travel reaches half a slide or their release velocity reaches 0.5px/ms in the drag direction. Unfinished animation travel is not subtracted from the gesture distance. At most one adjacent slide is selected per gesture. Velocity also affects the decelerating settling animation. An ongoing animation can be grabbed again without waiting for it to finish. Horizontal carousels preserve vertical page scrolling; vertical carousels preserve horizontal scrolling. Inputs and buttons do not initiate dragging. | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | The index of the slide, starting from 0. Can use `v-model` for two-way binding | `number` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `number` | 0 | | loop | Whether to enable loop | `boolean` | true | | swipeable | Enable touch swiping and mouse dragging with pointer-following movement | `boolean` | true | | vertical | Whether to display in vertical mode | `boolean` | false | | autoplay | Whether to auto-switch | `boolean` | false | | delay | The time interval for auto-switching, in milliseconds | `number` | 3000 | | height | The height of the slide | `number` | 256(px) | | dots | Whether to show the dots at the bottom of the gallery | `boolean` | true | ## Events | Event | Description | Type | | --- | --- | --- | | change | Emitted when the active slide changes | `(value: number) => void` | ## Expose | Method | Description | Parameters | | ------ | ------------------------- | --------------- | | next | Go to the next slide | - | | prev | Go to the previous slide | - | | goTo | Go to the specified slide | (index: number) | --- # CarouselItem See https://k-ui.cn/components/carousel-item. --- # Checkbox Checkbox for multiple selections. ## When to Use - When making multiple selections from a set of options. - Used alone, it can represent switching between two states, similar to a switch. The difference is that switching a switch directly triggers a state change, while a checkbox is generally used for state marking and needs to cooperate with submission operations. ## Examples [Single Selection](./demo/basic.vue) - When used alone, a `v-model` value of `true` means checked, and `false` means unchecked. [Multiple Selection](./demo/group.vue) - You can use the `options` property to define options, or use child components instead. [Group Layout](./demo/group-layout.vue) - Group layout. [Disabled / Controlled](./demo/disabled.vue) - Set disabled state via `disabled`. [Select All](./demo/check-all.vue) - Select-all combination. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | checked | Checked state; supports `v-model:checked` | `boolean` | false | | label | The text to display | `string \| number` | - | | value | The value represented when used in combination | `string \| number \| boolean` | - | | disabled | Whether the current item is disabled | `boolean` | false | | readonly | Read-only; remains focusable but cannot be toggled | `boolean` | false | | indeterminate | Combined auxiliary option controls the indeterminate state | `boolean` | false | | modelValue | Standalone state bound through `v-model` | `string \| number \| boolean` | - | | theme | Component theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | valueType | The type of output value for the unit option | `"string" \| "number" \| "boolean"` | boolean | | onChange | Callback when the option state changes | `(event: CheckboxChangeEvent) => void` | - | ## CheckboxGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Selected values; supports `v-model` | `CheckboxValue[]` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `CheckboxValue[]` | [] | | disabled | Whether the component is disabled | `boolean` | false | | readonly | Whether the group is read-only | `boolean` | false | | onChange | Triggered when the option state changes, returns the currently selected item and state | `(value: CheckboxValue[]) => void` | - | | direction | Layout direction | `"horizontal" \| "vertical" \| "inline"` | horizontal | | options | Can specify child `checkbox` items | `CheckboxOption[]` | - | | theme | Component theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | size | Checkbox size | `"small" \| "medium" \| "large"` | - | Each item in `options` also supports `disabled` and `readonly`. --- # Checkbox Checkbox for multiple selections. ## When to Use - When making multiple selections from a set of options. - Used alone, it can represent switching between two states, similar to a switch. The difference is that switching a switch directly triggers a state change, while a checkbox is generally used for state marking and needs to cooperate with submission operations. ## Examples [Single Selection](./demo/basic.vue) - When used alone, a `v-model` value of `true` means checked, and `false` means unchecked. [Multiple Selection](./demo/group.vue) - You can use the `options` property to define options, or use child components instead. [Group Layout](./demo/group-layout.vue) - Group layout. [Disabled / Controlled](./demo/disabled.vue) - Set disabled state via `disabled`. [Select All](./demo/check-all.vue) - Select-all combination. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | checked | Checked state; supports `v-model:checked` | `boolean` | false | | label | The text to display | `string \| number` | - | | value | The value represented when used in combination | `string \| number \| boolean` | - | | disabled | Whether the current item is disabled | `boolean` | false | | readonly | Read-only; remains focusable but cannot be toggled | `boolean` | false | | indeterminate | Combined auxiliary option controls the indeterminate state | `boolean` | false | | modelValue | Standalone state bound through `v-model` | `string \| number \| boolean` | - | | theme | Component theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | valueType | The type of output value for the unit option | `"string" \| "number" \| "boolean"` | boolean | | onChange | Callback when the option state changes | `(event: CheckboxChangeEvent) => void` | - | ## CheckboxGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Selected values; supports `v-model` | `CheckboxValue[]` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `CheckboxValue[]` | [] | | disabled | Whether the component is disabled | `boolean` | false | | readonly | Whether the group is read-only | `boolean` | false | | onChange | Triggered when the option state changes, returns the currently selected item and state | `(value: CheckboxValue[]) => void` | - | | direction | Layout direction | `"horizontal" \| "vertical" \| "inline"` | horizontal | | options | Can specify child `checkbox` items | `CheckboxOption[]` | - | | theme | Component theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | fill | | size | Checkbox size | `"small" \| "medium" \| "large"` | - | Each item in `options` also supports `disabled` and `readonly`. --- # CheckCard Present richer choices with a title, description, and optional symbol. ## When to Use - Standalone for a toggleable boolean choice, such as accepting an agreement. - Inside `CheckCardGroup` for a single choice among multiple cards, such as an account or plan type. ## Examples [Standalone](./demo/basic.vue?show=vertical) - A standalone card can be selected and deselected. [Single-selection group](./demo/group.vue?show=vertical) - Groups use radio semantics and support arrow-key navigation. [Custom symbol](./demo/custom.vue?show=vertical) - Use the `symbol` slot to render custom content based on selection state. [Appearance and disabled](./demo/appearance.vue?show=vertical) - Themes, sizes, shapes, and disabled states. ## CheckCard API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Standalone state, supports `v-model` | `boolean` | - | | checked | Initial checked state when used independently; modelValue takes precedence. | `boolean` | false | | value | Option value inside a group | `CheckCardValue` | - | | title | Title, customizable via the named slot | `string \| number` | - | | description | Description, customizable via the named slot | `string` | - | | symbol | Symbol icon, customizable via the named slot | `IconType[]` | - | | checkedSymbol | Symbol icon used when checked | `IconType[]` | - | | showIndicator | Show the top-right selection indicator | `boolean` | true | | disabled | Disable the card | `boolean` | false | | readonly | Read-only; remains focusable but cannot be selected | `boolean` | false | | theme | Appearance theme | `"fill" \| "outline"` | outline | | size | Size | `"small" \| "medium" \| "large"` | medium | | shape | Shape | `"default" \| "circle" \| "square" \| "round"` | round | | change | Emitted when selection state changes | `(event: CheckCardChangeEvent) => void` | - | ## CheckCardGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Selected value, supports `v-model` | `CheckCardValue` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `CheckCardValue` | - | | options | Card options | `CheckCardOption[]` | - | | disabled | Disable the group | `boolean` | false | | readonly | Make the group read-only | `boolean` | false | | direction | Layout direction | `"horizontal" \| "vertical" \| "inline"` | horizontal | | theme | Card theme | `"fill" \| "outline"` | outline | | size | Card size | `"small" \| "medium" \| "large"` | medium | | shape | Card shape | `"default" \| "circle" \| "square" \| "round"` | round | | change | Emitted when the selected value changes | `(value: CheckCardValue) => void` | - | Each item in `options` also supports `disabled` and `readonly`. --- # CheckCard Present richer choices with a title, description, and optional symbol. ## When to Use - Standalone for a toggleable boolean choice, such as accepting an agreement. - Inside `CheckCardGroup` for a single choice among multiple cards, such as an account or plan type. ## Examples [Standalone](./demo/basic.vue?show=vertical) - A standalone card can be selected and deselected. [Single-selection group](./demo/group.vue?show=vertical) - Groups use radio semantics and support arrow-key navigation. [Custom symbol](./demo/custom.vue?show=vertical) - Use the `symbol` slot to render custom content based on selection state. [Appearance and disabled](./demo/appearance.vue?show=vertical) - Themes, sizes, shapes, and disabled states. ## CheckCard API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Standalone state, supports `v-model` | `boolean` | - | | checked | Initial checked state when used independently; modelValue takes precedence. | `boolean` | false | | value | Option value inside a group | `CheckCardValue` | - | | title | Title, customizable via the named slot | `string \| number` | - | | description | Description, customizable via the named slot | `string` | - | | symbol | Symbol icon, customizable via the named slot | `IconType[]` | - | | checkedSymbol | Symbol icon used when checked | `IconType[]` | - | | showIndicator | Show the top-right selection indicator | `boolean` | true | | disabled | Disable the card | `boolean` | false | | readonly | Read-only; remains focusable but cannot be selected | `boolean` | false | | theme | Appearance theme | `"fill" \| "outline"` | outline | | size | Size | `"small" \| "medium" \| "large"` | medium | | shape | Shape | `"default" \| "circle" \| "square" \| "round"` | round | | change | Emitted when selection state changes | `(event: CheckCardChangeEvent) => void` | - | ## CheckCardGroup API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Selected value, supports `v-model` | `CheckCardValue` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `CheckCardValue` | - | | options | Card options | `CheckCardOption[]` | - | | disabled | Disable the group | `boolean` | false | | readonly | Make the group read-only | `boolean` | false | | direction | Layout direction | `"horizontal" \| "vertical" \| "inline"` | horizontal | | theme | Card theme | `"fill" \| "outline"` | outline | | size | Card size | `"small" \| "medium" \| "large"` | medium | | shape | Card shape | `"default" \| "circle" \| "square" \| "round"` | round | | change | Emitted when the selected value changes | `(value: CheckCardValue) => void` | - | Each item in `options` also supports `disabled` and `readonly`. --- # Collapse Content area that can be collapsed/expanded. ## When to Use - Grouping and hiding complex areas to keep the page tidy. - 'Accordion' is a special type of collapse panel that only allows a single content area to be expanded. ## Examples [Basic Usage](./demo/basic.vue) - By default, one or multiple panels can be expanded at the same time. [Accordion](./demo/accordion.vue) - Set `accordion` to allow only one panel to be expanded at a time. [Nested Panels](./demo/nesting.vue) - Nested collapse panels. [Extra Nodes](./demo/extra.vue) - Multiple panels can be expanded simultaneously. [Simple Mode](./demo/sample.vue) - Set `sample` to display a borderless, minimal style. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | openKeys | Keys of expanded panels. Supports two-way binding with `v-model:openKeys` | `(string \| number)[]` | [] | | accordion | Whether to enable accordion mode. When enabled, at most one panel can be expanded at a time | `boolean` | false | | sample | Whether to enable simple mode | `boolean` | false | | onChange | Callback triggered when switching panels, returns the `name` of the current tab | `(key: CollapseKey) => void` | - | | theme | Appearance theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | outline | | shape | Panel shape | `"square" \| "round"` | round | ## Panel | Property | Description | Type | Default | | -------- | --------------------------------------------- | ------------------------------- | ------- | | title | Panel title | VNodeChild | - | | key | Unique panel identifier | string \| number | - | | disabled | Whether the panel is disabled | boolean | false | | extra | Extra title content | Slots | - | | onExpand | Called when the panel expansion state changes | (key: string \| number) => void | - | --- # Collapse Content area that can be collapsed/expanded. ## When to Use - Grouping and hiding complex areas to keep the page tidy. - 'Accordion' is a special type of collapse panel that only allows a single content area to be expanded. ## Examples [Basic Usage](./demo/basic.vue) - By default, one or multiple panels can be expanded at the same time. [Accordion](./demo/accordion.vue) - Set `accordion` to allow only one panel to be expanded at a time. [Nested Panels](./demo/nesting.vue) - Nested collapse panels. [Extra Nodes](./demo/extra.vue) - Multiple panels can be expanded simultaneously. [Simple Mode](./demo/sample.vue) - Set `sample` to display a borderless, minimal style. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | openKeys | Keys of expanded panels. Supports two-way binding with `v-model:openKeys` | `(string \| number)[]` | [] | | accordion | Whether to enable accordion mode. When enabled, at most one panel can be expanded at a time | `boolean` | false | | sample | Whether to enable simple mode | `boolean` | false | | onChange | Callback triggered when switching panels, returns the `name` of the current tab | `(key: CollapseKey) => void` | - | | theme | Appearance theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | outline | | shape | Panel shape | `"square" \| "round"` | round | ## Panel | Property | Description | Type | Default | | -------- | --------------------------------------------- | ------------------------------- | ------- | | title | Panel title | VNodeChild | - | | key | Unique panel identifier | string \| number | - | | disabled | Whether the panel is disabled | boolean | false | | extra | Extra title content | Slots | - | | onExpand | Called when the panel expansion state changes | (key: string \| number) => void | - | --- # ColorPickerPanel See https://k-ui.cn/components/color-picker-panel. --- # ColorPicker Freely output colors. ## When to Use - When custom colors are needed. ## Examples [Basic Usage](./demo/basic.vue) - Click to open the color panel. [Size / Disabled](./demo/size.vue) - `small` for small size, `large` for large size. [Theme and Shape](./demo/appearance.vue) - Supports `outline`, `fill`, and `plain` themes, plus `round`, `circle`, and `square` shapes. [Custom Trigger](./demo/custom-trigger.vue) - Customize the trigger for the color panel. [Popup Placement](./demo/placement.vue) - Supports 6 popup placements. If there is not enough space above, the panel will automatically appear below. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Color value, can use `v-model` for two-way binding | `string` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `string` | - | | opened | Whether the color panel is displayed by default | `boolean` | false | | mode | Color display type, provides 3 modes (`hex` , `rgb` ,`hsl`) | `"hex" \| "rgb" \| "hsl"` | 'hex' | | presets | Custom color palette | `string[]` | - | | disabledAlpha | Whether to disable transparency | `boolean` | false | | disabled | Is it in an invalid state? | `boolean` | false | | readonly | Read-only; prevents opening or changing | `boolean` | false | | trigger | Pull-down trigger mode | `"hover" \| "click"` | click | | showText | Whether to display colored text | `boolean` | false | | size | Size of the color picker | `"small" \| "medium" \| "large"` | - | | theme | Appearance theme: `outline`, `fill`, or `plain`; inherits from Form when available | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | outline | | shape | Shape: `round`, `circle`, or `square`; inherits from Form when available | `"default" \| "circle" \| "square" \| "round"` | - | | placement | Placement of the color picker | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | bottom-left | | onUpdateMode | Triggered when the color mode is updated | (mode: ColorMode) => void | - | | onChange | Triggered when the color value changes, returns the color value | `(value: string) => void` | - | | onOpenChange | Triggered when the color picker expands or collapses | `(open: boolean) => void` | - | | panelOnly | Render only the color panel without the trigger input | `boolean` | false | --- # DatePickerPanel See https://k-ui.cn/components/date-picker-panel. --- # DatePicker Control for inputting or selecting a date. ## When to Use When the user needs to input a date, they can click the standard input box to pop up a date panel for selection. ## Examples [Basic Usage](./demo/basic.vue) - Select or manually input a date. Use `v-model` for two-way data binding. [Output Type](./demo/value-type.vue) - Specify the output type via `valueType`. [Date Range](./demo/range.vue) - Supports date and time range selection. It's recommended to use `startDate` and `endDate` for values. [Disabled Dates and Times](./demo/disabled-date.vue) - Use `disabledDate` and `disabledTime` to disable selecting specific dates and times, respectively. [Disabled and Non-editable](./demo/disabled.vue) - The disabled, non-editable, and non-clearable states of the picker. [Preset Ranges](./demo/presets.vue) - You can preset common date ranges to improve user experience. [Weird Theme](./demo/theme.vue) - Strange things. [Size](./demo/size.vue) - Use `small` and `large` to set the size of the picker. [Multi-language](./demo/lang.vue) - DatePicker supports multiple languages,Default English, depending on `dayjs`. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Current date or time value | `DatePickerInput \| DatePickerInput[] \| null` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `DatePickerInput \| DatePickerInput[] \| null` | null | | startDate | Start value for range selection | `DatePickerInput \| null` | null | | endDate | End value for range selection | `DatePickerInput \| null` | null | | mode | Use the `mode` property to customize the date display type. Options: `year`, `month`, `date`, `time`, `dateTime`, `dateRange`, `dateTimeRange` | `"time" \| "date" \| "year" \| "month" \| "dateTime" \| "dateRange" \| "dateTimeRange"` | date | | disabled | Whether the component is disabled | `boolean` | false | | readonly | Read-only; prevents opening, clearing and changing | `boolean` | false | | size | Button size, optional values `small`, `large` | `"small" \| "medium" \| "large"` | - | | clearable | Whether to show the clear icon | `boolean` | true | | editable | Whether it is editable | `boolean` | true | | placeholder | Placeholder text | `string \| string[]` | - | | disabledDate | Disabled dates | `(date: Date) => boolean` | - | | disabledTime | Disabled times | `(date: Date) => boolean` | - | | format | Set the date format. When an array, supports multiple format matches, displayed according to the first one. Configuration reference http://day.js.org/ | `string` | YYYY-MM-DD | | theme | When theme='fill', presents a fill theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | - | | dateIcon | Custom icon | `IconType[]` | - | | shape | The form in which the component is presented | `"default" \| "circle" \| "square" \| "round"` | - | | bordered | Whether to display the border | `boolean` | true | | placement | Direction displayed when pulled down | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | - | | valueType | Output value type | `"string" \| "date" \| "timestamp" \| "unix"` | string | | presets | Preset dates | `DatePickerPreset[]` | - | | onChange | Callback after the value changes | `(value: DatePickerOutput \| DatePickerOutput[], text: string \| string[]) => void` | - | | onOpenChange | Triggered when the dropdown box expands or collapses | `(open: boolean) => void` | - | | onClear | Triggered when the clear button is clicked | `() => void` | - | | opened | Whether the dropdown box is displayed by default | `boolean` | false | | panelOnly | Render only the date panel without the trigger input | `boolean` | false | --- # Descriptions Display multiple read-only fields in groups. ## When to Use Commonly seen in detail page information display. ## Examples [Basic Usage](./demo/basic.vue?show=vertical) - Simple display. [Bordered](./demo/bordered.vue?show=vertical) - List with borders and background colors. [Custom Size](./demo/size.vue?show=vertical) - Customize the size to adapt to various containers. [Responsive Columns](./demo/responsive.vue?show=vertical) - Adjust the number of items per row according to the component container width. [Vertical](./demo/vertical.vue?show=vertical) - Vertical list. [Vertical Bordered](./demo/vertical-bordered.vue?show=vertical) - Vertical list with borders and background colors. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | bordered | Whether to show the border | `boolean` | false | | column | Items per row; supports responsive configuration | `DescriptionsColumn` | 3 | | extra | The operation area of the description list, displayed in the upper right corner | `string` | - | | layout | Description layout | `"horizontal" \| "vertical" \| "inline"` | horizontal | | size | List size | `"small" \| "medium" \| "large"` | large | | title | The title of the description list, displayed at the very top | `string` | - | ## Item props | Property | Description | Type | Default | | -------- | --------------------------- | ------ | ------- | | label | Description of the content | string | - | | span | number of columns displayed | number | 1 | ### Common appearance | Property | Description | Type | Default | | --- | --- | --- | --- | | shape | Description list shape | `"square" \| "round"` | round | --- # Descriptions Display multiple read-only fields in groups. ## When to Use Commonly seen in detail page information display. ## Examples [Basic Usage](./demo/basic.vue?show=vertical) - Simple display. [Bordered](./demo/bordered.vue?show=vertical) - List with borders and background colors. [Custom Size](./demo/size.vue?show=vertical) - Customize the size to adapt to various containers. [Responsive Columns](./demo/responsive.vue?show=vertical) - Adjust the number of items per row according to the component container width. [Vertical](./demo/vertical.vue?show=vertical) - Vertical list. [Vertical Bordered](./demo/vertical-bordered.vue?show=vertical) - Vertical list with borders and background colors. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | bordered | Whether to show the border | `boolean` | false | | column | Items per row; supports responsive configuration | `DescriptionsColumn` | 3 | | extra | The operation area of the description list, displayed in the upper right corner | `string` | - | | layout | Description layout | `"horizontal" \| "vertical" \| "inline"` | horizontal | | size | List size | `"small" \| "medium" \| "large"` | large | | title | The title of the description list, displayed at the very top | `string` | - | ## Item props | Property | Description | Type | Default | | -------- | --------------------------- | ------ | ------- | | label | Description of the content | string | - | | span | number of columns displayed | number | 1 | ### Common appearance | Property | Description | Type | Default | | --- | --- | --- | --- | | shape | Description list shape | `"square" \| "round"` | round | --- # Drawer A floating panel that slides in from the edge of the screen. ## When to Use - The drawer slides in from the edge of the parent window, covering part of the parent window content. Users can operate within the drawer without leaving the current task. After the operation is completed, they can smoothly return to the original task. - When an additional panel is needed to control the parent window content, this panel can be called out when needed. For example, controlling interface display styles, adding content to the interface. - When temporary tasks need to be inserted into the current task flow, creating or previewing additional content. For example, displaying terms of agreement, creating sub-objects. ## Examples [Basic Usage](./demo/basic.vue) - Use `v-model` for two-way binding to control whether the `Drawer` is displayed. If `title` is null or false, the title is not shown. [Custom](./demo/custom.vue) - Use `title` to set the title, `width` to control the width, and `placement` to control the direction. [Form Mode](./demo/with-form.vue) - Content will be presented in form mode, with a header and footer, and the footer can be customized. [Inject into Target Element](./demo/target.vue) - Can be expanded within the target element. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | modelValue | Whether the dialog is displayed, can use v-model for two-way binding. | `boolean` | - | | value | Initial value, read only on mount. Use modelValue for subsequent updates; modelValue takes precedence when both are provided. | `boolean` | false | | escKey | Whether to support closing with Esc key | `boolean` | true | | maskClosable | Whether clicking the mask allows closing | `boolean` | true | | title | Drawer title | `string` | Title | | width | Drawer width, used when `placement` is `left` or `right`, supports percentage | `string \| number` | 520 | | height | Drawer height, used when `placement` is `top` or `bottom`, supports percentage | `string \| number` | 520 | | placement | The display direction of the drawer. Provides 4 display methods: `left`, `top`, `right`, `bottom` | `"top" \| "bottom" \| "left" \| "right"` | right | | footer | Whether to show the footer; the slot with the same name customizes its content | `boolean` | true | | closable | Whether to show the close button | `boolean` | true | | target | Display container; accepts a native element or component ref | `(() => HTMLElement \| ComponentPublicInstance \| null \| undefined)` | () => document.body | | okText | OK button text | `string` | OK | | cancelText | Cancel button text | `string` | Cancel | | mask | Whether to show the mask | `boolean` | true | | loading | When set to `true`, the confirm button will be in a loading state | `boolean` | false | | onOk | Callback when OK is clicked | `() => void` | - | | onClose | Callback when the drawer closes | `() => void` | - | | onCancel | Callback when Cancel is clicked | `() => void` | - | | onOpenChange | Callback for opening or closing the drawer | `(visible: boolean) => void` | - | --- # Dropdown A list that drops down. ## When to Use When there are too many operation commands on the page, this component can be used to accommodate operation elements. Clicking or hovering over the trigger point will display a dropdown menu. Selections can be made in the list, and corresponding commands can be executed. ## Examples [Basic Usage](./demo/basic.vue) - The simplest dropdown menu. [Right-click menu](./demo/right-menu.vue?show=vertical) - By default, the menu is triggered by hovering, but it can also be triggered by clicking the right mouse button. [Button with a dropdown menu](./demo/dropdown-buttons.vue) - On the left is the button, and on the right is an additional related function menu. The icon property can be set to modify the icon on the right. [Other Elements](./demo/divider.vue) - Dividers and disabled menu items. [Popup Position](./demo/placement.vue) - Supports 6 popup positions. [Arrow](./demo/arrow.vue) - Set `arrow` to display an arrow pointing to the trigger. [Multi-level Menu](./demo/cascading.vue) - The passed menu has multiple levels. ## Dropdown API | Property | Description | Type | Default | | --- | --- | --- | --- | | show | Whether the dropdown is visible (v-model) | `boolean` | false | | trigger | Trigger method | `"hover" \| "click" \| "contextmenu"` | `hover` | | placement | Dropdown placement | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | `bottom-left` | | arrow | Whether to display the arrow | `boolean` | false | | target | Ref of an external trigger element or component | `Ref` | - | | disabled | Whether triggering is disabled | `boolean` | false | | onOpenChange | Called when the dropdown opens or closes | `(open: boolean) => void` | - | | overlay slot | Dropdown overlay content | VNodeChild | - | ### DropdownButton API | Property | Description | Type | Default | | --- | --- | --- | --- | | size | Button size | `"small" \| "medium" \| "large"` | - | | shape | Button shape | `"default" \| "circle" \| "square" \| "round"` | - | | disabled | Whether the button is disabled | `boolean` | false | | icon | Custom dropdown trigger icon | `IconType[]` | Ellipsis | | theme | Button theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | - | | arrow | Whether to display the dropdown arrow | `boolean` | false | | placement | Dropdown placement | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | `bottom-right` | | onClick | Triggered when the main button is clicked | `(event: MouseEvent) => void` | - | --- # Dropdown A list that drops down. ## When to Use When there are too many operation commands on the page, this component can be used to accommodate operation elements. Clicking or hovering over the trigger point will display a dropdown menu. Selections can be made in the list, and corresponding commands can be executed. ## Examples [Basic Usage](./demo/basic.vue) - The simplest dropdown menu. [Right-click menu](./demo/right-menu.vue?show=vertical) - By default, the menu is triggered by hovering, but it can also be triggered by clicking the right mouse button. [Button with a dropdown menu](./demo/dropdown-buttons.vue) - On the left is the button, and on the right is an additional related function menu. The icon property can be set to modify the icon on the right. [Other Elements](./demo/divider.vue) - Dividers and disabled menu items. [Popup Position](./demo/placement.vue) - Supports 6 popup positions. [Arrow](./demo/arrow.vue) - Set `arrow` to display an arrow pointing to the trigger. [Multi-level Menu](./demo/cascading.vue) - The passed menu has multiple levels. ## Dropdown API | Property | Description | Type | Default | | --- | --- | --- | --- | | show | Whether the dropdown is visible (v-model) | `boolean` | false | | trigger | Trigger method | `"hover" \| "click" \| "contextmenu"` | `hover` | | placement | Dropdown placement | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | `bottom-left` | | arrow | Whether to display the arrow | `boolean` | false | | target | Ref of an external trigger element or component | `Ref` | - | | disabled | Whether triggering is disabled | `boolean` | false | | onOpenChange | Called when the dropdown opens or closes | `(open: boolean) => void` | - | | overlay slot | Dropdown overlay content | VNodeChild | - | ### DropdownButton API | Property | Description | Type | Default | | --- | --- | --- | --- | | size | Button size | `"small" \| "medium" \| "large"` | - | | shape | Button shape | `"default" \| "circle" \| "square" \| "round"` | - | | disabled | Whether the button is disabled | `boolean` | false | | icon | Custom dropdown trigger icon | `IconType[]` | Ellipsis | | theme | Button theme | `"default" \| "fill" \| "outline" \| "plain" \| "solid" \| "dashed" \| "underlined"` | - | | arrow | Whether to display the dropdown arrow | `boolean` | false | | placement | Dropdown placement | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right"` | `bottom-right` | | onClick | Triggered when the main button is clicked | `(event: MouseEvent) => void` | - | --- # Divider Dividing line that separates content. ## When to Use - To separate text paragraphs of different chapters. - To separate inline text/links, such as the action column in a table. ## Examples [Vertical Divider](./demo/basic.vue) - Use type="vertical" to set an inline vertical divider. [Horizontal Divider](./demo/default.vue) - Default is a horizontal divider, with text that can be added in the middle. [Divider with Text](./demo/with-text.vue) - A divider with text in the middle, where `orientation` can specify the text position. ## API | Parameter | Description | Type | Default | | --- | --- | --- | --- | | text | Divider text | `string` | - | | dashed | Whether it is a dashed line | `boolean` | false | | orientation | The position of the divider title : left right | `"left" \| "right" \| "center"` | center | | type | Horizontal or vertical type: horizontal vertical | `"horizontal" \| "vertical" \| "inline"` | horizontal | --- # Empty Placeholder display for empty states. ## When to Use - When there is currently no data, used for explicit user prompts. - Guiding the creation process during initialization scenarios. ## Examples [Basic Usage](./demo/basic.vue) - Simple display. [Custom](./demo/custom.vue) - Customize the image, description, and extra content. [Default Display](./demo/used.vue) - Will be displayed by default in the above components. [No Description](./demo/nodesc.vue) - Display without description. ## API | Property | Description | Type | Default | | --- | --- | --- | --- | | description | Custom description content; set to `false` to hide it | `string \| boolean` | - | | imageStyle | Image style | `CSSProperties` | - | | image | Set the display image. When a string, it represents a custom image address | `string` | - | --- # Form A form with data collection, validation, and submission functions, including checkboxes, radio buttons, input fields, dropdown selectors, and other elements. ## When to Use - Used to create an entity or collect information. - When input data types need to be validated. ## Examples In `Modal` or `Drawer`, if you need to reset the form when opening the Modal or Drawer, please use asynchronous methods: ```javascript // The component is not fully rendered before opening, reading the dom object is undefined at this time, // The child component is not fully rendered, this.$refs.form is undefined, so it cannot be reset. // Use asynchronous method. // Of course, you can also reset the form when Modal or Drawer @close. export default { methods: { open() { this.visible = true; // Open the modal first this.reset(); }, close() { this.reset(); this.visible = false; // Close the modal after }, reset() { this.$nextTick(() => { this.$refs.form.reset(); }); // or setTimeout(() => { this.$refs.form.reset(); }, 0); }, }, }; ``` [Typical Form](./demo/basic.vue?show=vertical) - Includes various form items, such as input fields, selectors, switches, radio buttons, checkboxes, etc. [Alignment](./demo/align.vue?show=vertical) - Choose the best label alignment based on specific goals and constraints. [Form Validation](./demo/valid.vue?show=vertical) - Help users discover and correct errors as early as possible, while preventing mistakes. [Auxiliary Validation](./demo/length.vue?show=vertical) - Validate certain data types. [Multi-form Linkage](./demo/withmodal.vue?show=vertical) - Outside the Form, submit the form via `submit` from the outside. Conversely, it's recommended to use `