# Cedar Design Web > Vue 3 component library. Package: @cedar-design/ui. Component prefix: C / c-. Read the quick start and the relevant component page before generating code. Follow the documented props, events, slots, imports and styles. Do not substitute APIs from another component library. Documentation language: en-US. --- Document: llms/en-US/components/affix.md # Affix The same scenarios, parameters and interactions as Cedar. Only component prefixes differ; themes and site shells remain independent. ## Basic examples ### Basic usage Example source: src/affix/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Affix direction, offset and container #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `target` | Scroller or selector; finds nearest scrolling ancestor when omitted, falling back to window | Affix direction, offset and container | | `offset-top` | Distance from the scroll container top; accepts CSS lengths | Affix direction, offset and container | | `offset-bottom` | Distance from the bottom; takes precedence over offset-top, including 0 | Affix direction, offset and container | Scroll each bordered area separately to compare top/bottom affixing and offsets within an explicit scroll container. Example source: src/affix/__demos__/offset-container-comparison.vue ```vue ``` ## Interaction and control ### Change event #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `target` | Scroller or selector; finds nearest scrolling ancestor when omitted, falling back to window | Change event, Disabled, CSS mode and manual update | | `offset-top` | Distance from the scroll container top; accepts CSS lengths | Change event, Disabled, CSS mode and manual update | | `disabled` | Disable affixing | Disabled, CSS mode and manual update | | `css-mode` | Use native position: sticky, subject to ancestor overflow and container boundaries | Disabled, CSS mode and manual update | | `z-index` | Stacking level | Disabled, CSS mode and manual update | Example source: src/affix/__demos__/fix-change.vue ```vue ``` ### Disabled, CSS mode and manual update Example source: src/affix/__demos__/controls.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | offset-top | Distance from the scroll container top; accepts CSS lengths | `number / string` | `0` | | offset-bottom | Distance from the bottom; takes precedence over offset-top, including 0 | `number / string` | `undefined` | | target | Scroller or selector; finds nearest scrolling ancestor when omitted, falling back to window | `string / HTMLElement / Window` | `undefined` | | target-container | Extra outer scroller to listen to; omitted means no extra listener, and it is not a clipping boundary | `string / HTMLElement / Window` | `undefined` | | z-index | Stacking level | `number / string` | `10` | | disabled | Disable affixing | `boolean` | `false` | | css-mode | Use native position: sticky, subject to ancestor overflow and container boundaries | `boolean` | `false` | ### Events | Event | Arguments and timing | | --- | --- | | change | `(fixed: boolean, offset: number)`, emitted when the fixed state changes. While fixed, offset is the affix threshold; otherwise it is the distance to the corresponding container edge. Disabling affixing reports 0. | ### Slots | Slot | Description | Arguments | | --- | --- | --- | | default | Content to affix | — | ### Methods | Method | Description | Arguments | Returns | | --- | --- | --- | --- | | updatePosition | Rebind scrollers and recalculate on the next animation frame | — | `Promise` | ### Platform notes Props, event arguments, slots and public methods match across platforms. CSS mode follows browser sticky rules; examples use independent scroll containers. ### Type definitions The component exports the following types ```ts import type { AffixInstance } from '@cedar-design/ui' ``` `change` reports state transitions, so remeasuring an already fixed item does not repeat `true`; disabling a fixed item reports `false, 0`. Viewport units are reevaluated during measurement. CSS mode passes valid lengths to native sticky positioning; JS mode resolves numbers, numeric strings, px, rem, vw, vh, vmin and vmax. The target controls observation and JS measurement; native sticky remains constrained by actual CSS ancestors. Pending `updatePosition()` work cannot rebind a deactivated or replaced activation generation. --- Document: llms/en-US/components/alert.md # Alert Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/alert/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison Choose an axis to compare its available values with the same content and model. Other settings remain unchanged while comparing. Example source: src/alert/__demos__/appearance-lab.vue ```vue ``` ## Content and presentation ### Title, alignment and banners #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Alert title | Title, alignment and banners, Action | | `status` | Alert status | Title, alignment and banners, Show Icon | | `center` | Whether to center the content | Title, alignment and banners | | `banner` | Whether to display a top banner without borders or rounded corners | Title, alignment and banners | | `show-icon` | Whether to show an icon | Show Icon | | `closable` | Whether to show the close button | Action | Compare title hierarchy, centered content and page-wide banners. Actions and dismiss behavior have separate examples. Example source: src/alert/__demos__/content-comparison.vue ```vue ``` ### Show Icon - `status`: Selects the semantic state. Example source: src/alert/__demos__/show-icon.vue ```vue ``` ### Action Example source: src/alert/__demos__/action.vue ```vue ``` ## Customization and slots ### Custom Icon - `status`: Selects the semantic state. Example source: src/alert/__demos__/custom-icon.vue ```vue ``` ## Interaction and control ### Dismiss controls and custom icons #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `closable` | Whether to show the close button | Dismiss controls and custom icons | | `status` | Alert status | Dismiss controls and custom icons | Operate the default and custom dismiss controls to compare the same dismissal behavior. Example source: src/alert/__demos__/dismiss-comparison.vue ```vue ``` ## API ### `` Props | Prop | Description | Type | Default | | --------- | --------------------------------------------------------------------- | --------------------------------------------------- | ------------ | | status | Alert status | `'info' \| 'success' \| 'warning' \| 'danger' \| 'default'` | `'info'` | | variant | Visual variant | `'standard' \| 'tonal' \| 'outline'` | `'standard'` | | color | Custom background color; overrides the background derived from type | `string` | - | | title | Alert title | `string` | - | | message | Content text; the default slot can also supply it | `string` | - | | show-icon | Whether to show an icon | `boolean` | `true` | | closable | Whether to show the close button | `boolean` | `false` | | banner | Whether to display a top banner without borders or rounded corners | `boolean` | `false` | | center | Whether to center the content | `boolean` | `false` | | elevation | Elevation: `true`, `false`, or a level from `0-24` | `boolean \| number` | `false` | ### `` Events | Event | Description | Arguments | | ----------- | ------------------ | ----------------------------- | | close | Triggered when the Close button is clicked and can only be used when the Close button is displayed | `(event: MouseEvent) => void` | | closed | Emitted after close transition | - | ### `` Slots | Slot | Description | Arguments | | ---------- | -------- | ---- | | default | Content | - | | icon | Icon | - | | title | Title | - | | action | Actions | - | | close-icon | The close icon of alert | - | ### Type definitions The component exports the following types: ```ts import type { AlertInstance, AlertProps, AlertStatus, AlertVariant, } from '@cedar-design/ui' ``` ### Style variables See `style/token.less`; all variables use the `--c-alert-` prefix. Example override: ```css :root { --c-alert-padding-vertical: 12px; --c-alert-padding-horizontal: 20px; } ``` ## Migration notes (breaking changes) | Previous API | Current API | | -- | -- | | `type="error"` | `type="danger"` | | `type="normal"` | `type="default"` | | `closeable` | `closable` | | `#close-element` slot | `#close-icon` slot | Added capabilities: `variant` / `color` / `elevation` / `default` status / `closed` event. `type="default"` renders no built-in icon. Use `#icon` when an icon is needed. ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. The close button supports keyboard activation. close fires once, and closed fires after the leave transition. Maple renamed its internal __close-icon class to __close-btn. Default icons are adapted locally in each library. ### Complete variable defaults Colored titles, content, icons and outline borders use readable system content colors. standard and tonal share the same level-1 background; standard adds a subtle decorative border. Default titles use content-primary; body text and icons use content-secondary. The content variable also sets the root inherited color, used by close icons and actions without an explicit color. Maple dark mode inherits these colors while retaining its geometry overrides: 16px padding, 22px icons, 12px icon/close gaps and 1.5 body line height. color changes only the background; callers must also verify foreground contrast. The table lists :root defaults, not theme overrides. | Variable | Default | | --- | --- | | `--c-alert-padding-vertical` | `var(--c-sys-space-4)` | | `--c-alert-padding-horizontal` | `var(--c-sys-space-6)` | | `--c-alert-padding-vertical-with-title` | `var(--c-sys-space-6)` | | `--c-alert-padding-horizontal-with-title` | `var(--c-sys-space-6)` | | `--c-alert-border-radius` | `var(--c-sys-radius-md)` | | `--c-alert-border-width` | `1px` | | `--c-alert-font-size-content` | `var(--c-sys-font-size-md)` | | `--c-alert-font-size-title` | `var(--c-sys-font-size-lg)` | | `--c-alert-font-weight-title` | `var(--c-sys-font-weight-medium)` | | `--c-alert-line-height` | `1.5715` | | `--c-alert-line-height-title` | `1.5` | | `--c-alert-title-margin-bottom` | `var(--c-sys-space-2)` | | `--c-alert-icon-size` | `16px` | | `--c-alert-icon-margin-right` | `var(--c-sys-space-4)` | | `--c-alert-action-margin-left` | `var(--c-sys-space-5)` | | `--c-alert-close-margin-left` | `var(--c-sys-space-4)` | | `--c-alert-standard-info-bg` | `rgb(var(--c-blue-1))` | | `--c-alert-standard-info-border` | `rgb(var(--c-blue-3))` | | `--c-alert-standard-info-title` | `var(--c-sys-color-content-info)` | | `--c-alert-standard-info-content` | `var(--c-sys-color-content-info)` | | `--c-alert-standard-info-icon` | `var(--c-sys-color-content-info)` | | `--c-alert-standard-success-bg` | `rgb(var(--c-success-1))` | | `--c-alert-standard-success-border` | `rgb(var(--c-success-3))` | | `--c-alert-standard-success-title` | `var(--c-sys-color-content-success)` | | `--c-alert-standard-success-content` | `var(--c-sys-color-content-success)` | | `--c-alert-standard-success-icon` | `var(--c-sys-color-content-success)` | | `--c-alert-standard-warning-bg` | `rgb(var(--c-warning-1))` | | `--c-alert-standard-warning-border` | `rgb(var(--c-warning-3))` | | `--c-alert-standard-warning-title` | `var(--c-sys-color-content-warning)` | | `--c-alert-standard-warning-content` | `var(--c-sys-color-content-warning)` | | `--c-alert-standard-warning-icon` | `var(--c-sys-color-content-warning)` | | `--c-alert-standard-danger-bg` | `rgb(var(--c-danger-1))` | | `--c-alert-standard-danger-border` | `rgb(var(--c-danger-3))` | | `--c-alert-standard-danger-title` | `var(--c-sys-color-content-danger)` | | `--c-alert-standard-danger-content` | `var(--c-sys-color-content-danger)` | | `--c-alert-standard-danger-icon` | `var(--c-sys-color-content-danger)` | | `--c-alert-standard-default-bg` | `var(--c-color-fill-2)` | | `--c-alert-standard-default-border` | `var(--c-sys-color-border-default)` | | `--c-alert-standard-default-title` | `var(--c-sys-color-content-primary)` | | `--c-alert-standard-default-content` | `var(--c-sys-color-content-secondary)` | | `--c-alert-standard-default-icon` | `var(--c-sys-color-content-secondary)` | | `--c-alert-tonal-info-bg` | `rgb(var(--c-blue-1))` | | `--c-alert-tonal-info-title` | `var(--c-sys-color-content-info)` | | `--c-alert-tonal-info-content` | `var(--c-sys-color-content-info)` | | `--c-alert-tonal-info-icon` | `var(--c-sys-color-content-info)` | | `--c-alert-tonal-success-bg` | `rgb(var(--c-success-1))` | | `--c-alert-tonal-success-title` | `var(--c-sys-color-content-success)` | | `--c-alert-tonal-success-content` | `var(--c-sys-color-content-success)` | | `--c-alert-tonal-success-icon` | `var(--c-sys-color-content-success)` | | `--c-alert-tonal-warning-bg` | `rgb(var(--c-warning-1))` | | `--c-alert-tonal-warning-title` | `var(--c-sys-color-content-warning)` | | `--c-alert-tonal-warning-content` | `var(--c-sys-color-content-warning)` | | `--c-alert-tonal-warning-icon` | `var(--c-sys-color-content-warning)` | | `--c-alert-tonal-danger-bg` | `rgb(var(--c-danger-1))` | | `--c-alert-tonal-danger-title` | `var(--c-sys-color-content-danger)` | | `--c-alert-tonal-danger-content` | `var(--c-sys-color-content-danger)` | | `--c-alert-tonal-danger-icon` | `var(--c-sys-color-content-danger)` | | `--c-alert-tonal-default-bg` | `var(--c-color-fill-2)` | | `--c-alert-tonal-default-title` | `var(--c-sys-color-content-primary)` | | `--c-alert-tonal-default-content` | `var(--c-sys-color-content-secondary)` | | `--c-alert-tonal-default-icon` | `var(--c-sys-color-content-secondary)` | | `--c-alert-outline-info-border` | `var(--c-sys-color-content-info)` | | `--c-alert-outline-info-title` | `var(--c-sys-color-content-info)` | | `--c-alert-outline-info-content` | `var(--c-sys-color-content-info)` | | `--c-alert-outline-info-icon` | `var(--c-sys-color-content-info)` | | `--c-alert-outline-success-border` | `var(--c-sys-color-content-success)` | | `--c-alert-outline-success-title` | `var(--c-sys-color-content-success)` | | `--c-alert-outline-success-content` | `var(--c-sys-color-content-success)` | | `--c-alert-outline-success-icon` | `var(--c-sys-color-content-success)` | | `--c-alert-outline-warning-border` | `var(--c-sys-color-content-warning)` | | `--c-alert-outline-warning-title` | `var(--c-sys-color-content-warning)` | | `--c-alert-outline-warning-content` | `var(--c-sys-color-content-warning)` | | `--c-alert-outline-warning-icon` | `var(--c-sys-color-content-warning)` | | `--c-alert-outline-danger-border` | `var(--c-sys-color-content-danger)` | | `--c-alert-outline-danger-title` | `var(--c-sys-color-content-danger)` | | `--c-alert-outline-danger-content` | `var(--c-sys-color-content-danger)` | | `--c-alert-outline-danger-icon` | `var(--c-sys-color-content-danger)` | | `--c-alert-outline-default-border` | `var(--c-sys-color-border-default)` | | `--c-alert-outline-default-title` | `var(--c-sys-color-content-primary)` | | `--c-alert-outline-default-content` | `var(--c-sys-color-content-secondary)` | | `--c-alert-outline-default-icon` | `var(--c-sys-color-content-secondary)` | ### Motion variables Built-in motion follows `prefers-reduced-motion: reduce`. Reduced motion does not prevent loading-state or close-event updates. | Token | Default | | --- | --- | | `--c-alert-close-duration` | `var(--c-sys-motion-duration-slow)` | --- Document: llms/en-US/components/anchor.md # Anchor Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `show-background`: Whether to show the background Example source: src/anchor/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Affix Preview configuration: `:offsetTop="80"`, `href="#basic"`, `href="#show-line"`, `href="#affix"`. Example source: src/anchor/__demos__/affix.vue ```vue ``` ## Content and presentation ### Show Line #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `show-line` | Whether to show the left axis | Show Line | | `change-hash` | Whether to change the hash. When set to `false`, clicking on the anchor will not change the hash of the page | Hash | - `show-line`: Whether to show the left axis Example source: src/anchor/__demos__/show-line.vue ```vue ``` ### Hash - `change-hash`: Whether to change the hash. When set to `false`, clicking on the anchor will not change the hash of the page Example source: src/anchor/__demos__/hash.vue ```vue ``` ## Lifecycle and edge cases ### Boundary - `boundary`: Scrolling boundary value. After setting the value to a number, it will stop scrolling when the distance is `boundary` from the scrolling container. Example source: src/anchor/__demos__/boundary.vue ```vue ``` ### Scroll Lifecycle Example source: src/anchor/__demos__/scroll-lifecycle.vue ```vue ``` ## Reading direction The axis, highlight and indentation follow reading start. Vertical scrolling and anchor targets remain unchanged. ## API ### `` Props | Parameter | Description | Type | Default | | ---------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------- | :-------: | | boundary | Scrolling `boundary` value. After setting the value to a number, it will stop scrolling when the distance is `boundary` from the scrolling container. | `'start' \| 'end' \| 'center' \| 'nearest' \| number` | `'start'` | | show-line | Whether to show the left axis | `boolean` | `true` | | show-background | Whether to show the background | `boolean` | `true` | | scroll-container | Scroll container | `string \| HTMLElement \| Window` | `-` | | change-hash | Whether to change the hash. When set to `false`, clicking on the anchor will not change the hash of the page | `boolean` | `true` | ### `` Events | Event | Description | Arguments | | ------ | ------------------ | ------------------------------------------------ | | select | Emitted when the user clicks a link | hash: `string \| undefined`
preHash: `string` | | change | Emitted when the active link changes | hash: `string` | ### `` Props | Parameter | Description | Type | Default | | ------ | ------------------ | -------- | :----: | | title | Anchor link text | `string` | `-` | | href | Anchor link URL | `string` | `-` | ### Type definitions The component exports the following types ```ts import type { AnchorInstance } from '@cedar-design/ui' ``` --- Document: llms/en-US/components/auto-complete.md # AutoComplete Text input with suggested completions. Suggestions are arrays; application code owns remote loading. ## Reading direction The editor and suggestion popup inherit source dir, including in custom containers. Horizontal caret keys keep native editing behavior; vertical keys navigate candidates, Enter selects and Escape closes. Candidate updates preserve the native composition buffer until composition ends instead of repainting the previous model value. ## Search and visibility case-sensitive replaces the removed strict prop. Default matching searches label and ignores case; use search-fields to include value. Custom filter-option callbacks own their case policy; filter-option=false bypasses local filtering for remote results. AutoComplete has no public open/defaultOpen/update:open API: focusing and typing determine suggestion visibility. trigger-props can customize placement but cannot force internal open state. A public v-model:open would require a separate API change. ## Basic examples ### Basic Example source: src/auto-complete/__demos__/basic.vue ```vue ``` ### Interaction state comparison Toggle disabled, read-only and error states, then interact with the same instance. Recovery controls remain outside the target; error appearance alone does not validate data.
Configuration details and limits #### State Lab ## Appearance and states ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------------------------------------------ | ----------------------------------- | | `options` | Suggestions, including groups; unique values become strings on selection | Appearance configuration comparison | | `clearable` | Allow clearing a nonempty editable value | Appearance configuration comparison | Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/auto-complete/__demos__/appearance-lab.vue ```vue ``` ## Matching and suggestions ### Opening Policy #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ---------------- | ------------------------------------------------------------------------ | --------------------------------------------- | | `options` | Suggestions, including groups; unique values become strings on selection | Opening Policy, Case Sensitive, Group Spacing | | `placeholder` | Placeholder or floating hint text | Opening Policy, Case Sensitive, Group Spacing | | `should-open` | Opening policy; does not filter candidates | Opening Policy, Group Spacing, Virtual List | | `filter-option` | Filter by label; false for remote filtering | Opening Policy | | `case-sensitive` | Case-sensitive built-in matching | Case Sensitive | | `trigger-props` | Trigger configuration; cannot override owned opening and disabled state | Group Spacing | Example source: src/auto-complete/__demos__/opening-policy.vue ```vue ``` ### Case Sensitive Example source: src/auto-complete/__demos__/case-sensitive.vue ```vue ``` ### Group Spacing Example source: src/auto-complete/__demos__/group-spacing.vue ```vue ``` ### Virtual List Example source: src/auto-complete/__demos__/virtual-list.vue ```vue ``` ## Content and field customization ### Footer #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------------------------------------------ | ----------------- | | `options` | Suggestions, including groups; unique values become strings on selection | Footer, Decorator | | `placeholder` | Placeholder or floating hint text | Footer, Decorator | | `field-names` | Map value, label, disabled and other fields | Footer | | `variant` | Input variant; inherits Group when unset | Decorator | | `hint` | Enable Input floating hint | Decorator | | `clearable` | Allow clearing a nonempty editable value | Decorator | Example source: src/auto-complete/__demos__/footer.vue ```vue ``` ### Decorator Example source: src/auto-complete/__demos__/decorator.vue ```vue ``` ## Interaction and keyboard ### Api Review #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------------------------------------------ | ------------------------- | | `options` | Suggestions, including groups; unique values become strings on selection | Api Review, Accessibility | | `clearable` | Allow clearing a nonempty editable value | Api Review | | `disabled` | Disabled; inherited when unset, explicit false overrides | Api Review | | `readonly` | Readonly; focus/copy allowed, suggestions stay closed | Api Review | | `error` | Error state; inherits FormItem when unset | Api Review | | `input-attrs` | Native input attributes; combobox state is owned by the component | Accessibility |
Example source: src/auto-complete/__demos__/state-lab.vue ```vue ``` ### Accessibility Example source: src/auto-complete/__demos__/accessibility.vue ```vue ``` ## Async data and configuration ### Remote #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ------------------------------------------------------------------------ | --------------------------- | | `options` | Suggestions, including groups; unique values become strings on selection | Remote, Passthrough Options | | `filter-option` | Filter by label; false for remote filtering | Remote | | `placeholder` | Placeholder or floating hint text | Remote | | `disabled` | Disabled; inherited when unset, explicit false overrides | Passthrough Options | | `should-open` | Opening policy; does not filter candidates | Passthrough Options | | `trigger-props` | Trigger configuration; cannot override owned opening and disabled state | Passthrough Options | Example source: src/auto-complete/__demos__/remote.vue ```vue ``` ### Passthrough Options Example source: src/auto-complete/__demos__/passthrough-options.vue ```vue ``` ### Props | Prop | Description | Type | Default | | -------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------------- | | `model-value` | Controlled text | `string` | `—` | | `default-value` | Initial uncontrolled text | `string` | `''` | | `options` | Suggestions, including groups; unique values become strings on selection | `(AutoCompleteOption \| SelectOptionGroup)[]` / `(query, { signal }) => Array / Promise` | `undefined` | | `field-names` | Map value, label, disabled and other fields | `AutoCompleteFieldNames` | `—` | | `should-open` | Opening policy; does not filter candidates | `(value: string) => boolean` | `value.length > 0` | | `filter-option` | Filter by label; false for remote filtering | `AutoCompleteFilterOption` | automatic: arrays on; loader off | | `case-sensitive` | Case-sensitive built-in matching | `boolean` | `false` | | `popup-container` | Popup container; same contract as Trigger | `PopupContainer` | `—` | | `trigger-props` | Trigger configuration; cannot override owned opening and disabled state | `TriggerProps` | `—` | | `virtual-list-props` | Enable and configure virtual scrolling | `VirtualListProps` | `—` | | `size` | Five sizes; inherit Group / Form / global configuration when unset | `xs \| sm \| md \| lg \| xl` | `md` | | `variant` | Input variant; inherits Group when unset | `filled \| outline \| standard` | `outline` | | `disabled` | Disabled; inherited when unset, explicit false overrides | `boolean` | `undefined` | | `readonly` | Readonly; focus/copy allowed, suggestions stay closed | `boolean` | `undefined` | | `error` | Error state; inherits FormItem when unset | `boolean` | `undefined` | | `clearable` | Allow clearing a nonempty editable value | `boolean` | `false` | | `placeholder` | Placeholder or floating hint text | `string` | `—` | | `hint` | Enable Input floating hint | `boolean` | `undefined` | | `line` | Show border or underline | `boolean` | `true` | | `text-color` | Instance text color | `string` | `—` | | `focus-color` | Instance focus color | `string` | `—` | | `blur-color` | Instance unfocused hint color | `string` | `—` | | `enterkeyhint` | Virtual keyboard action hint | `InputHTMLAttributes['enterKeyHint']` | `—` | | `aria-label` | Accessible input name | `string` | `—` | | `max-length` | Same length normalization for typing and selecting | `number \| { length: number; errorOnly?: boolean }` | `0` | | `show-word-limit` | Display word count | `boolean` | `false` | | `word-length` | Custom length calculation | `(value: string) => number` | `—` | | `word-slice` | Custom slicing | `(value: string, maxLength: number) => string` | `—` | | `input-attrs` | Native input attributes; combobox state is owned by the component | `Record` | `—` | ### Events | Event | Arguments | | ----------------------------------------- | ------------------------------------------------------------- | | `update:model-value` | `value: string` | | `input / search / change` | `value: string, event: Event` | | `select` | `value: string, option: AutoCompleteOptionInfo, event: Event` | | `clear` | `event: Event` | | `focus / blur` | `event: FocusEvent` | | `dropdown-scroll / dropdown-reach-bottom` | `event: Event` | ### Slots | Slot | Description | | ----------------- | ---------------------------------- | | `option` | `{ data: AutoCompleteOptionInfo }` | | `footer` | Menu footer | | `prefix / suffix` | Input prefix / suffix | | `clear-icon` | `{ clear }` | ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## API details | Token | Default | | ----------------------------------------------- | --------------------------------------------------- | | `--c-auto-complete-popup-max-height` | `var(--c-select-popup-max-height)` | | `--c-auto-complete-popup-bg` | `var(--c-select-popup-bg)` | | `--c-auto-complete-popup-border-radius` | `var(--c-select-popup-border-radius)` | | `--c-auto-complete-popup-padding-vertical` | `var(--c-select-popup-padding-vertical)` | | `--c-auto-complete-popup-font-size` | `var(--c-select-popup-font-size)` | | `--c-auto-complete-popup-border-color` | `var(--c-select-popup-border-color)` | | `--c-auto-complete-popup-box-shadow` | `var(--c-select-popup-box-shadow)` | | `--c-auto-complete-option-height` | `var(--c-select-popup-option-height)` | | `--c-auto-complete-option-font-weight-selected` | `var(--c-select-popup-option-font-weight-selected)` | | `--c-auto-complete-option-padding-horizontal` | `var(--c-select-popup-option-padding-horizontal)` | | `--c-auto-complete-option-bg-default` | `var(--c-select-popup-option-bg)` | | `--c-auto-complete-option-bg-hover` | `var(--c-select-popup-option-bg-hover)` | | `--c-auto-complete-option-bg-selected` | `var(--c-select-popup-option-bg-selected)` | | `--c-auto-complete-option-bg-disabled` | `var(--c-select-popup-option-bg-disabled)` | | `--c-auto-complete-option-text-color-default` | `var(--c-select-popup-option-text-color)` | | `--c-auto-complete-option-text-color-hover` | `var(--c-select-popup-option-text-color-hover)` | | `--c-auto-complete-option-text-color-selected` | `var(--c-select-popup-option-text-color-selected)` | | `--c-auto-complete-option-text-color-disabled` | `var(--c-select-popup-option-text-color-disabled)` | ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Prop | Description | Type | Default | | -------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `model-value` | Controlled text | `string` | `—` | | `default-value` | Initial uncontrolled text | `string` | `''` | | `options` | Suggestions, including groups; unique values become strings on selection | `(AutoCompleteOption \| SelectOptionGroup)[]` / `(query, { signal }) => Array / Promise` | `undefined` | | `field-names` | Map value, label, disabled and other fields | `AutoCompleteFieldNames` | `—` | | `should-open` | Opening policy; does not filter candidates | `(value: string) => boolean` | `value.length > 0` | | `filter-option` | Filter by label; false for remote filtering | `AutoCompleteFilterOption` | Automatic: enabled for arrays, disabled for loader functions | | `case-sensitive` | Case-sensitive built-in matching | `boolean` | `false` | | `popup-container` | Popup container; same contract as Trigger | `PopupContainer` | `—` | | `trigger-props` | Trigger configuration; cannot override owned opening and disabled state | `TriggerProps` | `—` | | `virtual-list-props` | Enable and configure virtual scrolling | `VirtualListProps` | `—` | | `size` | Five sizes; inherit Group / Form / global configuration when unset | `xs \| sm \| md \| lg \| xl` | `md` | | `variant` | Input variant; inherits Group when unset | `filled \| outline \| standard` | `outline` | | `disabled` | Disabled; inherited when unset, explicit false overrides | `boolean` | `undefined` | | `readonly` | Readonly; focus/copy allowed, suggestions stay closed | `boolean` | `undefined` | | `error` | Error state; inherits FormItem when unset | `boolean` | `undefined` | | `clearable` | Allow clearing a nonempty editable value | `boolean` | `false` | | `placeholder` | Placeholder or floating hint text | `string` | `—` | | `hint` | Enable Input floating hint | `boolean` | `undefined` | | `line` | Show border or underline | `boolean` | `true` | | `text-color` | Instance text color | `string` | `—` | | `focus-color` | Instance focus color | `string` | `—` | | `blur-color` | Instance unfocused hint color | `string` | `—` | | `enterkeyhint` | Virtual keyboard action hint | `InputHTMLAttributes['enterKeyHint']` | `—` | | `aria-label` | Accessible input name | `string` | `—` | | `max-length` | Same length normalization for typing and selecting | `number \| { length: number; errorOnly?: boolean }` | `0` | | `show-word-limit` | Display word count | `boolean` | `false` | | `word-length` | Custom length calculation | `(value: string) => number` | `—` | | `word-slice` | Custom slicing | `(value: string, maxLength: number) => string` | `—` | | `input-attrs` | Native input attributes; combobox state is owned by the component | `Record` | `—` | ### Events | Event | Arguments | | ----------------------------------------- | ------------------------------------------------------------- | | `update:model-value` | `value: string` | | `input / search / change` | `value: string, event: Event` | | `select` | `value: string, option: AutoCompleteOptionInfo, event: Event` | | `clear` | `event: Event` | | `focus / blur` | `event: FocusEvent` | | `dropdown-scroll / dropdown-reach-bottom` | `event: Event` | Typing: `input → update:modelValue → search`; selection: `update:modelValue → select → change`; clear: `clear → input → update:modelValue → change`. Selecting the same value emits only select. change is a commit on blur, Enter or selection. Input owns typing/focus/clear Form notifications; AutoComplete notifies Form once for suggestion commits. Selection applies maxLength; select.value is the committed string, while option.value retains the original suggestion. clear receives an event, not a string. ### Slots | Slot | Description | | ----------------- | ---------------------------------- | | `option` | `{ data: AutoCompleteOptionInfo }` | | `footer` | Menu footer | | `prefix / suffix` | Input prefix / suffix | | `clear-icon` | `{ clear }` | ### Methods `focus()` / `blur()` label is text. Use the option slot or an option render function for complex candidates; function/VNode labels are not supported. Arrow keys browse, Enter selects, Escape closes, and Tab retains native focus navigation. Vue useId keeps SSR identifiers stable. ## Type definitions ```ts import type { AutoCompleteProps, AutoCompleteInstance, AutoCompleteOption, AutoCompleteOptionData, AutoCompleteOptionInfo, AutoCompleteFieldNames, AutoCompleteFilterOption, } from "@cedar-design/ui"; ``` ## Style variables | Token | Default | | ----------------------------------------------- | --------------------------------------------------- | | `--c-auto-complete-popup-max-height` | `var(--c-select-popup-max-height)` | | `--c-auto-complete-popup-bg` | `var(--c-select-popup-bg)` | | `--c-auto-complete-popup-border-radius` | `var(--c-select-popup-border-radius)` | | `--c-auto-complete-popup-padding-vertical` | `var(--c-select-popup-padding-vertical)` | | `--c-auto-complete-popup-font-size` | `var(--c-select-popup-font-size)` | | `--c-auto-complete-popup-border-color` | `var(--c-select-popup-border-color)` | | `--c-auto-complete-popup-box-shadow` | `var(--c-select-popup-box-shadow)` | | `--c-auto-complete-option-height` | `var(--c-select-popup-option-height)` | | `--c-auto-complete-option-font-weight-selected` | `var(--c-select-popup-option-font-weight-selected)` | | `--c-auto-complete-option-padding-horizontal` | `var(--c-select-popup-option-padding-horizontal)` | | `--c-auto-complete-option-bg-default` | `var(--c-select-popup-option-bg)` | | `--c-auto-complete-option-bg-hover` | `var(--c-select-popup-option-bg-hover)` | | `--c-auto-complete-option-bg-selected` | `var(--c-select-popup-option-bg-selected)` | | `--c-auto-complete-option-bg-disabled` | `var(--c-select-popup-option-bg-disabled)` | | `--c-auto-complete-option-text-color-default` | `var(--c-select-popup-option-text-color)` | | `--c-auto-complete-option-text-color-hover` | `var(--c-select-popup-option-text-color-hover)` | | `--c-auto-complete-option-text-color-selected` | `var(--c-select-popup-option-text-color-selected)` | | `--c-auto-complete-option-text-color-disabled` | `var(--c-select-popup-option-text-color-disabled)` | Clearing does not emit search or reopen candidates, including when focus returns from a keyboard-focused clear button to the input. The parent controls the value: each rejected clear or selection still emits a change proposal; an accepted candidate selection notifies Form once. ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. Suggestions share Select’s list, group, selected and disabled styles. AutoComplete style variables follow the corresponding Select variables by default. In `inline` mode, the list opens below the input and follows scrolling; use `trigger-props` to explicitly change placement or enable automatic flipping. In `popup` mode, candidates use the same full editor surface as Select. ### Public type exports Root and component entries export `AutoCompleteEmits`、`AutoCompleteSlots`、`AutoCompleteExpose` alongside Props and Instance. Emits are event argument tuples derived from the runtime validators; Expose contains focus/blur. `case-sensitive` only makes built-in local filtering `case-sensitive`: `ap` matches `Apple` when false, but not when true. It does not require choosing an option or validate the value. A custom `filterOption` takes priority; `filterOption=false` disables local filtering and makes `case-sensitive` irrelevant. ### Migrating strict / Migration The old `strict` prop is removed. Use `case-sensitive` (`caseSensitive` in TypeScript) instead; boolean meanings and the default false remain unchanged. This removal is marked for the next major release, without a compatibility alias. ### Built-in search fields `searchFields` / `search-fields` is a readonly `('label' | 'value')[]`, defaulting to `['label']`. Multiple fields use OR matching, case-insensitive by default. `['value', 'label']` searches codes and names; fieldNames maps semantic fields to business fields. An empty array matches no items for a nonempty query. Values are compared as strings; object traversal, object values and pinyin matching require a custom callback. A custom callback takes precedence and decides case handling itself. Remote results use the existing protocol for disabling local filtering. Cascader retains path semantics and checks the configured fields on each path node. ## Configuring the cleared value `empty-value` / `emptyValue` configures the model value produced by clearing. It accepts a value in the component model type, null, or a zero-argument factory. Omitting it preserves the existing default. Use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on each clear; selected items that cannot be cleared remain. It does not redefine empty values, change Form reset defaults, or treat 0/false as universally empty. Text and person-ID models remain strings; use an empty string or a business-defined string sentinel. ## Loading options through a function prop Pass options(query, { signal }) directly; useAsyncData is unnecessary. options still accepts arrays, and an explicit array, including [], takes precedence. The component manages loading, stale-result isolation and cancellation. load-error reports failures, and the instance refresh() method retries. A business loader may accept only query and ignore the second argument. filterable enables entering a search query. filterOption controls only local matching and never sends requests. With an options loader, remote results are not filtered again by default; with only an array, local matching is enabled by default. Most callers do not need filter-option. ```vue ``` `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. --- Document: llms/en-US/components/avatar.md # Avatar Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `color`: Overrides the color. Example source: src/avatar/__demos__/basic.vue ```vue ``` ## Appearance and states ### Size and shape comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `shape` | Avatar shape | Size and shape comparison, Style, Hoverable | | `image-url` | Image URL | Size and shape comparison, Hoverable | | `alt` | Image alternative text | Size and shape comparison, Hoverable | | `bordered` | Whether to show a border | Style, Hoverable | | `size` | Avatar width and height; numbers are px, strings are CSS lengths | Size and shape comparison | | `color` | Background color | Style | Compare space used at each size, then round and square boundaries. Image fitting and fallback remain separate. Example source: src/avatar/__demos__/shape-size-comparison.vue ```vue ``` ### Style - `color`: Overrides the color. Example source: src/avatar/__demos__/style.vue ```vue ``` ### Hoverable Preview configuration: `hoverable`, `image-url="/cat.jpg"`, `alt="悬停放大"`, `shape="square"`. Example source: src/avatar/__demos__/hoverable.vue ```vue ``` ## Layout and arrangement ### Group direction and overflow #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `image-url` | Image URL | Group direction and overflow | | `alt` | Image alternative text | Group direction and overflow | | `bordered` | Whether to show a border | Group direction and overflow | | `color` | Background color | Group direction and overflow | Compare horizontal and vertical groups, maximum counts, stacking and overflow indicators. Example source: src/avatar/__demos__/group-comparison.vue ```vue ``` ## Content and presentation ### Auto Fix #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `image-url` | Image URL | Image, Fit, Fallback | | `alt` | Image alternative text | Image, Fit, Fallback | | `size` | Avatar width and height; numbers are px, strings are CSS lengths | Image, Fit, Fallback | | `shape` | Avatar shape | Auto Fix, Image | | `auto-fix-font-size` | Whether to shrink long text automatically | Auto Fix | | `object-fit` | Image fitting mode | Fit | Preview configuration: `shape="square"`, `:auto-fix-font-size="false"`, `placeholder="输入更长的文字看缩放"`, `clearable`. Example source: src/avatar/__demos__/auto-fix.vue ```vue ``` ### Image - `size`: Controls the component size. Example source: src/avatar/__demos__/image.vue ```vue ``` ### Fit - `size`: Controls the component size. Example source: src/avatar/__demos__/fit.vue ```vue ``` ### Fallback - `size`: Controls the component size. Example source: src/avatar/__demos__/fallback.vue ```vue ``` ## Interaction and control ### Trigger #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `image-url` | Image URL | Trigger | | `alt` | Image alternative text | Trigger | | `size` | Avatar width and height; numbers are px, strings are CSS lengths | Trigger | | `trigger-type` | How the action icon is shown | Trigger | - `size`: Controls the component size. Example source: src/avatar/__demos__/trigger.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | shape | Avatar shape | `circle / square` | `circle` | | image-url | Image URL | `string` | `-` | | alt | Image alternative text | `string` | `''` | | size | Avatar width and height; numbers are px, strings are CSS lengths | `number / string` | `-` | | auto-fix-font-size | Whether to shrink long text automatically | `boolean` | `true` | | trigger-type | How the action icon is shown | `button / overlay` | `button` | | trigger-icon-style | Custom style for the action icon | `CSSProperties` | `-` | | object-fit | Image fitting mode | `fill / contain / cover / none / scale-down` | `cover` | | color | Background color | `string` | `-` | | bordered | Whether to show a border | `boolean` | `false` | | border-color | Border color | `string` | `-` | | loading | Placeholder image while loading | `string` | `-` | | error | Fallback image URL when image loading fails | `string` | `-` | | lazy | Whether to lazy-load the image | `boolean` | `false` | | hoverable | Whether to scale on hover | `boolean` | `false` | ### Events | Event | Description | Arguments | | --- | --- | --- | | click | Emitted when the avatar is clicked | `(event: MouseEvent) => void` | | load | Emitted when the image loads | `() => void` | | error | Emitted when image loading fails | `() => void` | ### Slots | Slot | Description | | --- | --- | | default | Text, icon, or loading content for an image | | error | Fallback content when image loading fails | | trigger-icon | Action icon on the avatar | ### Methods No custom public methods. ### AvatarGroup Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | shape | Child avatar shape | `circle / square` | `circle` | | size | Child avatar width and height; numbers are px, strings are CSS lengths | `number / string` | `-` | | auto-fix-font-size | Whether to shrink child avatar text automatically | `boolean` | `true` | | max-count | Maximum visible avatars; `0` means unlimited | `number` | `0` | | z-index-ascend | Use ascending stacking order | `boolean` | `false` | | max-style | Custom summary avatar style | `CSSProperties` | `-` | | max-popover-props | Summary Popover props | `PopoverProps` | `-` | | offset | Overlap offset | `number / string` | `-` | | vertical | Stack avatars vertically | `boolean` | `false` | ### AvatarGroup Slots | Slot | Description | | --- | --- | | default | Avatar list | ### Type definitions ```ts import type { AvatarGroupInstance, AvatarGroupProps, AvatarInstance, AvatarProps, AvatarObjectFit, AvatarShape, AvatarTriggerType, } from "@cedar-design/ui"; ``` ### Style variables | Variable | Default | | --- | --- | | `--c-avatar-size-default` | `40px` | | `--c-avatar-font-size-text` | `20px` | | `--c-avatar-text-color` | `var(--c-sys-color-content-primary)` | | `--c-avatar-text-padding-inline` | `4px` | | `--c-avatar-bg` | `var(--c-color-fill-4)` | | `--c-avatar-border-width` | `2px` | | `--c-avatar-border-color` | `var(--c-sys-color-surface-default)` | | `--c-avatar-group-item-border` | `var(--c-sys-color-surface-default)` | | `--c-avatar-group-item-border-width` | `2px` | | `--c-avatar-group-offset` | `-10px` | | `--c-avatar-group-popover-item-spacing` | `8px` | | `--c-avatar-font-weight-text` | `500` | | `--c-avatar-circle-border-radius` | `50%` | | `--c-avatar-square-border-radius` | `4px` | | `--c-avatar-size-trigger-button` | `20px` | | `--c-avatar-trigger-button-bg` | `var(--c-color-fill-2)` | | `--c-avatar-trigger-button-bg-hover` | `var(--c-color-fill-3)` | | `--c-avatar-trigger-overlay-icon` | `var(--c-sys-color-content-on-dark)` | | `--c-avatar-trigger-overlay-bg` | `color-mix(in srgb, var(--c-color-black) 60%, transparent)` | | `--c-avatar-trigger-icon-button` | `var(--c-sys-color-content-primary)` | | `--c-avatar-spacing-trigger-button-right` | `4px` | | `--c-avatar-spacing-trigger-button-bottom` | `4px` | | `--c-avatar-size-trigger-icon` | `12px` | | `--c-avatar-trigger-button-border-radius` | `50%` | | `--c-avatar-font-size-max-count` | `20px` | | `--c-avatar-max-count-text-color` | `var(--c-sys-color-content-primary)` | | `--c-avatar-trigger-overlay-font-size` | `16px` | | `--c-avatar-hover-transform` | `scale(1.1)` | | `--c-avatar-motion-duration` | `0.2s` | | `--c-avatar-z-index-trigger` | `1` | | `--c-avatar-z-index-overlay` | `0` | | `--c-avatar-z-index-overlay-hover` | `2` | Text, summary counts and button trigger icons use the primary content `color` by default. Borders follow the container surface; only icons on dark interaction overlays use `content-on-dark`. The avatar `fill-4` background, button background/hover levels and translucent black overlay remain component visual values. When overriding the avatar background with `color`, also check text contrast and override `text-color` if needed. ### Reduced motion Built-in CSS transitions follow `prefers-reduced-motion: reduce`. Removing transitions does not change final visibility, selected/expanded state or event semantics. Applications control custom animations inside slots. --- Document: llms/en-US/components/back-top.md # BackTop Visibility RAF and JS duration/easing interpolation have separate ownership. Old listeners/canceled or consumed frames cannot replay after target replacement/deactivation/disposal. Recheck after custom easing before writing; RAF/cancel/time origin use the target owner window. Retained inactive/disposed commands are inert, activation does not resume old animation. Scoped14/full30 per copy pass using controlled queues/iframe, not native browser/OS proof. Default200ms/API remain; no CSS token added. A native button that scrolls the page or an explicit container to the top. ## Basic examples ### Basic usage Example source: src/back-top/__demos__/basic.vue ```vue ``` ## Customization and slots ### Custom position #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `target-container` | Scroll target; omitted means page | Custom position | | `popup-container` | Render target; false renders locally | Custom position | | `visible-height` | Inclusive scroll threshold in px, numeric strings accepted | Custom position | | `right` | Right offset; number in px, string accepts CSS units | Custom position | | `bottom` | Bottom offset; number in px, string accepts CSS units | Custom position | | `aria-label` | Accessible name | Custom position | Example source: src/back-top/__demos__/custom-position.vue ```vue ``` ## Interaction and control ### Switch scroll container #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `target-container` | Scroll target; omitted means page | Switch scroll container, Content and events | | `popup-container` | Render target; false renders locally | Switch scroll container, Content and events | | `visible-height` | Inclusive scroll threshold in px, numeric strings accepted | Switch scroll container, Content and events | | `right` | Right offset; number in px, string accepts CSS units | Switch scroll container, Content and events | | `bottom` | Bottom offset; number in px, string accepts CSS units | Switch scroll container, Content and events | | `aria-label` | Accessible name | Switch scroll container, Content and events | Example source: src/back-top/__demos__/container.vue ```vue ``` ### Content and events Example source: src/back-top/__demos__/custom.vue ```vue ``` The examples use isolated local containers. Omit `target-container` to listen to the page, not the nearest scrollable ancestor. A selector that is invalid or missing hides the button; use a reactive getter for a container mounted asynchronously. `popup-container` controls where the button renders, not what scrolls. ## Lifecycle and edge cases ### Scheduling Lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `target-container` | Scroll target; omitted means page | Scheduling Lifecycle | | `popup-container` | Render target; false renders locally | Scheduling Lifecycle | | `duration` | Animation duration in ms; 0 is immediate | Scheduling Lifecycle | | `easing` | Built-in curve or normalized progress function | Scheduling Lifecycle | Example source: src/back-top/__demos__/scheduler-lifecycle.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | `target-container` | Scroll target; omitted means page | `string \| HTMLElement \| (() => HTMLElement \| null \| undefined)` | `—` | | `popup-container` | Render target; false renders locally | `string \| HTMLElement \| false` | `body` | | `visible-height` | Inclusive scroll threshold in px, numeric strings accepted | `number \| string` | `200` | | `duration` | Animation duration in ms; 0 is immediate | `number` | `200` | | `easing` | Built-in curve or normalized progress function | `'linear' \| 'quartOut' \| 'easeInOutCubic' \| ((progress: number) => number)` | `'quartOut'` | | `right` | Right offset; number in px, string accepts CSS units | `number \| string` | `—` | | `bottom` | Bottom offset; number in px, string accepts CSS units | `number \| string` | `—` | | `elevation` | Shadow level; true uses level 2 | `boolean \| number` | `true` | | `aria-label` | Accessible name | `string` | `'Back to top'` | When `popup-container=false`, the button is positioned absolutely; give its containing block `position: relative`. Repeated clicks replace the previous animation; changing target, deactivation and unmount cancel queued work. Reduced-motion preference skips animation. Horizontal scroll position is preserved. ### Events / slots / methods - `click(event: MouseEvent)`: emitted once per activation. - Default slot: noninteractive text or icons. The root is already a native button; do not nest another Button or link. - `scrollToTop()`: scrolls the current target without emitting an additional click. - Keyboard: Tab focuses the visible button; Enter / Space activates it. Hidden buttons are not focusable. ### Types ```ts import type { BackTopProps, BackTopInstance, BackTopTarget, BackTopEasing } from '@cedar-design/ui' ``` ### Style variables | Token | Default | | --- | --- | | `--c-back-top-right` | `40px` | | `--c-back-top-bottom` | `40px` | | `--c-back-top-button-size` | `var(--c-sys-control-touch-target)` | | `--c-back-top-button-border-radius` | `50%` | | `--c-back-top-font-size` | `var(--c-sys-font-size-md)` | | `--c-back-top-icon-size` | `20px` | | `--c-back-top-background` | `var(--c-sys-color-surface-raised)` | | `--c-back-top-text-color` | `var(--c-sys-color-content-brand)` | | `--c-back-top-hover-background` | `var(--c-sys-color-state-hover)` | | `--c-back-top-focus-color` | `var(--c-sys-color-content-brand)` | | `--c-back-top-focus-width` | `2px` | | `--c-back-top-focus-offset` | `2px` | | `--c-back-top-z-index` | `var(--c-z-index-local-sticky)` | Pre-release migration: Cedar `margin-right/bottom` → `right/bottom`, `button-size-width` → `button-size`, `button-size-font/icon` → `font-size/icon-size`, `button-bg/bg-hover/text-color` → `background/hover-background/text-color` (all with the component prefix). Maple duration is now 200ms; default target is the page. Legacy arbitrary BTween curve names are replaced with the documented presets or a function. No aliases remain. --- Document: llms/en-US/components/badge.md # Badge The same scenarios, parameters and interactions as Cedar. Only component prefixes differ; themes and site shells remain independent. ## Basic examples ### Basic usage Badges use a red background and white text by default. Example source: src/badge/__demos__/basic.vue ```vue ``` ## Appearance and states ### Statuses and colors #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Badge content | Statuses and colors, Appearance configuration comparison | | `status` | Semantic status | Statuses and colors | | `mode` | Layout mode | Statuses and colors | | `description` | Fallback description text | Statuses and colors | | `color` | Custom color; outline uses it for border and text | Statuses and colors | | `text-color` | Content text color | Statuses and colors | Example source: src/badge/__demos__/color.vue ```vue ``` ### Appearance configuration comparison Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/badge/__demos__/appearance-lab.vue ```vue ``` ## Layout and arrangement ### Positions and offsets #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `position` | Physical corner or left/right midpoint inside the host box, default top-right. Only used in floating mode; RTL does not mirror it | Positions and offsets | | `content` | Badge content | Positions and offsets | | `dot` | Display a dot | Positions and offsets | | `offset-x` | Horizontal offset; ignored in inline mode | Positions and offsets | | `offset-y` | Vertical offset | Positions and offsets | | `mode` | Layout mode | Positions and offsets | Example source: src/badge/__demos__/position.vue ```vue ``` ## Content and presentation ### Inline and standalone #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Badge content | Inline and standalone, Dot badges, Maximum and zero | | `dot` | Display a dot | Inline and standalone, Dot badges, Show and hide | | `description` | Fallback description text | Inline and standalone, Show and hide | | `show-zero` | Show numeric zero | Maximum and zero, Show and hide | | `mode` | Layout mode | Inline and standalone | | `inline-position` | Inline badge at the logical start or end of the host content, default end. Only used in inline mode | Inline and standalone | Example source: src/badge/__demos__/inline.vue ```vue ``` ### Dot badges Example source: src/badge/__demos__/dot.vue ```vue ``` ### Maximum and zero Example source: src/badge/__demos__/max.vue ```vue ``` ### Show and hide Example source: src/badge/__demos__/show.vue ```vue ``` ## Customization and slots ### Custom content #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Badge content | Custom content | | `mode` | Layout mode | Custom content | | `inline-position` | Inline badge at the logical start or end of the host content, default end. Only used in inline mode | Custom content | Example source: src/badge/__demos__/content.vue ```vue ``` ## API ### Props | Parameter | Description | Type | Default | | --------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------- | :---------: | | description | Fallback description text | `string` | `-` | | content | Badge content | `number \| string` | `-` | | max | Maximum displayed numeric badge value. Numeric content above this value is shown as `${max}+`. | `number` | `99` | | dot | Display a dot | `boolean` | `false` | | offset-x | Horizontal offset; ignored in inline mode | `number` | `0` | | offset-y | Vertical offset | `number` | `0` | | color | Custom color; outline uses it for border and text | `string` | `-` | | text-color | Content text color | `string` | `-` | | mode | Layout mode | `'floating' \| 'inline'` | `floating` | | position | Physical corner or left/right midpoint inside the host box, default top-right. Only used in floating mode; RTL does not mirror it | `'top-right' \| 'top-left' \| 'bottom-right' \| 'bottom-left' \| 'left' \| 'right'` | `top-right` | | inline-position | Inline badge at the logical start or end of the host content, default end. Only used in inline mode | `'start' \| 'end'` | `end` | | size | Size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `md` | | status | Semantic status | `SemanticStatus` | `danger` | | show | Show the badge | `boolean` | `true` | | show-zero | Show numeric zero | `boolean` | `false` | | variant | Appearance | `'outline' \| 'default'` | `default` | ### Events No component-specific events. ### Slots | Slot | Description | Arguments | | ------- | ---------------- | ---- | | default | Fallback description text | - | | content | Content displayed inside the badge | - | ### Methods No public methods. ### Platform notes Props and slots match across platforms. Without a default slot and with an empty description, the badge renders independently inline. Omitting content displays a dot. Each library reads text direction from its own configuration and supplies its own theme colors and CSS prefix. ### Style variables The following CSS variables support customization with [StyleProvider](#/en-US/style-provider). | Variable | Default | | --- | --- | | `--c-badge-font-weight` | `var(--c-sys-font-weight-medium)` | | `--c-badge-description-size-xs-font-size` | `var(--c-sys-font-size-xs)` | | `--c-badge-description-size-sm-font-size` | `var(--c-sys-font-size-xs)` | | `--c-badge-description-size-md-font-size` | `var(--c-sys-font-size-md)` | | `--c-badge-description-size-lg-font-size` | `var(--c-sys-font-size-lg)` | | `--c-badge-description-size-xl-font-size` | `var(--c-sys-font-size-xl)` | | `--c-badge-description-text-color` | `var(--c-sys-color-content-primary)` | | `--c-badge-size-xs-font-size` | `var(--c-sys-font-size-xs)` | | `--c-badge-size-sm-font-size` | `var(--c-sys-font-size-xs)` | | `--c-badge-size-md-font-size` | `var(--c-sys-font-size-xs)` | | `--c-badge-size-lg-font-size` | `var(--c-sys-font-size-md)` | | `--c-badge-size-xl-font-size` | `var(--c-sys-font-size-lg)` | | `--c-badge-size-xs-scale` | `0.6667` | | `--c-badge-size-sm-scale` | `0.8333` | | `--c-badge-size-md-scale` | `1` | | `--c-badge-size-lg-scale` | `1` | | `--c-badge-size-xl-scale` | `1` | | `--c-badge-size-xs-dot-width` | `4px` | | `--c-badge-size-sm-dot-width` | `5px` | | `--c-badge-size-md-dot-width` | `6px` | | `--c-badge-size-lg-dot-width` | `7px` | | `--c-badge-size-xl-dot-width` | `8px` | | `--c-badge-size-xs-dot-height` | `4px` | | `--c-badge-size-sm-dot-height` | `5px` | | `--c-badge-size-md-dot-height` | `6px` | | `--c-badge-size-lg-dot-height` | `7px` | | `--c-badge-size-xl-dot-height` | `8px` | | `--c-badge-size-xs-space` | `0px` | | `--c-badge-size-sm-space` | `var(--c-sys-space-1)` | | `--c-badge-size-md-space` | `var(--c-sys-space-3)` | | `--c-badge-size-lg-space` | `var(--c-sys-space-3)` | | `--c-badge-size-xl-space` | `var(--c-sys-space-4)` | | `--c-badge-size-xs-padding` | `0 var(--c-sys-space-3)` | | `--c-badge-size-sm-padding` | `0 var(--c-sys-space-3)` | | `--c-badge-size-md-padding` | `0 var(--c-sys-space-4)` | | `--c-badge-size-lg-padding` | `0 var(--c-sys-space-4)` | | `--c-badge-size-xl-padding` | `0 10px` | | `--c-badge-size-xs-height` | `20px` | | `--c-badge-size-sm-height` | `20px` | | `--c-badge-size-md-height` | `24px` | | `--c-badge-size-lg-height` | `28px` | | `--c-badge-size-xl-height` | `32px` | | `--c-badge-size-xs-border-radius` | `20px` | | `--c-badge-size-sm-border-radius` | `20px` | | `--c-badge-size-md-border-radius` | `24px` | | `--c-badge-size-lg-border-radius` | `28px` | | `--c-badge-size-xl-border-radius` | `32px` | | `--c-badge-bg-color` | `rgb(var(--c-danger-7))` | | `--c-badge-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-default-bg-color` | `#e0e0e0` | | `--c-badge-status-default-text-color` | `var(--c-sys-color-content-on-bright)` | | `--c-badge-status-info-bg-color` | `var(--c-sys-color-status-info)` | | `--c-badge-status-info-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-success-bg-color` | `var(--c-sys-color-status-success)` | | `--c-badge-status-success-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-warning-bg-color` | `var(--c-sys-color-status-warning)` | | `--c-badge-status-warning-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-danger-bg-color` | `rgb(var(--c-danger-7))` | | `--c-badge-status-danger-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-primary-bg-color` | `var(--c-sys-color-action-primary)` | | `--c-badge-status-primary-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-secondary-bg-color` | `rgb(var(--c-gray-6))` | | `--c-badge-status-secondary-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-status-tertiary-bg-color` | `rgb(var(--c-gray-7))` | | `--c-badge-status-tertiary-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-badge-variant-outline-bg-color` | `transparent` | | `--c-badge-variant-outline-text-color` | `var(--c-sys-color-content-danger)` | | `--c-badge-variant-outline-status-info-text-color` | `var(--c-sys-color-content-info)` | | `--c-badge-variant-outline-status-success-text-color` | `var(--c-sys-color-content-success)` | | `--c-badge-variant-outline-status-warning-text-color` | `var(--c-sys-color-content-warning)` | | `--c-badge-variant-outline-status-danger-text-color` | `var(--c-sys-color-content-danger)` | | `--c-badge-variant-outline-status-primary-text-color` | `var(--c-sys-color-content-brand)` | | `--c-badge-variant-outline-status-default-text-color` | `var(--c-sys-color-content-primary)` | | `--c-badge-variant-outline-status-secondary-text-color` | `var(--c-sys-color-content-secondary)` | | `--c-badge-variant-outline-status-tertiary-text-color` | `var(--c-sys-color-content-secondary)` | | `--c-badge-border-color` | `var(--c-sys-color-surface-default)` | | `--c-badge-offset` | `2px` | | `--c-badge-ring-width` | `2px` | Filled badge text follows Button: primary, info, success, warning, danger and secondary use `content-on-dark`; tertiary uses `content-on-dark` in light mode and `content-on-bright` in dark mode. Default notification badges use red backgrounds and white text; the neutral background remains `#e0e0e0`. Colored outline text and borders follow Button, using the matching `content-brand`, `content-info`, `content-success`, `content-warning` and `content-danger` semantic roles; secondary and tertiary outlines use `content-secondary` for readability. `variant-outline-bg-color` works for every status and defaults to transparent. The `color` prop overrides outline text and border; `text-color` overrides text further. Both preserve control through the background variable. Recheck contrast after customizing foreground or background. ### Type definitions The component exports the following types ```ts import type { BadgeInstance } from '@cedar-design/ui' ``` ### Color override boundaries The bg-color fallback and danger fill use red backgrounds with white text: danger level 7 in light mode and level 4 in dark mode. Fixed neutral light gray and secondary/tertiary gray levels are intentional component colors. Override the border-color isolation ring to match the host surface. Callers must ensure contrast for custom color/text-color values. --- Document: llms/en-US/components/breadcrumb.md # Breadcrumb Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/breadcrumb/__demos__/basic.vue ```vue ``` ## Content and presentation ### Routes #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `routes` | Route list | Routes, Droplist, Max Count | | `max-count` | Maximum ordinary breadcrumb items, excluding the overflow item; 0 means unlimited | Max Count | Preview configuration: `:routes="routes"`, `:href="paths.join('/')"`. Example source: src/breadcrumb/__demos__/routes.vue ```vue ``` ### Droplist Preview configuration: `:routes="routes"`, `:droplist="droplist"`. Example source: src/breadcrumb/__demos__/droplist.vue ```vue ``` ### Max Count Preview configuration: `:max-count="3"`, `:routes="maxRoutes"`, `:trigger="['hover', 'focus', 'click']"`, `:content="omittedItems.map((item) => item.label).join(' / ')"`. Example source: src/breadcrumb/__demos__/max-count.vue ```vue ``` ### Link Preview configuration: `href="#/home"`, `href="#/channel"`. Example source: src/breadcrumb/__demos__/link.vue ```vue ``` ## Customization and slots ### Custom Split Preview configuration: `separator="~"`, `separator="->"`. Example source: src/breadcrumb/__demos__/custom-split.vue ```vue ``` ### Custom Icon Example source: src/breadcrumb/__demos__/custom-icon.vue ```vue ``` ## API ### Breadcrumb Props | Prop | Description | Type | Default | | --------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ------ | | max-count | Maximum ordinary breadcrumb items, excluding the overflow item; 0 means unlimited | `number` | `0` | | routes | Route list | `BreadcrumbRoute[]` | `-` | | separator | Separator text | `string \| number` | `/` | ### Breadcrumb Slots | Slot | Description | Arguments | | ----------- | ---------------------------------- | --------------------------------------------------------------------------- | | more-icon | Custom overflow icon | `omittedItems` `count` `start` `end` | | item-render | Custom breadcrumb rendering when routes is provided | `route:BreadcrumbRoute`
`routes:BreadcrumbRoute[]`
`paths:string[]` | | separator | Custom separator | `-` | ### BreadcrumbItem Props | Prop | Description | Type | Default | | -------------- | ------------ | ----------------------------- | ------ | | separator | Separator text | `string \| number` | `-` | | href | Link URL | `string` | `-` | | droplist | Dropdown menu content | `BreadcrumbRoute['children']` | `-` | | dropdown-props | Props passed to Menu | `MenuProps` | `-` | ### BreadcrumbItem Events | Event | Description | Arguments | | ------ | -------- | -------------- | | click | Click event; omitted items do not emit it | `event: MouseEvent` | | select | Fired when a built-in dropdown item is selected | `route: BreadcrumbRoute, event?: Event` | ### BreadcrumbItem Slots | Slot | Description | Arguments | | --------- | -------------- | ---- | | droplist | Custom dropdown menu | `-` | | separator | Custom separator | `-` | ### BreadcrumbRoute | Parameter | Description | Type | Default | | -------- | ------------------------- | ------------------------------ | ------ | | label | Breadcrumb label | `string` | `-` | | path | Navigation path (`href` on the `a` element) | `string` | | children | Dropdown menu items | `{label:string,path:string}[]` | `-` | ## Type definitions The component exports the following types ```ts import type { BreadcrumbProps, BreadcrumbItemProps, BreadcrumbRoute } from '@cedar-design/ui' ``` ## Shared implementation and platform boundaries Breadcrumb and BreadcrumbItem are maintained as local copies in Cedar / Maple. Component bodies, props, context, types, key styles and paired tests are checked by `design-ui/bin/copied-components-check.mjs`. Each library supplies its own icons, installation entry, menu implementation and theme tokens. - A nonempty `routes` array takes precedence over the default slot; an empty array falls back to the slot. Default route rendering links all items except the last, which has `aria-current="page"`. `item-render` controls links itself. - Separator precedence: child slot → child prop → parent slot → parent prop. `0` and an empty string are supported. - `max-count` preserves the existing boundary: collapsing occurs only when the total exceeds `max-count + 1`. It keeps the first and trailing items. The overflow position does not trigger omitted items’ clicks, links or dropdowns. - Built-in dropdown selection emits `select(route, event)`. Indices and separators update with dynamic insertion, removal, reordering and SSR. - Cedar adds a `__content` wrapper for item content; attributes fall through to it. Maple retains its existing theme variables through token mappings. --- Document: llms/en-US/components/button.md # Button Both libraries use the same implementation and examples; package prefixes, themes and registration stay local. ## Basic examples ### Eight statuses Example source: src/button/__demos__/basic.vue ```vue ``` ## Appearance and states ### Four variants #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `variant` | Appearance; inherits group, otherwise default | Four variants, Colors, ripple and elevation | | `size` | Size; inherits group, otherwise md | Four variants, Five sizes | | `status` | Semantic color; inherits group, otherwise default | Four variants | | `disabled` | Disabled; inherits group, explicit false overrides | Disabled buttons and links | | `component` | Root tag; link attributes fall through | Disabled buttons and links | | `loading` | Loading; blocks activation and navigation | Disabled buttons and links | The `default` variant uses white text for primary, info, success, warning, danger and secondary solid fills. Example source: src/button/__demos__/variants.vue ```vue ``` ### Five sizes Horizontal buttons and inputs of the same size share the default height and font size within each platform. Cedar heights are 24/28/32/36/44px; Maple heights are 32/40/48/56/64px. Horizontal button padding is 8/12/16/20/24px per side, with a 6px icon-label gap. Stacked buttons keep their separate content-based height. Component-level overrides remain independent. Example source: src/button/__demos__/size.vue ```vue ``` ### Disabled buttons and links Example source: src/button/__demos__/disabled.vue ```vue ``` ### Colors, ripple and elevation Example source: src/button/__demos__/custom-color.vue ```vue ``` ## Icons and layout ### Icons and label layouts #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Semantic color; inherits group, otherwise default | Icons and label layouts | | `variant` | Appearance; inherits group, otherwise default | Icons and label layouts | | `size` | Size; inherits group, otherwise md | Icons and label layouts | | `stacked` | Stack icon and text; inherits group when omitted | Icons and label layouts | | `round` | Round button | Icons and label layouts | | `block` | Full available width | Block buttons | Use built-in icons to compare icon-only, inline and stacked labels across four variants and five sizes. Stacked buttons grow with content and keep at least 8px of top and bottom padding. Omit the default slot for icon-only buttons; round controls shape and stacked controls label layout. Example source: src/button/__demos__/icons.vue ```vue ``` ### Block buttons Example source: src/button/__demos__/block.vue ```vue ``` ## Button groups ### Group inheritance and overrides #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Semantic color; inherits group, otherwise default | Group inheritance and overrides | | `disabled` | Disabled; inherits group, explicit false overrides | Group inheritance and overrides | | `loading` | Loading; blocks activation and navigation | Button Group Content | Example source: src/button/__demos__/button-group.vue ```vue ``` ### Button Group Layout Example source: src/button/__demos__/button-group-layout.vue ```vue ``` ### Button Group Content Example source: src/button/__demos__/button-group-content.vue ```vue ``` ## Forms and events ### Control Sizes #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | Size; inherits group, otherwise md | Control Sizes | | `variant` | Appearance; inherits group, otherwise default | Control Sizes | | `html-type` | Native button type | Native form, focus and touch events | | `focusable` | Allow sequential Tab focus; does not prevent programmatic focus | Native form, focus and touch events | - `size`: Controls the component size. - `variant`: Selects the visual variant. Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ### Native form, focus and touch events Example source: src/button/__demos__/native-events.vue ```vue ``` ## Loading and action feedback ### Loading layouts and animations #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `loading` | Loading; blocks activation and navigation | Loading layouts and animations, Loading Appearance | | `loading-size` | Indicator size; xs/sm/md/lg/xl map to 12/14/16/18/20px; numbers are px; follows button size when omitted; not used in line mode | Loading layouts and animations, Loading Appearance | | `loading-type` | Spinner animation; same as Loading.type; not used in line mode | Loading layouts and animations | | `loading-mode` | Inline, covering, or bottom progress line; line only uses loading-color | Loading layouts and animations | | `loading-color` | Loading indicator color | Loading Appearance | | `ripple` | Click ripple | Feedback | Example source: src/button/__demos__/loading.vue ```vue ``` ### Loading Appearance Example source: src/button/__demos__/loading-appearance.vue ```vue ``` ### Feedback - `elevation`: Controls the shadow intensity. Example source: src/button/__demos__/feedback.vue ```vue ``` ### Sync, async and rejection recovery Example source: src/button/__demos__/controlled-loading.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"`, including runtime changes and local overrides. Icons and content follow reading order; stacked content stays top to bottom and slot graphics are not mirrored. ButtonGroup owns horizontal joining edges and outer corners even when a child has a different text direction. A single child keeps all corners; vertical groups preserve top-to-bottom order. Native Tab, Enter and Space remain available; ordinary groups do not intercept horizontal arrows. Disabled and loading behavior stays unchanged. ## API ### Props | Prop | Description | Type | Default | | ------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------- | -------------- | | status | Semantic color; inherits group, otherwise default | `SemanticStatus` | `undefined` | | variant | Appearance; inherits group, otherwise default | `default / text / outline / tonal` | `undefined` | | size | Size; inherits group, otherwise md | `xs / sm / md / lg / xl` | `undefined` | | html-type | Native button type | `button / submit / reset` | `button` | | component | Root tag; link attributes fall through | `button / a` | `button` | | round | Round button | `boolean` | `false` | | block | Full available width | `boolean` | `false` | | loading | Loading; blocks activation and navigation | `boolean` | `false` | | loading-type | Spinner animation; same as Loading.type; not used in line mode | `circle / wave / cube / rect / disappear` | `circle` | | loading-mode | Inline, covering, or bottom progress line; line only uses loading-color | `default / fill / line` | `default` | | loading-size | Indicator size; xs/sm/md/lg/xl map to 12/14/16/18/20px; numbers are px; follows button size when omitted; not used in line mode | `ComponentSize / number` | `undefined` | | loading-color | Loading indicator color | `string` | `currentColor` | | disabled | Disabled; inherits group, explicit false overrides | `boolean` | `undefined` | | ripple | Click ripple | `boolean` | `true` | | focusable | Allow sequential Tab focus; does not prevent programmatic focus | `boolean` | `true` | | autofocus | Native autofocus | `boolean` | `false` | | text-color | Custom text color | `string` | `undefined` | | color | Custom background or variant base color | `string` | `undefined` | | elevation | Default variant shadow; true=2, false=off, rounded/clamped 0–24; group owns grouped elevation | `boolean / number` | `true` | | stacked | Stack icon and text; inherits group when omitted | `boolean` | `undefined` | ### Events | Event | Arguments and behavior | | ---------- | ------------------------------------------- | | click | `(event: MouseEvent) => void` | | touchstart | `(event: TouchEvent) => void` | click is a normal emitted event and supports async handlers. Business state controls loading; restore it in finally. Listener Promises do not automatically drive loading. Disabled/loading links have no effective href. ### Slots | Slot | Description | Arguments | | ------- | -------------------------------- | ---- | | default | Button label; retained while loading | — | | icon | Leading icon; above label when stacked | — | ### Methods No custom public methods. ## ButtonGroup ### ButtonGroup Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | status | Default semantic status; a child may override it | SemanticStatus | default | | size | Default button size; a child may override it | xs / sm / md / lg / xl | md | | variant | Default appearance; adjacent effective variants determine joining, including mixed variants | default / text / outline / tonal | default | | color | Default custom color; a child may override it | string | undefined | | text-color | Default text color; a child may override it | string | undefined | | disabled | Default disabled state; an explicit child false overrides group true | boolean | false | | stacked | Default vertical icon/text layout; a child may explicitly override with false | boolean | false | | vertical | Vertical group layout, independent of button content stacking | boolean | false | | elevation | Group shadow; true means 2, numbers normalize to 0–24; applies only to an enabled default-variant group | boolean / number | true | The root defaults to `role="group"`. Supply `aria-label` or `aria-labelledby` when the action group needs a name. Native attributes can override role. Ordinary groups retain native Tab / Enter / Space handling without arrow-key focus management. **Inheritance:** explicit child values win for status, size, variant, color, text-color, disabled and stacked. Elevation belongs to the group; a child's own elevation does not apply. Nested groups use their nearest group's settings and defaults rather than combining outer disabled states. ### ButtonGroup Events No custom events. `@click` falls through to the root DOM element and can receive descendant bubbling; listen to each Button for its action. The group does not collect listener Promises or own a task or selection model. ### ButtonGroup Slots | Slot | Description | Arguments | | --- | --- | --- | | default | Joined styling supports directly adjacent Button DOM nodes under the group root | — | **Composition:** extra DOM wrappers, prefix/suffix text and arbitrary controls are outside the joined-styling contract. Wrapped buttons may still inherit configuration without sharing the same joined edges. The group owns outer corners and does not preserve an individual round button's circular shape. Use Space for separated or arbitrary content. For narrow containers, the application chooses scrolling, shorter labels or vertical layout; groups do not wrap automatically. ### ButtonGroup Expose | Name | Description | | --- | --- | | buttonGroupProvider | Reactive group configuration with readonly ComputedRef fields; elevation is boolean / number and other fields match the Props | There are no additional group action methods. ## Types ButtonProps、ButtonVariant、ButtonLoadingMode、ButtonInstance、ButtonGroupProps、ButtonGroupInstance。 ## CSS variable responsibilities and complete defaults Button exposes 58 appearance tokens. `{status}-color` controls the solid background, `{status}-foreground-color` controls text/outline/tonal foreground, and `{status}-tonal-color` controls soft backgrounds. `solid-text-color` and `solid-state-layer-color` are shared by semantic statuses; default/tertiary foregrounds and primary/tertiary state layers retain theme-specific roles. Sizes use xs/sm/md/lg/xl. Font sizes, transition duration, focus width/offset and stacked-height increments reuse system variables. Button groups and stacked buttons share border-radius. Four state opacity variables preserve hover/active differences. loading-duration controls only the bottom progress line; Loading controls other loading animations. Internal variables and fixed animation geometry are not public customization points. | Variable | Default | | --------------------------------------- | ----------------------------------------- | | `--c-button-border-radius` | `var(--c-sys-radius-md)` | | `--c-button-content-gap` | `var(--c-sys-space-3)` | | `--c-button-danger-color` | `var(--c-sys-color-status-danger)` | | `--c-button-danger-disabled-color` | `rgb(var(--c-danger-3))` | | `--c-button-danger-foreground-color` | `var(--c-sys-color-content-danger)` | | `--c-button-danger-tonal-color` | `rgb(var(--c-danger-1))` | | `--c-button-default-color` | `var(--c-sys-color-surface-default)` | | `--c-button-default-foreground-color` | `var(--c-sys-color-content-primary)` | | `--c-button-default-tonal-color` | `var(--c-sys-color-surface-muted)` | | `--c-button-disabled-color` | `var(--c-color-fill-2)` | | `--c-button-disabled-solid-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-button-disabled-text-color` | `var(--c-sys-color-content-disabled)` | | `--c-button-focus-color` | `var(--c-sys-color-content-brand)` | | `--c-button-info-color` | `var(--c-sys-color-status-info)` | | `--c-button-info-disabled-color` | `rgb(var(--c-blue-3))` | | `--c-button-info-foreground-color` | `var(--c-sys-color-content-info)` | | `--c-button-info-tonal-color` | `rgb(var(--c-blue-1))` | | `--c-button-lg-height` | `36px` | | `--c-button-lg-padding` | `0 var(--c-sys-space-7)` | | `--c-button-loading-duration` | `1s` | | `--c-button-loading-line-height` | `3px` | | `--c-button-md-height` | `32px` | | `--c-button-md-padding` | `0 var(--c-sys-space-6)` | | `--c-button-plain-state-opacity-active` | `1` | | `--c-button-plain-state-opacity-hover` | `0.5` | | `--c-button-primary-color` | `var(--c-sys-color-action-primary)` | | `--c-button-primary-disabled-color` | `rgb(var(--c-primary-3))` | | `--c-button-primary-foreground-color` | `var(--c-sys-color-content-brand)` | | `--c-button-primary-state-layer-color` | `var(--c-button-solid-state-layer-color)` | | `--c-button-primary-tonal-color` | `rgb(var(--c-primary-1))` | | `--c-button-secondary-color` | `rgb(var(--c-gray-6))` | | `--c-button-secondary-foreground-color` | `var(--c-sys-color-content-secondary)` | | `--c-button-secondary-tonal-color` | `rgb(var(--c-gray-2))` | | `--c-button-sm-height` | `28px` | | `--c-button-sm-padding` | `0 var(--c-sys-space-5)` | | `--c-button-solid-state-layer-color` | `var(--c-sys-color-content-on-dark)` | | `--c-button-solid-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-button-stacked-gap` | `var(--c-sys-space-2)` | | `--c-button-state-layer-color` | `var(--c-sys-color-surface-page)` | | `--c-button-state-opacity-active` | `0.12` | | `--c-button-state-opacity-hover` | `0.08` | | `--c-button-success-color` | `var(--c-sys-color-status-success)` | | `--c-button-success-disabled-color` | `rgb(var(--c-success-3))` | | `--c-button-success-foreground-color` | `var(--c-sys-color-content-success)` | | `--c-button-success-tonal-color` | `rgb(var(--c-success-1))` | | `--c-button-tertiary-color` | `rgb(var(--c-gray-7))` | | `--c-button-tertiary-foreground-color` | `var(--c-sys-color-content-secondary)` | | `--c-button-tertiary-state-layer-color` | `var(--c-sys-color-content-on-bright)` | | `--c-button-tertiary-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-button-tertiary-tonal-color` | `rgb(var(--c-gray-1))` | | `--c-button-warning-color` | `var(--c-sys-color-status-warning)` | | `--c-button-warning-disabled-color` | `rgb(var(--c-warning-3))` | | `--c-button-warning-foreground-color` | `var(--c-sys-color-content-warning)` | | `--c-button-warning-tonal-color` | `rgb(var(--c-warning-1))` | | `--c-button-xl-height` | `44px` | | `--c-button-xl-padding` | `0 var(--c-sys-space-8)` | | `--c-button-xs-height` | `24px` | | `--c-button-xs-padding` | `0 var(--c-sys-space-4)` | --- Document: llms/en-US/components/calendar.md # Calendar Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/calendar/__demos__/basic.vue ```vue ``` ## Views and date presentation ### Modes #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `mode` | Mode | Modes | | `modes` | Displayed mode | Modes | | `day-start-of-week` | First day of the week | Week Options | | `is-week` | Whether to show week numbers | Week Options | - `mode`: Mode - `modes`: Displayed mode Example source: src/calendar/__demos__/modes.vue ```vue ``` ### Week Options Preview configuration: `:day-start-of-week="mondayFirst ? 1 : 0"`, `:is-week="showWeek"`. Example source: src/calendar/__demos__/week-options.vue ```vue ``` ## Interaction and customization ### Controlled Example source: src/calendar/__demos__/controlled.vue ```vue ``` ### Custom Cell Example source: src/calendar/__demos__/custom-cell.vue ```vue ``` ### Custom Header Example source: src/calendar/__demos__/custom-header.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ------------------------- | -------------------- | ----------------------- | :-----------------: | | model-value **(v-model)** | Bound value | `date` | `-` | | default-value | Default value (uncontrolled state) | `date` | `-` | | mode | Mode | `'month' \| 'year'` | `-` | | default-mode | Default Mode | `'month' \| 'year'` | `'month'` | | modes | Displayed mode | `('month' \| 'year')[]` | `['month', 'year']` | | day-start-of-week | First day of the week | `0 \| 1` | `0` | | is-week | Whether to show week numbers | `boolean` | `false` | ### `` Events | Event | Description | Arguments | | ------------ | -------------------- | ------------ | | change | Emitted when the selected date changes | date: `Date` | | panel-change | Emitted when the displayed date panel changes | date: `Date` | ### `` Slots | Slot | Description | Arguments | Version | | ------- | :--------------: | --------------------------------------------------- | :----- | | header | Custom header content | year: `number`
month: `number` | 2.53.0 | | default | Custom cell content | year: `number`
month: `number`
date: `number` | 2.53.0 | ### Type definitions The component exports the following types ```ts import type { CalendarInstance } from "@cedar-design/ui"; ``` --- Document: llms/en-US/components/card.md # Card Source changes synchronously invalidate render generations. Close, row direction, newer work, deactivation or disposal prevent old nextTick/timer/double-frame continuations from changing newer phases. Render/timer deliveries consume once. Recheck lifecycle/request/node after geometry hooks to reject reentrant disposal. Suspension cancels both timers and retained close/click input is inert; activation starts a fresh phase from current props without replay, and initial KeepAlive activation does not duplicate the wait. ## Basic examples ### Basic usage and subtitle Example source: src/card/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title | Appearance configuration comparison, Hover style | | `description` | Description | Appearance configuration comparison | | `hoverable` | Hover style | Hover style | Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/card/__demos__/appearance-lab.vue ```vue ``` ### Hover style Example source: src/card/__demos__/hoverable.vue ```vue ``` ## Layout and arrangement ### Images and directions #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `direction` | Order of cover and body, default column; supports row, column and row-reverse. Does not position the card itself | Images and directions | | `title` | Title | Images and directions | | `src` | Cover image URL; cover slot takes precedence | Images and directions | | `alt` | Image alternative text | Images and directions | | `image-height` | Image height; numbers use px | Images and directions | | `image-width` | Image width; numbers use px | Images and directions | Example source: src/card/__demos__/image.vue ```vue ``` ## Content and presentation ### Long title and tooltip Example source: src/card/__demos__/tooltip.vue ```vue ``` ## Customization and slots ### Custom header #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title | Custom header | | `top-divider` | Top divider | Content slots | | `bottom-divider` | Bottom divider | Content slots | Example source: src/card/__demos__/no-padding.vue ```vue ``` ### Content slots Example source: src/card/__demos__/slots.vue ```vue ``` ## Interaction and control ### Ripple and click #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title | Ripple and click, Floating and close | | `ripple` | Click ripple | Ripple and click | | `floating` | Fullscreen state; supports v-model:floating | Floating and close | | `floating-duration` | Fullscreen transition duration in ms | Floating and close | Example source: src/card/__demos__/ripple.vue ```vue ``` ### Floating and close Example source: src/card/__demos__/floating.vue ```vue ``` ## Lifecycle and edge cases ### Floating scheduler lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `floating` | Fullscreen state; supports v-model:floating | Floating scheduler lifecycle | | `ripple` | Click ripple | Floating scheduler lifecycle | | `floating-duration` | Fullscreen transition duration in ms | Floating scheduler lifecycle | | `title` | Title | Floating scheduler lifecycle | 500ms ripple wait is interaction policy; floating-duration defaults to250ms for collapse and transition. DoubleRaf settles layout; cancellation rejects stale continuation writes, not underlying frames. Public API and CSS variables are unchanged. Full Card Cedar21/Maple44 and scoped15 each are controlled tests, not native browser/OS certification. Example source: src/card/__demos__/scheduler-lifecycle.vue ```vue ``` The same scenarios, parameters and interactions as Cedar. Only component prefixes differ; themes and site shells remain independent. ## Reading direction Headings, content and actions follow reading order. Default floating actions sit at reading end without mirroring images or custom slots. ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | variant | Appearance | `default / outline / tonal` | `default` | | size | Density; omitted value follows platform rules below | `sm / md` | `undefined` | | direction | Order of cover and body, default column; supports row, column and row-reverse. Does not position the card itself | `row / column / row-reverse` | `column` | | hoverable | Hover styling | `boolean` | `false` | | title-style | Title row styles | `CSSProperties` | `undefined` | | title | Title | `string` | `undefined` | | subtitle | Subtitle | `string` | `undefined` | | description | Description | `string` | `undefined` | | top-divider | Top divider | `boolean` | `false` | | bottom-divider | Bottom divider | `boolean` | `false` | | src | Cover image URL; cover slot takes precedence | `string` | `undefined` | | fit | Cover image fit | `fill / contain / cover / none / scale-down` | `cover` | | image-height | Image height; numbers use px | `string / number` | `undefined` | | image-width | Image width; numbers use px | `string / number` | `undefined` | | alt | Image alternative text | `string` | `undefined` | | elevation | Shadow for default variant; true means level 1, false disables it, numeric levels 0–24 | `boolean / number` | `true` | | ripple | Click ripple | `boolean` | `false` | | floating | Fullscreen state; supports v-model:floating | `boolean` | `false` | | floating-duration | Fullscreen transition duration in ms | `number` | `250` | ### Events | Event | Arguments and timing | | --- | --- | | click | `(event: Event)`, emitted when the card is clicked | | update:floating | `(value: boolean)`, emits false when the built-in close button requests closing; expansion is controlled by the parent | ### Slots | Slot | Description | Arguments | | --- | --- | --- | | default | Body | — | | cover | Cover; overrides src | — | | header | Entire header; overrides title, title-action and subtitle | — | | title | Title | `{ slotClass: string }` | | title-action | Title action | — | | subtitle | Subtitle | `{ slotClass: string }` | | description | Description | `{ slotClass: string }` | | footer | Footer actions | — | | floating-content | Expanded content; column layout only | — | | close-button | Custom close button; update floating yourself | — | ### Methods No public methods. ### Platform notes Props, event arguments and slots match. Cedar inherits the global size when size is omitted: xs/sm map to sm, all others to md. Maple falls back to md. Pass size explicitly for identical density. Themes and CSS prefixes remain platform-specific. Card no longer has a loading prop. Compose a loading overlay with the Loading directive. ### `` CSS variables | Variable | Default | | --- | --- | | `--c-card-hover-shadow` | `0 4px 12px rgb(0 0 0 / 12%)` | | `--c-card-size-sm-title-font-size` | `16px` | | `--c-card-size-sm-section-margin` | `8px 0 0` | | `--c-card-size-sm-section-padding` | `0 12px` | | `--c-card-padding` | `0 0 15px 0` | | `--c-card-background` | `var(--c-sys-color-surface-default)` | | `--c-card-filled-background` | `var(--c-sys-color-surface-muted)` | | `--c-card-outline-color` | `var(--c-sys-color-border-default)` | | `--c-card-border-radius` | `4px` | | `--c-card-image-width` | `100%` | | `--c-card-row-image-width` | `140px` | | `--c-card-image-height` | `200px` | | `--c-card-row-height` | `140px` | | `--c-card-title-color` | `var(--c-sys-color-content-primary)` | | `--c-card-title-font-size` | `20px` | | `--c-card-title-padding` | `0 12px` | | `--c-card-title-margin` | `15px 0 0 0` | | `--c-card-title-row-margin` | `12px 0` | | `--c-card-content-padding` | `0 16px` | | `--c-card-content-margin` | `16px 0 0 0` | | `--c-card-content-color` | `var(--c-sys-color-content-tertiary)` | | `--c-card-content-font-size` | `14px` | | `--c-card-content-row-margin` | `16px 0 0 0` | | `--c-card-subtitle-color` | `var(--c-sys-color-content-secondary)` | | `--c-card-subtitle-font-size` | `14px` | | `--c-card-subtitle-padding` | `0 12px` | | `--c-card-subtitle-margin` | `10px 0 0 0` | | `--c-card-subtitle-row-margin` | `-8px 0 0 0` | | `--c-card-description-color` | `var(--c-sys-color-content-secondary)` | | `--c-card-description-font-size` | `14px` | | `--c-card-description-margin` | `20px 0 0 0` | | `--c-card-description-padding` | `0 13px` | | `--c-card-footer-padding` | `0 12px` | | `--c-card-footer-right` | `13px` | | `--c-card-footer-bottom` | `9px` | | `--c-card-footer-margin` | `30px 0 0 0` | | `--c-card-line-height` | `22px` | | `--c-card-row-line-height` | `1.5` | | `--c-card-floating-buttons-bottom` | `16px` | | `--c-card-floating-buttons-right` | `16px` | | `--c-card-floating-buttons-color` | `var(--c-sys-color-content-primary)` | | `--c-card-close-button-icon-size` | `24px` | | `--c-card-close-button-size` | `56px` | | `--c-card-close-button-background` | `#212121` | | `--c-card-close-button-text-color` | `var(--c-sys-color-content-on-dark)` | | `--c-card-close-button-border-radius` | `50%` | Card colors follow system semantics: regular/filled backgrounds and borders use `surface-default`, `surface-muted` and `border-default`. Titles, body text and secondary text use `content-primary`, `content-tertiary` and `content-secondary`. Expanded floating-button containers sit on the card surface and use `content-primary`; text/icons on dark close buttons use `content-on-dark`. The `#212121` close-button background is Card-specific, not the global primary-action color. See the Design Token specification for old variable mappings. ### Type definitions The component exports the following types ```ts import type { CardProps } from '@cedar-design/ui' ``` See `API-MIGRATION.md` at the repository root for size and cross-platform migration rules. Only the documented sizes are supported, not every ComponentSize. ### Variable consumption rules Row content consumes `--c-card-content-row-margin`, independently from the title margin. Card intentionally exposes only sm/md density, not all five control sizes. Motion uses `--c-card-animation-duration` (`var(--c-sys-motion-duration-slow)`) and `--c-card-animation-easing` (`var(--c-sys-motion-easing-standard)`). Reduced motion disables transitions on every animated Card section. --- Document: llms/en-US/components/carousel.md # Carousel Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/carousel/__demos__/basic.vue ```vue ``` ## Direction and layout ### Vertical #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `slides-per-view` | Visible count; auto uses item size | Multi Slides, Centered Slides, Auto Sized | | `space-between` | Item gap; numbers/numeric strings are px | Multi Slides, Centered Slides, Auto Sized | | `draggable` | Mouse dragging, independent of touch | Multi Slides, Auto Sized | | `centered-slides` | Center active slide | centered-slides、auto-sized | | `orientation` | Horizontal/vertical axis of carousel sliding, default horizontal; does not determine indicator position | Vertical | | `model-value` | Controlled one-based slide number | Multi Slides | - `orientation`: Controls the content direction. Example source: src/carousel/__demos__/vertical.vue ```vue ``` ### Multi Slides Preview configuration: `:slides-per-view="2.5"`, `:space-between="10"`, `:model-value="current"`, `:loop="loop"`. Example source: src/carousel/__demos__/multi-slides.vue ```vue ``` ### Centered Slides Preview configuration: `:slides-per-view="1.5"`, `:space-between="10"`, `centered-slides`. Example source: src/carousel/__demos__/centered-slides.vue ```vue ``` ### Auto Sized - `height`: Constrains the component height. Example source: src/carousel/__demos__/auto-sized.vue ```vue ``` ## Navigation and effects ### Navigation #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `show-arrow` | Arrow visibility | Navigation | | `indicator-type` | Indicator appearance | Indicator style and position | | `indicator-position` | Indicator edge or outer region of the carousel container, default bottom. Not a trigger-relative popup placement | Indicator style and position | | `effect` | Effect; all supported by both libraries | Transition effects | Preview configuration: `show-arrow="always"`, `show-arrow="hover"`. Example source: src/carousel/__demos__/navigation.vue ```vue ``` ### Indicator style and position All indicator presets use the same three local slides and active-slide model. Click an indicator or a navigation arrow in any specimen: every specimen changes to the same slide. The first group compares dot, line and slider; the second compares top and outer positions. The grid stacks on narrow screens. Example source: src/carousel/__demos__/indicator-comparison.vue ```vue ``` ### Transition effects Change adjacent slides to compare fade, card and slide effects independently of autoplay and input methods. Example source: src/carousel/__demos__/effect-comparison.vue ```vue ``` ### Custom Indicator Example source: src/carousel/__demos__/custom-indicator.vue ```vue ``` ## Playback and interaction ### Forbid Loop #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `height` | Container height; numbers are px | Autoplay, Controlled, Interactive Content | | `keyboard` | Scoped arrow/Home/End navigation | Keyboard, Controlled, Interactive Content | | `auto-play` | Autoplay configuration | Autoplay, Auto Play Hover | | `draggable` | Mouse dragging, independent of touch | controlled、interactive-content | | `loop` | Loop without duplicating instances | Forbid Loop | | `trigger` | Indicator trigger | Trigger | Preview configuration: `:loop="false"`. Example source: src/carousel/__demos__/forbid-loop.vue ```vue ``` ### Autoplay - `height`: Constrains the component height. Example source: src/carousel/__demos__/autoplay.vue ```vue ``` ### Auto Play Hover Preview configuration: `:auto-play="{ interval: 2000, hoverToPause: true }"`. Example source: src/carousel/__demos__/auto-play-hover.vue ```vue ``` ### Trigger Preview configuration: `trigger="hover"`. Example source: src/carousel/__demos__/trigger.vue ```vue ``` ### Mousewheel Preview configuration: `mousewheel`. Example source: src/carousel/__demos__/mousewheel.vue ```vue ``` ### Keyboard Preview configuration: `keyboard`. Example source: src/carousel/__demos__/keyboard.vue ```vue ``` ### Change Event Example source: src/carousel/__demos__/change-event.vue ```vue ``` ### Controlled - `height`: Constrains the component height. Example source: src/carousel/__demos__/controlled.vue ```vue ``` ### Interactive Content - `height`: Constrains the component height. Example source: src/carousel/__demos__/interactive-content.vue ```vue ``` ## Lifecycle ### Scheduler Lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `auto-play` | Autoplay configuration | Scheduler Lifecycle | | `move-speed` | Explicit duration in milliseconds | Scheduler Lifecycle | | `height` | Container height; numbers are px | Scheduler Lifecycle | | `keyboard` | Scoped arrow/Home/End navigation | Scheduler Lifecycle | | `mousewheel` | Wheel navigation | Scheduler Lifecycle | - `height`: Constrains the component height. Example source: src/carousel/__demos__/scheduler-lifecycle.vue ```vue ``` ## API ### Value and default value Use ordinary `v-model`. `modelValue` is the current slide number, starting at 1. `defaultValue` initializes uncontrolled state only on creation; later changes do not reset it. An explicit bound value takes precedence. Initialization does not emit `update:modelValue`. ### Carousel Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | `model-value` | Controlled one-based slide number | `number` | `undefined` | | `default-value` | Uncontrolled initial index | `number` | `1` | | `loop` | Loop without duplicating instances | `boolean` | `true` | | `auto-play` | Autoplay configuration | `boolean \| number \| CarouselAutoPlayConfig` | `false` | | `move-speed` | Explicit duration in milliseconds | `number` | `undefined (token)` | | `trigger` | Indicator trigger | `click \| hover` | `click` | | `orientation` | Horizontal/vertical axis of carousel sliding, default horizontal; does not determine indicator position | `horizontal \| vertical` | `horizontal` | | `show-arrow` | Arrow visibility | `always \| hover \| never` | `always` | | `arrow-class` | Additional arrow class | `string` | `undefined` | | `indicator` | Show indicators | `boolean` | `true` | | `indicator-type` | Indicator appearance | `dot \| line \| slider` | `dot` | | `indicator-position` | Indicator edge or outer region of the carousel container, default bottom. Not a trigger-relative popup placement | `bottom \| top \| left \| right \| outer` | `bottom` | | `indicator-class` | Additional indicator class | `string` | `undefined` | | `indicator-color` | Custom indicator background | `string` | `undefined` | | `height` | Container height; numbers are px | `number \| string` | `undefined` | | `transition-timing-function` | Explicit timing function | `string` | `undefined (token)` | | `touchable` | Touch dragging | `boolean` | `true` | | `draggable` | Mouse dragging, independent of touch | `boolean` | `false` | | `mousewheel` | Wheel navigation | `boolean` | `false` | | `keyboard` | Scoped arrow/Home/End navigation | `boolean` | `false` | | `slides-per-view` | Visible count; auto uses item size | `number \| auto` | `1` | | `space-between` | Item gap; numbers/numeric strings are px | `number \| string` | `0` | | `effect` | Effect; all supported by both libraries | `slide \| fade \| card` | `slide` | | `centered-slides` | Center active slide | `boolean` | `false` | | `aria-label` | Carousel accessible name | `string` | Locale | | `previous-button-aria-label` | Previous button accessible name | `string` | Locale | | `next-button-aria-label` | Next button accessible name | `string` | Locale | ### Model and interaction Public slide numbers start at 1. Controlled actions emit update:model-value, then change(slideNumber, previousSlideNumber, isManual), and do not move until the parent accepts current. External assignments do not emit change. Method option event:false suppresses only change, not the model proposal. isManual is true for user actions and false for autoplay. loop moves existing children across boundaries without cloning component instances. Without looping or centering, the final viewport is clamped to avoid empty space; selection can move within the final visible group without moving the track. Partly visible slides remain accessible; fully offscreen slides are inert. fade displays one slide. auto uses explicit CarouselItem width horizontally or height vertically; vertical mode requires a container height. Only CarouselItem children, including those inside Vue Fragments, count as slides; comments and ordinary elements do not. auto-play=true uses 3000ms and pauses on hover; a number sets milliseconds without hover pausing; an object configures interval/hoverToPause. Focus within, dragging, hidden documents/ancestors and KeepAlive deactivation always pause playback. Reduced-motion preferences are respected. Interactive children such as inputs/buttons keep native behavior; mark custom interactive areas with data-carousel-no-drag. show-arrow=hover also shows arrows on keyboard focus. ### Events | Event | Arguments | | --- | --- | | update:model-value | slideNumber: number | | change | slideNumber: number, previousSlideNumber: number, isManual: boolean | ### Slots | Slot | Arguments | | --- | --- | | default | CarouselItem | | prev / next / indicator | { slideNumber, length, hovering, prev, next, to, resize } | ### Methods | Method | Signature | | --- | --- | | prev / next | (options?: CarouselToOptions) => void | | to | (slideNumber: number, options?: CarouselToOptions) => void | | resize | () => void | CarouselItem has no own props, events or methods. Its default slot supplies slide content. ### Types CarouselProps, CarouselItemProps, CarouselInstance, CarouselItemInstance, CarouselEmits, CarouselSlots, CarouselItemSlots, CarouselExpose, CarouselSlotScope, CarouselToOptions, CarouselChangeData, CarouselOrientation, CarouselEffect, CarouselAutoPlayConfig, CarouselArrowType, CarouselIndicatorType, CarouselIndicatorPosition, CarouselTriggerEvent. ### Style variables | Token | Default | | --- | --- | | `--c-carousel-indicator-dot-size` | `8px` | | `--c-carousel-indicator-position` | `var(--c-sys-space-4)` | | `--c-carousel-indicator-gap` | `var(--c-sys-space-3)` | | `--c-carousel-indicator-color-default` | `rgb(255 255 255 / 35%)` | | `--c-carousel-indicator-color-active` | `var(--c-sys-color-content-on-dark)` | | `--c-carousel-indicator-outer-margin-bottom` | `var(--c-sys-space-8)` | | `--c-carousel-indicator-line-width` | `20px` | | `--c-carousel-indicator-line-height` | `3px` | | `--c-carousel-indicator-line-border-radius` | `var(--c-sys-radius-sm)` | | `--c-carousel-arrow-size` | `var(--c-sys-control-height-md)` | | `--c-carousel-arrow-font-size` | `var(--c-sys-font-size-xl)` | | `--c-carousel-arrow-margin` | `var(--c-sys-space-4)` | | `--c-carousel-arrow-color` | `var(--c-sys-color-content-on-dark)` | | `--c-carousel-arrow-background` | `rgb(0 0 0 / 35%)` | | `--c-carousel-arrow-background-hover` | `rgb(0 0 0 / 55%)` | | `--c-carousel-arrow-disabled-opacity` | `0.4` | | `--c-carousel-navigation-z-index` | `10` | | `--c-carousel-transition-duration` | `var(--c-sys-motion-duration-standard)` | | `--c-carousel-transition-timing-function` | `ease` | | `--c-carousel-fade-duration` | `var(--c-sys-motion-duration-standard)` | | `--c-carousel-card-duration` | `var(--c-sys-motion-duration-standard)` | | `--c-carousel-card-scale` | `0.85` | | `--c-carousel-card-opacity` | `0.6` | | `--c-carousel-focus-width` | `2px` | | `--c-carousel-focus-offset` | `2px` | | `--c-carousel-focus-color` | `var(--c-sys-color-content-brand)` | ### Loop transition boundaries Each slide always has one component instance. Ordinary previous/next navigation recycles positions after the departing slide exits. Multi-slide or centered jumps that would require one slide in two positions settle immediately without animation, cloning interactive content or queuing unlimited transitions. Fewer items than visible slides are not cloned to fill space. Accessible names follow global Locale; explicit label props take precedence. Native root listeners such as `keydown`, `mouseenter`, `mouseleave`, `focusin` and `focusout` run alongside internal navigation and autoplay pause handling. Native `.once` listeners fire once for the root element lifetime. --- Document: llms/en-US/components/cascader.md # Cascader Hierarchical option selection with single, multiple and path models. ```ts import type { CascaderProps, CascaderInstance } from "@cedar-design/ui"; ``` `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes null unchanged; omitted values preserve the existing default. Editors render null as blank without converting ordinary empty-string input to null. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. The candidate `options` prop accepts an array or `(query, { signal }) => array/Promise`. Components own loading, cancellation and stale results, and emit load-error on failure. Choice groups initialize with an empty query; searchable fields load when queries change. Root tree loaders remain independent of existing load-more child loading. ## Reading direction Inherits source dir. Child columns, expansion icons and separators follow reading direction. Horizontal keys enter loaded children or return to the parent in the visible direction, skipping disabled children; vertical keys retain logical order. Search preserves native horizontal caret editing. Path and multiple-value arrays are not reversed. Clearing the last value while closed resets navigation before reopening. ## Basic examples ### Basic usage Example source: src/cascader/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------- | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Appearance configuration comparison, Control Sizes | | `clearable` | Allow clearing; preserve disabled selections | Appearance configuration comparison, Control Sizes | | `size` | Supports all five sizes; inherits group/form settings | Control Sizes | | `variant` | filled, outline, standard; inherits InputGroup | Control Sizes | | `placeholder` | Placeholder | Control Sizes | | `multiple` | Multiple selection; enables search by default | Control Sizes | Choose an axis to compare its available values with the same content and model. Other settings remain unchanged while comparing. Example source: src/cascader/__demos__/appearance-lab.vue ```vue ``` ### Control Sizes - `size`: The size of the select - `variant`: Selects the visual variant. - `options`: Options for cascader - `placeholder`: Placeholder Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ## Selection modes and paths ### Multiple #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ---------------- | ----------------------------------------------------------------------------------- | ----------------------------------- | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Multiple, Check Strictly, Path Mode | | `placeholder` | Placeholder | Multiple, Check Strictly, Path Mode | | `multiple` | Multiple selection; enables search by default | Multiple, Check Strictly | | `default-value` | Default value (uncontrolled state) | Check Strictly, Path Mode | | `expand-trigger` | Menu / List expansion: click or hover | Check Strictly, Path Mode | | `check-strictly` | Allow parent selection; unlink parent/child checks | Check Strictly | - `options`: Options for cascader - `placeholder`: Placeholder - `multiple`: Whether it is a multi-selection state (The search is turned on by default in the multi-select mode) Example source: src/cascader/__demos__/multiple.vue ```vue ``` ### Check Strictly - `options`: Options for cascader - `placeholder`: Placeholder - `check-strictly`: Whether to enable strict selection mode - `default-value`: Default value (uncontrolled state) Example source: src/cascader/__demos__/check-strictly.vue ```vue ``` ### Path Mode - `options`: Options for cascader - `placeholder`: Placeholder - `path-mode`: Whether the value is a path - `default-value`: Default value (uncontrolled state) Example source: src/cascader/__demos__/path-mode.vue ```vue ``` ### Clearable - `options`: Options for cascader - `placeholder`: Placeholder - `clearable`: Whether to allow clear Example source: src/cascader/__demos__/clearable.vue ```vue ``` ## Search and presentation ### Filterable #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ---------------- | ----------------------------------------------------------------------------------- | ---------------------------------------- | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Filterable, Case Sensitive, Format Label | | `placeholder` | Placeholder | Filterable, Case Sensitive, Format Label | | `filterable` | Enable search | Filterable, Case Sensitive | | `case-sensitive` | Case-sensitive built-in filtering; custom filters take priority | Case Sensitive | | `format-label` | Format selected labels; use label slot for VNodes | Format Label | - `options`: Options for cascader - `placeholder`: Placeholder - `filterable`: Whether to allow searching Example source: src/cascader/__demos__/filterable.vue ```vue ``` ### Case Sensitive - `options`: Options for cascader - `filterable`: Whether to allow searching - `placeholder`: Placeholder Example source: src/cascader/__demos__/case-sensitive.vue ```vue ``` ### Format Label - `options`: Options for cascader - `placeholder`: Placeholder - `format-label`: Format display content Example source: src/cascader/__demos__/format-label.vue ```vue ``` ## Interaction and control ### Interaction state comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------------------- | ---------------------------- | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Interaction state comparison | | `clearable` | Allow clearing; preserve disabled selections | Interaction state comparison | | `disabled` | Whether disabled | Interaction state comparison | Toggle the state, interact with the component, and restore editing using the controls outside the specimen. Error appearance alone does not run validation. Example source: src/cascader/__demos__/state-lab.vue ```vue ``` ## Configuration and composition ### Passthrough Options #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | | `edit-mode` | Presentation | Passthrough Options, Copying and editing | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Passthrough Options, Copying and editing | | `trigger-props` | Menu Trigger props; field owns open state | Passthrough Options | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | Copying and editing | | `filterable` | Enable search | Copying and editing | - `open`: Whether to show the dropdown - `options`: Options for cascader - `trigger-props`: Trigger props of the drop-down menu Example source: src/cascader/__demos__/passthrough-options.vue ```vue ``` ### Copying and editing With open-trigger-target="icon", use the input area to edit or copy and the suffix button to open. Existing text remains copyable when editing or search is disabled. Example source: src/cascader/__demos__/open-trigger-target.en-US.vue ```vue ``` ## Async loading and value resolution ### Loading #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------------------- | --------------------------------- | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | Loading, Load More, Async Devices | | `placeholder` | Placeholder | Loading, Load More, Async Devices | | `loading` | Loading state; blocks selection and confirmation | Loading, Async Devices | | `load-more` | Load children asynchronously; call done(children), or done() to allow retry | Load More | | `path-mode` | Return a complete path instead of a node value | Async Devices | | `filterable` | Enable search | Async Devices | - `options`: Options for cascader - `placeholder`: Placeholder - `loading`: Whether it is loading state Example source: src/cascader/__demos__/loading.vue ```vue ``` ### Load More - `options`: Options for cascader - `placeholder`: Placeholder - `load-more`: Data lazy loading function, open the lazy loading function when it is passed in Example source: src/cascader/__demos__/load-more.vue ```vue ``` ### Async Devices - `options`: Options for cascader - `loading`: Whether it is loading state - `path-mode`: Whether the value is a path - `filterable`: Whether to allow searching Example source: src/cascader/__demos__/async-devices.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Cascader props Use `v-model`, `v-model:open` and `v-model:input-value` for controlled state. Clear values are `''` for single selection and `[]` for multiple selection. Select uses `undefined` when an actual empty-string option exists. | Prop | Description | Type | Default | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- | ------------------------------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value / default-value` | Controlled value / uncontrolled initial value | `Value` | `Single: ''; multiple: []` | | `open / default-open` | Controlled / initial open state | `boolean` | `undefined / false` | | `input-value / default-input-value` | Search text, independent of selected values | `string` | `undefined / ''` | | `multiple` | Multiple selection; enables search by default | `boolean` | `false` | | `size` | Supports all five sizes; inherits group/form settings | `ComponentSize` | `md` | | `variant` | filled, outline, standard; inherits InputGroup | `FormControlVariant` | `filled` | | `disabled / readonly / error` | Inherits form state unless explicitly overridden | `boolean` | `undefined` | | `placeholder` | Placeholder | `string` | `—` | | `hint / line` | Floating hint / standard variant underline | `boolean` | `true` | | `text-color / focus-color / blur-color` | Field colors | `string` | `—` | | `loading` | Loading state; blocks selection and confirmation | `boolean` | `false` | | `show-tags` | Show tags; false displays separated text | `boolean` | `true` | | `separator` | Separator when show-tags=false | `string` | `,` | | `text-align` | Text alignment: left / center / right. Inherits FormItem content-align when unset; standalone fields default to inline start | `'left' \| 'center' \| 'right'` | `-` | | `max-tag-count` | Maximum visible tags; 0 means unlimited | `number` | `0` | | `tag-nowrap` | Keep tags on one line with ellipsis and preserved removal icons; overflow scrolls horizontally; hover, focus or tap truncated text to preview it | `boolean` | `false` | | `popup-container` | Selector, element, element resolver, or false for inline rendering | `PopupContainer` | `—` | | `trigger-props` | Menu Trigger props; field owns open state | `TriggerProps` | `—` | | `virtual-list-props` | Pass the virtual list attribute, pass in this parameter to turn on virtual scrolling [VirtualListProps](#VirtualListProps) | `VirtualListProps` | `—` | | `search-delay` | Search debounce delay in ms | `number` | `500` | | `format-label` | Format selected labels; use label slot for VNodes | `function` | `—` | | `clearable` | Allow clearing; preserve disabled selections | `boolean` | `false` | | `options` | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | `CascaderOption[]` / `(query, { signal }) => Array / Promise` | `undefined` | | `field-names` | Map value, label, disabled, children, isLeaf, tagProps, render | `CascaderFieldNames` | `—` | | `path-mode` | Return a complete path instead of a node value | `boolean` | `false` | | `check-strictly` | Allow parent selection; unlink parent/child checks | `boolean` | `false` | | `filterable` | Enable search | `boolean` | `Single: false; multiple: true` | | case-sensitive | Case-sensitive built-in filtering; custom filters take priority | boolean | false | | `filter-option` | Receives query and raw node | `(input, option) => boolean` | `—` | | `expand-trigger` | Menu / List expansion: click or hover | `string` | `click` | | `expand-child` | Expand to first child | `boolean` | `false` | | `load-more` | Load children asynchronously; call done(children), or done() to allow retry | `(option, done) => void` | `—` | | `fallback-option` | Display unresolved values | `boolean or (value) => string` | `true` | | `search-option-only-label` | Show node label only in search results | `boolean` | `false` | | `auto-fit-popup-width` | Match Menu width to field | `boolean` | `false` | | `edit-mode` | Presentation | `menu` | `menu` | ### Events and methods - `update:modelValue`, `change(value)`: emitted on commit, not while editing a draft. - `update:open`, `open-change(open)`: request an expanded-state change. - `update:inputValue`, `input-value-change(text)`, `search(text)`: search state. - `focus(event)`, `blur(event)`, `clear(event)`: native field events; only the field owner notifies Form. - Methods: `focus()`, `blur()`. ### Slots and option data Use `label({ data })` for custom `selected` labels; `selected` replaces the whole selection area. Also supports `prefix`, `suffix`, `clear-icon({ clear })`, `arrow-icon`, `loading-icon`, `search-icon`, `empty`, and `option({ data })`. Option `label` is searchable plain text. Use `render` or the `option` slot for custom `option` content, and `format-label` or `label` slot for selected content. Values identify selections; labels never do. `disabled` blocks selection/removal, and `tagProps` customizes selected tags. ### `` Props | Parameter | Description | Type | Default | | ------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------: | | path-mode | Return a complete path instead of a node value | `boolean` | `false` | | multiple | Multiple selection; enables search by default | `boolean` | `false` | | model-value **(v-model)** | Bound value | `string\| number\| Record\| ( \| string \| number \| Record \| (string \| number \| Record)[] )[]\| undefined` | `-` | | default-value | Default value (uncontrolled state) | `string\| number\| Record\| ( \| string \| number \| Record \| (string \| number \| Record)[] )[]\| undefined` | `'' \| undefined \| []` | | options | Tree options; leaf values must be unique in scalar mode; paths distinguish branches | `CascaderOption[]` / `(query, { signal }) => Array / Promise` | `undefined` | | expand-trigger | Menu / List expansion: click or hover | `string` | `'click'` | | check-strictly | Allow parent selection; unlink parent/child checks | `boolean` | `false` | | load-more | Load children asynchronously; call done(children), or done() to allow retry | `( option: CascaderOption, done: (children?: CascaderOption[]) => void) => void` | `-` | | field-names | Customize fields in `CascaderOption`; when option `value` is an object, `value` is also used as the key property | `CascaderFieldNames` | `-` | | expand-child | Expand to first child | `boolean` | `false` | ### `` Events | Event | Description | Arguments | | ------ | --------------------------------------- | -------------------------------------------------------------------------------------- | | change | Emitted when the selected value changes | value: `string \| number \| (string \| number \| (string \| number)[])[] \| undefined` | ### `` Slots | Slot | Description | Arguments | | ----- | :---------------------------------------------: | --------- | | empty | Content displayed when no options are available | - | ### CascaderOption | Parameter | Description | Type | Default | | --------- | ------------------------------------- | ----------------------------------------- | :-----: | | value | Option value | `string \| number \| Record` | `-` | | label | Option text | `string` | `-` | | render | Custom render function | `RenderFunction` | `-` | | disabled | Whether disabled | `boolean` | `false` | | tagProps | Property used for the displayed label | `TagProps` | `-` | | children | Child options | `CascaderOption[]` | `-` | | isLeaf | Whether this is a leaf node | `boolean` | `false` | ## Type definitions The component exports the following types ```ts import type { CascaderProps } from "@cedar-design/ui"; ``` ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. Field editing uses edit-mode: Cedar supports direct/click/dblclick, and Maple supports direct/popup. The old menu/list/picker editing values are not retained. Popup editors reuse the existing option index, search, asynchronous loading and virtual-list algorithms. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. ### Single-selection checkmark variables | Variable | Default | | ------------------------------- | ----------------------------------- | | `--c-cascader-item-check-color` | `var(--c-sys-color-action-primary)` | | `--c-cascader-item-check-size` | `var(--c-sys-font-size-md)` | ### Built-in search fields `searchFields` / `search-fields` is a readonly `('label' | 'value')[]`, defaulting to `['label']`. Multiple fields use OR matching, case-insensitive by default. `['value', 'label']` searches codes and names; fieldNames maps semantic fields to business fields. An empty array matches no items for a nonempty query. Values are compared as strings; object traversal, object values and pinyin matching require a custom callback. A custom callback takes precedence and decides case handling itself. Remote results use the existing protocol for disabling local filtering. Cascader retains path semantics and checks the configured fields on each path node. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. The `options` prop accepts an array or `(query, { signal }) => array/Promise`. The component manages loading, cancellation and stale-result isolation; failures emit load-error. Single/multiple groups initialize with an empty-string query, searchable fields reload when the query changes, and root loading for tree fields remains independent of existing load-more child loading. --- Document: llms/en-US/components/checkbox.md # Checkbox Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Reading direction Checkbox labels and groups follow source dir without reversing value arrays. Space keeps its toggle meaning; disabled and readonly behavior remains effective. Changing direction does not select or clear options. ## Basic examples ### Basic usage Preview configuration: `value="1"`. Example source: src/checkbox/__demos__/basic.vue ```vue ``` ## Groups and layout ### Option declaration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------------------- | ----------------------------------- | | `value` | Option identifier in array/group mode | Option declaration comparison, Grid | | `disabled` | Disabled state; inherits from the form/group when omitted | Grid | Compare child-component declarations with options data. Both use a group model; field mapping and asynchronous data are separate. Example source: src/checkbox/__demos__/group-declaration-comparison.vue ```vue ``` ### Grid - `disabled`: Prevents user interaction. Example source: src/checkbox/__demos__/grid.vue ```vue ``` ### Group State Preview configuration: `:default-value="['a']"`, `:options="options"`, `:readonly="readonly"`, `:model-value="[]"`. Example source: src/checkbox/__demos__/group-state.vue ```vue ``` ## Options and value model ### Control Value #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | --------------------------------------------------------- | ------------------------------ | | `default-value` | Initial uncontrolled value | Control Value, Controlled Mode | | `value` | Option identifier in array/group mode | Control Value | | `readonly` | Readonly state; inherits from the form/group when omitted | Control Value | | `disabled` | Disabled state; inherits from the form/group when omitted | Control Value | - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/checkbox/__demos__/control-value.vue ```vue ``` ### Option Data Preview configuration: `:options="options"`, `:field-names="fields"`, `orientation="vertical"`, `:options="renderOptions"`. Example source: src/checkbox/__demos__/option-data.vue ```vue ``` ### Controlled Mode Preview configuration: `:model-value="true"`, `:model-value="checked2"`, `:default-value="true"`. Example source: src/checkbox/__demos__/controlled-mode.vue ```vue ``` ## Selection and bulk actions ### Max Checked #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | --------------------------------------------------------- | ----------------------------------------- | | `value` | Option identifier in array/group mode | Max Checked, Checked All Indeterminate | | `disabled` | Disabled state; inherits from the form/group when omitted | Max Checked, Interaction state comparison | | `indeterminate` | Whether to display an indeterminate state | Checked All Indeterminate | | `readonly` | Readonly state; inherits from the form/group when omitted | Interaction state comparison | | `error` | Error state; inherits from the form/group when omitted | Interaction state comparison | - `disabled`: Prevents user interaction. Example source: src/checkbox/__demos__/max-checked.vue ```vue ``` ### Checked All Indeterminate Preview configuration: `:model-value="checkedAll"`, `:indeterminate="indeterminate"`, `value="1"`, `value="2"`. Example source: src/checkbox/__demos__/checked-all-indeterminate.vue ```vue ``` ### Group Methods Preview configuration: `:options="reverse ? [...options].reverse() : options"`, `:max="4"`, `orientation="vertical"`. Example source: src/checkbox/__demos__/group-methods.vue ```vue ``` ### Interaction state comparison Toggle the state, interact with the component, and restore editing using the controls outside the specimen. Error appearance alone does not run validation. Example source: src/checkbox/__demos__/state-lab.vue ```vue ``` ## Control and slot customization ### Native Control #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | --------------------------------------------------------- | ---------------- | | `name` | Native field name; inherits from Group when omitted | Native Control | | `indeterminate` | Whether to display an indeterminate state | Native Control | | `aria-label` | Accessible name when no visible label exists | Native Control | | `default-value` | Initial uncontrolled value | Native Control | | `readonly` | Readonly state; inherits from the form/group when omitted | Native Control | | `disabled` | Disabled state; inherits from the form/group when omitted | Native Control | - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/checkbox/__demos__/native-control.vue ```vue ``` ### Checked Custom Preview configuration: `:default-value="['1']"`, `value="1"`, `:model-value="checked"`, `value="2"`. Example source: src/checkbox/__demos__/checked-custom.vue ```vue ``` ### Custom Control Preview configuration: `:icon-size="28"`, `checked-color="#137547"`, `unchecked-color="#656565"`, `icon-size="1.5rem"`. Example source: src/checkbox/__demos__/custom-control.vue ```vue ``` ## Async options ### Async Options Preview configuration: `edit-mode="direct"`, `:options="options"`, `:max="2"`. Example source: src/checkbox/__demos__/async-options.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. `ChoiceValue = string | number | boolean`;`CheckboxModel = boolean | ChoiceValue[]`;`RadioModel = ChoiceValue | null`。 ### Checkbox Props | Prop | Description | Type | Default | | ---------------------- | --------------------------------------------------------------- | ------------------------ | --------- | | model-value (v-model) | Controlled value | boolean \| ChoiceValue[] | undefined | | default-value | Initial uncontrolled value | boolean \| ChoiceValue[] | false | | value | Option identifier in array/group mode | string\|number\|boolean | true | | disabled | Disabled state; inherits from the form/group when omitted | boolean | undefined | | readonly | Readonly state; inherits from the form/group when omitted | boolean | undefined | | error | Error state; inherits from the form/group when omitted | boolean | undefined | | indeterminate | Whether to display an indeterminate state | boolean | false | | checked-color | Instance checked color; error/disabled states take precedence | string | undefined | | unchecked-color | Instance unchecked color; error/disabled states take precedence | string | undefined | | icon-size | Numbers are px; strings are CSS lengths | number \| string | undefined | | ripple | Whether to enable ripple feedback | boolean | true | | uninject-group-context | Ignore surrounding CheckboxGroup; form state still applies | boolean | false | | name | Native field name; inherits from Group when omitted | string | undefined | | aria-label | Accessible name when no visible label exists | string | undefined | ### Checkbox Events | Event | Description | Arguments | | ------------------ | --------------------------------- | ----------------------------------- | | update:model-value | Proposes a new value | value: CheckboxModel | | change | Value change | value: CheckboxModel, event?: Event | | click | Click; not emitted while disabled | event: MouseEvent | | focus | Focus | event: FocusEvent | | blur | Blur | event: FocusEvent | ### Checkbox Methods | Method | Arguments | Returns | | ------ | ---------------------- | ------- | | toggle | checked?: boolean | void | | focus | options?: FocusOptions | void | | blur | - | void | ### Checkbox Slots | Slot | Description | Arguments | | ------------------ | ----------------------------------------- | ----------------------------------------------------------- | | checkbox | Customize the complete control appearance | checked: boolean, disabled: boolean, indeterminate: boolean | | checked-icon | Checked icon | - | | unchecked-icon | Unchecked icon | - | | indeterminate-icon | Half icon | - | | default | Label | checked: boolean | ### CheckboxGroup Props | Prop | Description | Type | Default | | --------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------ | | model-value (v-model) | Controlled value | ChoiceValue[] | undefined | | default-value | Initial uncontrolled value | ChoiceValue[] | [] | | max | Maximum selection count | number | undefined | | options | Options; replaces default slot when supplied | Array> / `(query, { signal }) => Array / Promise` | `undefined` | | orientation | Horizontal/vertical arrangement of checkbox-group options, default horizontal; not text reading direction | Orientation | 'horizontal' | | disabled | Disabled state; inherits from the form/group when omitted | boolean | undefined | | readonly | Readonly state; inherits from the form/group when omitted | boolean | undefined | | error | Error state; inherits from the form/group when omitted | boolean | undefined | | field-names | Option field mapping | ChoiceFieldNames | undefined | | name | Native input name within the group | string | undefined | | aria-label | Accessible group name | string | undefined | ### CheckboxGroup Methods | Method | Arguments | Returns | | ---------- | --------- | ------------- | | checkAll | - | ChoiceValue[] | | inverseAll | - | ChoiceValue[] | ### CheckboxGroup Events | Event | Description | Arguments | | ------------------ | ------------------------------------ | -------------------------------------------------- | | update:model-value | Proposes a new value | value: (string \| number \| boolean)[] | | change | Value change; notified once by Group | value: (string \| number \| boolean)[], ev?: Event | ### CheckboxGroup Slots | Slot | Description | Arguments | | -------- | ---------------------- | -------------------------------------- | | checkbox | Custom checkbox | checked: boolean
disabled: boolean | | label | Checkbox label content | data: CheckboxOption, checked: boolean | ### CheckboxOption | Field | Description | Type | | ------------- | -------------------------------- | -------------------------------------------------------------------- | | value | Option identity | ChoiceValue | | label | Label or render function | VNodeChild \| (data: CheckboxOption, checked: boolean) => VNodeChild | | disabled | Disable interaction | boolean | | readonly | Read-only interaction | boolean | | indeterminate | Display-only indeterminate state | boolean | ## Type definitions The component exports the following types ```ts import type { CheckboxProps } from "@cedar-design/ui"; ``` ### ChoiceFieldNames `{ label?: string; value?: string; disabled?: string; readonly?: string; indeterminate?: string }` Exported types:`CheckboxOption`、`ChoiceFieldNames`。 Public method type:`CheckboxGroupMethods`;`CheckboxGroupInstance` includes these methods. ### Reduced motion Built-in CSS transitions follow `prefers-reduced-motion: reduce`. Removing transitions does not change final visibility, selected/expanded state or event semantics. Applications control custom animations inside slots. ### Style variables | Variable | Default | | ---------------------------------------- | -------------------------------------- | | `--c-checkbox-control-color` | `var(--c-sys-color-content-secondary)` | | `--c-checkbox-control-color-checked` | `var(--c-sys-color-content-brand)` | | `--c-checkbox-mark-color` | `var(--c-sys-color-surface-default)` | | `--c-checkbox-control-color-disabled` | `var(--c-sys-color-content-disabled)` | | `--c-checkbox-control-color-error` | `var(--c-sys-color-content-danger)` | | `--c-checkbox-control-size` | `14px` | | `--c-checkbox-label-text-color` | `var(--c-sys-color-content-primary)` | | `--c-checkbox-label-text-color-disabled` | `var(--c-sys-color-content-disabled)` | | `--c-checkbox-label-font-size` | `var(--c-font-size-body-3)` | | `--c-checkbox-label-gap` | `var(--c-spacing-4)` | | `--c-checkbox-action-padding` | `5px` | | `--c-checkbox-group-gap` | `var(--c-spacing-7)` | | `--c-checkbox-animation-duration` | `var(--c-transition-duration-3)` | ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. The `options` prop accepts an array or `(query, { signal }) => array/Promise`. The component manages loading, cancellation and stale-result isolation; failures emit load-error. Single/multiple groups initialize with an empty-string query, searchable fields reload when the query changes, and root loading for tree fields remains independent of existing load-more child loading. --- Document: llms/en-US/components/col.md # Col 24-column Flex layout. Row manages gutters and alignment; Col manages spans, offsets, ordering and breakpoints. Use Grid for CSS Grid collapse and suffix items. > **Choosing a layout** > > - Grid + GridItem: Use for form columns and card grids with consistent column widths, spans, responsive column counts, or collapsed rows and suffix items. > - Row + Col: Use for 24-column Flex layouts that need horizontal/vertical alignment, wrapping control, fixed and flexible widths together, or responsive ordering. Row controls the row; Col controls width, offset and order. > - Space: Use for simple groups of buttons, tags or text that only need spacing, direction and alignment. Use native Flex for more flexible width allocation. ## Basic examples ### Span and offset Example source: src/col/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Flexible ratios and fixed widths #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `flex` | Ratio, fixed length or CSS flex value | Flexible ratios and fixed widths | | `xs` | Responsive span or object containing span, offset and order | Responsive objects and visibility | | `sm` | Responsive span or object containing span, offset and order | Responsive objects and visibility | | `md` | Responsive span or object containing span, offset and order | Responsive objects and visibility | | `span` | Column span; 0 hides | Responsive objects and visibility | Example source: src/col/__demos__/flex.vue ```vue ``` ### Responsive objects and visibility Example source: src/col/__demos__/responsive.vue ```vue ``` ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | span | Column span; 0 hides | `number` | `24` | | offset | Offset; 0 resets | `number` | `undefined` | | order | Order; 0 resets | `number` | `undefined` | | xs | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | sm | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | md | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | lg | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | xl | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | xxl | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | flex | Ratio, fixed length or CSS flex value | `number / string` | `undefined` | ### Events | Event | Description | | --- | --- | | click | Native MouseEvent, emitted once per click | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | The order example restores every column to `order: 0` when reverse is turned off. Responsive breakpoints use the browser viewport rather than the demo card width; widening the card alone does not activate a breakpoint. `span: 0` hides a column, and a matching larger breakpoint can restore it. ## Content and presentation ### Ordering and resetting to zero #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `span` | Column span; 0 hides | Ordering and resetting to zero | | `order` | Order; 0 resets | Ordering and resetting to zero | Example source: src/col/__demos__/order.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | span | Column span; 0 hides | `number` | `24` | | offset | Offset; 0 resets | `number` | `undefined` | | order | Order; 0 resets | `number` | `undefined` | | xs | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | sm | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | md | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | lg | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | xl | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | xxl | Responsive span or object containing span, offset and order | `number / ColSizeDescriptor` | `undefined` | | flex | Ratio, fixed length or CSS flex value | `number / string` | `undefined` | ### Events | Event | Description | | --- | --- | | click | Native MouseEvent, emitted once per click | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | The order example restores every column to `order: 0` when reverse is turned off. Responsive breakpoints use the browser viewport rather than the demo card width; widening the card alone does not activate a breakpoint. `span: 0` hides a column, and a matching larger breakpoint can restore it. ## Responsiveness and accessibility Breakpoints use the browser viewport: xs is the base; sm ≥576, md ≥768, lg ≥992, xl ≥1200 and xxl ≥1600px. Configured values resolve downward from the largest matching breakpoint. SSR starts with xs and responds to the viewport after mounting. Grid collapsing and dynamic ordering are calculated after mounting. These layout containers add no keyboard shortcuts; callers supply content semantics and focusable elements. There are no public methods or dedicated theme tokens. ## Imports Grid contains only Grid.Item. Row and Col are independent components with their own source, styles, navigation, documentation and demos. Grid.Row/Grid.Col, Row/Col re-exports from Grid and GridRowInstance/GridColInstance are removed. Import them from the library root or separate row/col entries. Installing Grid no longer registers Row/Col automatically. --- Document: llms/en-US/components/collapse.md # Collapse Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:default-value="['1', 2]"`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`, `:name="2"`. Example source: src/collapse/__demos__/basic.vue ```vue ``` ## Appearance and states ### Disabled Preview configuration: `:default-value="[1]"`, `title="Beijing Toutiao Technology Co., Ltd."`, `:name="1"`, `:disabled="disabled"`. Example source: src/collapse/__demos__/disabled.vue ```vue ``` ## Layout and arrangement ### Nested #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Uncontrolled initial expanded names | Nested, Icon Position | | `destroy-on-hide` | Destroy content when hidden | Nested | | `offset` | Gap between expanded panels | Offset | | `expand-icon-position` | Expand-icon position within the header: left or right, default left. Does not control content expansion direction | Icon Position | | `show-expand-icon` | Whether to show expansion icons; child items decide when omitted | Icon Position | Preview configuration: `:default-value="['1', 2]"`, `destroy-on-hide`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`. Example source: src/collapse/__demos__/nested.vue ```vue ``` ### Offset Preview configuration: `:offset="offset"`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`, `name="2"`. Example source: src/collapse/__demos__/offset.vue ```vue ``` ### Icon Position Preview configuration: `:default-value="['1']"`, `:expand-icon-position="position"`, `:show-expand-icon="!hideIcon"`, `title="Beijing Toutiao Technology Co., Ltd."`. Example source: src/collapse/__demos__/icon-position.vue ```vue ``` ## Content and presentation ### Accordion #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Uncontrolled initial expanded names | Accordion, Borders and dividers, Expand Icon | | `accordion` | Accordion mode; at most one open panel | Accordion | | `bordered` | Whether to show border | Borders and dividers | | `divider` | Show dividers | Borders and dividers | | `destroy-on-hide` | Destroy content when hidden | Destroy | Preview configuration: `:default-value="[1]"`, `accordion`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`. Example source: src/collapse/__demos__/accordion.vue ```vue ``` ### Borders and dividers Compare outer borders and separators between panels, including their appearance while expanded. Example source: src/collapse/__demos__/border-comparison.vue ```vue ``` ### Extra Preview configuration: `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`, `:name="2"`, `name="3"`. Example source: src/collapse/__demos__/extra.vue ```vue ``` ### Expand Icon Preview configuration: `:default-value="['1', 2]"`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`, `:name="2"`. Example source: src/collapse/__demos__/expand-icon.vue ```vue ``` ### Destroy Preview configuration: `:default-value="['1', 2]"`, `destroy-on-hide`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`. Example source: src/collapse/__demos__/destroy.vue ```vue ``` ## Customization and slots ### Custom #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Uncontrolled initial expanded names | Custom | | `bordered` | Whether to show border | Custom | Preview configuration: `:default-value="['1', 2]"`, `:bordered="false"`, `title="Beijing Toutiao Technology Co., Ltd."`, `name="1"`. Example source: src/collapse/__demos__/custom.vue ```vue ``` ## Interaction and control ### Toggle All Preview configuration: `title="Panel 1"`, `name="1"`, `title="Panel 2"`, `name="2"`. Example source: src/collapse/__demos__/toggle-all.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Titles and expanded content inherit reading direction without changing expansion state. The left/right values of expand-icon-position remain physical sides. Custom expansion graphics are not additionally mirrored. ## API The main value uses ordinary `v-model`: `modelValue` is an array of expanded panel names, including in accordion mode. `defaultValue` initializes uncontrolled state only on creation; later changes do not reset it. Initialization does not emit `update:modelValue`. When `modelValue` is provided, the parent controls the state and its value is authoritative. ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | model-value | Expanded names; v-model | `(string \| number)[]` | `—` | | default-value | Uncontrolled initial expanded names | `(string \| number)[]` | `[]` | | accordion | Accordion mode; at most one open panel | `boolean` | `false` | | show-expand-icon | Whether to show expansion icons; child items decide when omitted | `boolean` | `—` | | expand-icon-position | Expand-icon position within the header: left or right, default left. Does not control content expansion direction | `'left' \| 'right'` | `'left'` | | bordered | Whether to show border | `boolean` | `true` | | divider | Show dividers | `boolean` | `true` | | offset | Gap between expanded panels | `boolean` | `false` | | destroy-on-hide | Destroy content when hidden | `boolean` | `false` | ### Events | Event | Description | Arguments | | --- | --- | --- | | update:model-value | Request an expanded-name update | `(string \| number)[]` | | change | Emitted when expanded panels change | `(string \| number)[]`, `Event` | ### Slots | Slot | Description | Scope | | --- | --- | --- | | default | Panel list | `—` | ### Methods | Method | Description | | --- | --- | | toggleAll | Expand or collapse all panels (no-op in accordion) | The parent `expand-icon` slot is forwarded to items that do not provide their own icon. Scope: `expanded`, `disabled`, `position`. It is not rendered on the root node. #### CollapseToggleAllOptions | Arguments | Description | Type | Default | | --- | --- | --- | --- | | expand | `'inverse'` toggles all; `boolean` expands or collapses all | `'inverse' \| boolean` | `—` | | skipDisabled | Skip disabled panels | `boolean` | `false` | ### `` Props | Parameter | Description | Type | Default | | --- | --- | --- | --- | | name **(required)** | Unique panel identifier corresponding to a value in `modelValue` | `string \| number` | `—` | | title | Panel title | `string` | `—` | | disabled | Whether disabled | `boolean` | `false` | | show-expand-icon | Whether to show an expansion icon | `boolean` | `true` | | destroy-on-hide | Destroy content when hidden | `boolean` | `false` | ### `` Slots | Slot | Description | Arguments | | --- | --- | --- | | title | Panel title | `—` | | extra | Extra content | `—` | | expand-icon | Expand icon | expanded: `boolean`
disabled: `boolean`
position: `'left' \| 'right'` | | default | Panel content | `—` | ### Type definitions The component exports the following types. `Collapse.Item` and `CollapseItem` refer to the same component. ```ts import type { CollapseInstance, CollapseToggleAllOptions, ExpandIconPosition } from '@cedar-design/ui' ``` ## Color variables Collapse public color variables default to system semantics consistently in Cedar and Maple: | Variable | Default semantic value | | --- | --- | | `--c-collapse-border-color` | `--c-sys-color-border-default` | | `--c-collapse-title-bg` | `--c-sys-color-surface-default` | | `--c-collapse-title-bg-active` | `--c-sys-color-surface-default` | | `--c-collapse-title-bg-disabled` | `--c-sys-color-surface-default` | | `--c-collapse-title-text-color` | `--c-sys-color-content-primary` | | `--c-collapse-title-text-color-disabled` | `--c-sys-color-content-disabled` | | `--c-collapse-content-text-color` | `--c-sys-color-content-primary` | | `--c-collapse-content-text-color-disabled` | `--c-sys-color-content-disabled` | | `--c-collapse-content-bg` | `--c-sys-color-surface-muted` | | `--c-collapse-expand-icon` | `var(--c-sys-color-content-secondary)` | | `--c-collapse-item-border-color` | `--c-sys-color-border-default` | ### Reduced motion Built-in CSS transitions follow `prefers-reduced-motion: reduce`. Removing transitions does not change final visibility, selected/expanded state or event semantics. Applications control custom animations inside slots. --- Document: llms/en-US/components/color-picker.md # Color Picker Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `default-value`: Default value (uncontrolled state) Example source: src/color-picker/__demos__/basic.vue ```vue ``` ## Appearance and states ### Disabled #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Default | Disabled | | `disabled` | Disabled | Disabled | | `hide-trigger` | Panel only, without a trigger | Disabled | | `show-text` | Show color value | Disabled | - `default-value`: Default value (uncontrolled state) - `disabled`: disabled - `hide-trigger`: There is no trigger element, only the color panel is displayed - `show-text`: Show color value Example source: src/color-picker/__demos__/disabled.vue ```vue ``` ## Content and presentation ### Colors #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Default | Colors | | `history-colors` | History colors | Colors | | `show-history` | Show history colors | Colors | | `show-preset` | Show preset colors | Colors | - `default-value`: Default value (uncontrolled state) - `history-colors`: Color array of historical colors - `show-history`: Show history colors - `show-preset`: Show preset colors Example source: src/color-picker/__demos__/colors.vue ```vue ``` ## Data and options ### Format #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-value` | Default | Format | | `format` | Color value format | Format | | `show-text` | Show color value | Format | | `hide-trigger` | Panel only, without a trigger | Format | - `default-value`: Default value (uncontrolled state) - `format`: Color value format - `show-text`: Show color value - `hide-trigger`: There is no trigger element, only the color panel is displayed Example source: src/color-picker/__demos__/format.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | --- | --- | --- | --- | | model-value **(v-model)** | Bound value | `string` | `-` | | default-value | Default | `string` | `-` | | format | Color value format | `'hex' \| 'rgb'` | `-` | | size | Size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | | show-text | Show color value | `boolean` | `false` | | show-history | Show history colors | `boolean` | `false` | | show-preset | Show preset colors | `boolean` | `false` | | disabled | Disable interaction | `boolean` | `false` | | disabled-alpha | Disable alpha | `boolean` | `false` | | hide-trigger | Panel only, without a trigger | `boolean` | `true` | | history-colors | History colors | `string[]` | `-` | | preset-colors | Preset colors | `string[]` | `-` | ### Existing precedence of forwarded configuration (F07) Existing triggerProps are spread after some internal Trigger settings, so nested fields such as disabled can currently override internal values. F07 preserves this order and type for compatibility; it does not apply AutoComplete managed-field rules, promise a new safe subset or automatically prohibit these existing capabilities. Dragging uses the control owner view. KeepAlive deactivation or unmount ends the gesture and releases its listeners; a new activation requires a new gesture, and callbacks from old gestures cannot change its value. --- Document: llms/en-US/components/color.md # Color Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `show-text`: Show color value Example source: src/color/__demos__/basic.vue ```vue ``` ## Appearance and states ### Size #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ---------------- | ---------------- | | `size` | Size | Size | | `show-text` | Show color value | Size | - `size`: ComponentSize - `show-text`: Show color value Example source: src/color/__demos__/size.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Arguments | Description | Type | Default | | -------------------- | ------------------------ | ---------------------------- | ------- | | `model-value` | Bound value | `string` | `-` | | `format` | Color format | `hex \| rgb` | `-` | | `size` | Size | `xs \| sm \| md \| lg \| xl` | `md` | | `show-text` | Show color value | `boolean` | `false` | | `show-history` | Show history colors | `boolean` | `false` | | `show-preset` | Show preset colors | `boolean` | `false` | | `disabled` | Disable interaction | `boolean` | `false` | | `disabled-alpha` | Disable alpha | `boolean` | `false` | | `color-picker-props` | Forwarded to ColorPicker | `object` | `{}` | ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. Dragging uses the control owner view. KeepAlive deactivation or unmount ends the gesture and releases its listeners; a new activation requires a new gesture, and callbacks from old gestures cannot change its value. --- Document: llms/en-US/components/config-provider.md # Config Provider Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `size`: ComponentSize Example source: src/config-provider/__demos__/basic.vue ```vue ``` ## API ### ConfigProvider Props | Prop | Description | Type | Default | | ---- | -------- | ------ | ------ | | dir | Reading direction; inherits the source scope when omitted. Physical left/right placements keep their meaning. | `ReadingDirection` (`ltr` / `rtl`) | — | | type | Argument type | string | - | ### ConfigProvider Events | Event | Description | Arguments | | ------ | -------------- | ----------------------------- | | click | Click event | `(event: MouseEvent) => void` | ### ConfigProvider Slots | Slot | Description | | ------- | -------------- | | default | Custom default content | ## Type definitions The component exports the following types ```ts import type { ConfigProviderProps } from '@cedar-design/ui' ``` ## Reading direction Use `` to scope right-to-left layout. Omit `dir` to inherit, or nest `dir="ltr"` for a local override. Native DOM `dir` containers work too. The provider renders a `display: contents` div to carry direction to ordinary descendants without adding a layout box; place it in an HTML context that permits a div. It does not change the document direction. The former boolean `rtl` option is replaced by `dir` before release. Physical left/right placements retain their meaning. --- Document: llms/en-US/components/count-to.md # Count To Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:to="123456"`. Example source: src/count-to/__demos__/basic.vue ```vue ``` ## Content and presentation ### Precision, duration and easing #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `to` | Target value | Precision, duration and easing | | `precision` | Decimal precision | Precision, duration and easing | | `duration` | Animation duration in milliseconds | Precision, duration and easing | | `timing-function` | Animation easing function | Precision, duration and easing | Compare final precision and the effect of duration and easing on number transitions. Manual playback remains separate. Example source: src/count-to/__demos__/number-format-comparison.vue ```vue ``` ## Customization and slots ### Custom Preview configuration: `:to="123456"`. Example source: src/count-to/__demos__/custom.vue ```vue ``` ## Interaction and control ### Manual #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `to` | Target value | Manual | | `auto-start` | Whether to start animation automatically | Manual | Preview configuration: `:to="123456"`, `:auto-start="false"`. Example source: src/count-to/__demos__/manual.vue ```vue ``` ## API ### CountTo Props | Prop | Description | Type | Default | | ----------------- | ------------------------ | ------------------------ | -------- | | from | Start value | _number \| string_ | `0` | | to | Target value | _number \| string_ | `0` | | duration | Animation duration in milliseconds | _number \| string_ | `2000` | | precision | Decimal precision | _number \| string_ | `0` | | auto-start | Whether to start animation automatically | _boolean_ | `true` | | timing-function | Animation easing function | _(v: number) => number_ | `-` | ### CountTo Events | Event | Description | Callback arguments | | ------ | -------------- | -------- | | end | Triggered when animation ends | `-` | ### CountTo Slots | Slot | Description | Arguments | | ------- | ---------- | ----------------- | | default | Custom content | `value: number` | ### CountTo Methods | Method | Description | Arguments | Returns | | ------ | ---------------------------------------------------------------- | ---- | ------ | | start | Start the animation | `-` | `-` | | pause | Pause the animation | `-` | `-` | | reset | Reset the animation; when `auto-start` is `true`, playback starts automatically after reset | `-` | `-` | ## Type definitions The component exports the following types ```ts import type { CountToProps, CountToInstance } from '@cedar-design/ui' ``` ### Style variables | Variable | Default | | ----------------------------- | -------------------------- | | `--c-count-to-text-color` | `var(--c-sys-color-content-primary)` | | `--c-count-to-text-font-size` | `var(--c-font-size-lg)` | ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. Animation pauses on unmount and KeepAlive deactivation and resumes on reactivation. Each instance keeps independent values and animation state. --- Document: llms/en-US/components/countdown.md # Countdown Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:time="2 * 60 * 60 * 1000"`. Example source: src/countdown/__demos__/basic.vue ```vue ``` ## Content and presentation ### Time format and custom content #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `time` | Countdown duration in milliseconds | Time format and custom content, Statistic | | `format` | Display format | Time format and custom content, Statistic | Compare unit formats, milliseconds and custom time fragments, independently of playback controls. Example source: src/countdown/__demos__/format-comparison.vue ```vue ``` ### Statistic - `format`: Controls the displayed format. Example source: src/countdown/__demos__/statistic.vue ```vue ``` ## Interaction and control ### Manual #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `time` | Countdown duration in milliseconds | Manual | | `auto-start` | Whether to auto start count down | Manual | | `format` | Display format | Manual | - `format`: Controls the displayed format. Example source: src/countdown/__demos__/manual.vue ```vue ``` ## API ### Countdown Props | Prop | Description | Type | Default | | ------------- | ------------------------------------------ | -------------------- | ------------ | | `time` | Countdown duration in milliseconds | `number \| string` | `0` | | `format` | Display format | `string` | `'HH:mm:ss'` | | `auto-start` | Whether to auto start count down | `boolean` | `true` | ### format placeholders | Format | Description | | ----- | ------------- | | `DD` | Day | | `HH` | Hour | | `mm` | Minute | | `ss` | Seconds | | `S` | Milliseconds: 1 digit | | `SS` | Milliseconds: 2 digits | | `SSS` | Milliseconds: 3 digits | ### Countdown Events | Event | Description | Arguments | | -------- | ---------------- | --------------------- | | `change` | Emitted after countdown changed | `timeData: TimeData` | | `end` | Emitted after countdown ended | `-` | ### Countdown Slots | Slot | Description | Arguments | | --------- | ---------- | --------------------- | | `default` | Custom content | `timeData: TimeData` | ### TimeData | Name | Description | Type | | -------------- | -------- | -------- | | `days` | Remain days | `number` | | `hours` | Remain hours | `number` | | `minutes` | Remain minutes | `number` | | `seconds` | Remaining seconds | `number` | | `milliseconds` | Remain milliseconds | `number` | ### Countdown Methods | Method | Description | Arguments | Returns | | ------- | ----------------------------------------------------------------- | ---- | ------ | | `start` | Start countdown | `-` | `-` | | `pause` | Pause countdown | `-` | `-` | | `reset` | Reset the countdown; when `auto-start` is `true`, it starts automatically after reset | `-` | `-` | ## Type definitions The component exports the following types ```ts import type { CountdownProps, CountdownInstance, TimeData } from '@cedar-design/ui' ``` ### Style variables | Variable | Default | | ------------------------------- | -------------------------- | | `--c-countdown-text-color` | `var(--c-sys-color-content-primary)` | | `--c-countdown-text-font-size` | `var(--c-font-size-lg)` | ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. SSR renders the initial formatted time. Changing format while paused updates the display. The finish event fires once per round; reset starts another round. Unmounting cleans up animation frames. --- Document: llms/en-US/components/date-picker.md # Date Picker Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `default-value`: Default value Example source: src/date/picker/__demos__/basic.vue ```vue ``` ## Date views and presentation ### Mode #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `type` | Panel type | Mode, Month Labels, Locale Isolation | | `disable-confirm` | Commit immediately | Month Labels, Responsive Panels | | `day-start-of-week` | First weekday, calendar only; integer 0–6 | Locale Isolation | | `show-time` | Include time selection | Responsive Panels | Preview configuration: `type="week"`, `type="month"`, `type="year"`, `type="quarter"`. Example source: src/date/picker/__demos__/mode.vue ```vue ``` ### Month Labels - `picker-value`: The date displayed in the default panel - `abbreviation`: Whether to enable abbreviation Example source: src/date/picker/__demos__/month-labels.vue ```vue ``` ### Locale Isolation - `picker-value`: The date displayed in the default panel - `day-start-of-week`: The first day of the week starts on the day of the week, 0-Sunday, 1-Monday, and so on. Example source: src/date/picker/__demos__/locale-isolation.vue ```vue ``` ### Responsive Panels - `show-time`: Whether to increase time selection - `shortcuts`: Quick selection of preset time range - `shortcuts-position`: The position of the preset range on the panel, which is placed at the bottom by default, and the side is generally used for scenes with a large number of preset times Example source: src/date/picker/__demos__/responsive-panels.vue ```vue ``` ## Time and selection rules ### Show Time #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `show-time` | Include time selection | Show Time, Disabled Parts, Time Presentation | | `format` | Display format | Show Time, Time Presentation | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Current Range, Time Presentation | | `default-value` | Uncontrolled initial value, read once | Show Time | | `disabled-date` | Return true to disable a date | Disabled Parts | | `disabled-time` | Disabled times for the current date and endpoint | Disabled Parts | - `show-time`: Whether to increase time selection - `default-value`: Default value - `format`: Display the format of the date, refer to [String Parsing Format](#string-parsing-format) Example source: src/date/picker/__demos__/show-time.vue ```vue ``` ### Disabled Parts - `disabled-date`: Unselectable date - `show-time`: Whether to increase time selection - `disabled-time`: Unselectable time Example source: src/date/picker/__demos__/disabled-parts.vue ```vue ``` ### Current Range - `value-format`: The format of the value, valid for `value` `defaultValue` `pickerValue` `defaultPickerValue` and the return value in the event, supports setting as timestamp, Date and string (refer to [String parsing format](#string-parsing-format) ). If not specified, it will be formatted as a string, in the same format as `format`. - `default-picker-value`: Date displayed on the panel - `show-now-button`: Whether to display the now button when showTime Example source: src/date/picker/__demos__/current-range.vue ```vue ``` ### Time Presentation - `model-value`: Value - `show-time`: Whether to increase time selection - `format`: Display the format of the date, refer to [String Parsing Format](#string-parsing-format) - `value-format`: The format of the value, valid for `value` `defaultValue` `pickerValue` `defaultPickerValue` and the return value in the event, supports setting as timestamp, Date and string (refer to [String parsing format](#string-parsing-format) ). If not specified, it will be formatted as a string, in the same format as `format`. Example source: src/date/picker/__demos__/time-presentation.vue ```vue ``` ## Shortcuts and customization ### Short Cuts #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `disable-confirm` | Commit immediately | Panel Tools, Entry Boundary | | `show-time` | Include time selection | Short Cuts | | `day-start-of-week` | First weekday, calendar only; integer 0–6 | Entry Boundary | - `shortcuts`: Quick selection of preset time range - `show-time`: Whether to increase time selection Example source: src/date/picker/__demos__/short-cuts.vue ```vue ``` ### Footer Preview configuration: `showTime`. Example source: src/date/picker/__demos__/footer.vue ```vue ``` ### Panel Tools - `picker-value`: The date displayed in the default panel - `shortcuts`: Quick selection of preset time range Example source: src/date/picker/__demos__/panel-tools.vue ```vue ``` ### Entry Boundary - `min`: Sets the lower bound. - `max`: Sets the upper bound. - `day-start-of-week`: The first day of the week starts on the day of the week, 0-Sunday, 1-Monday, and so on. Example source: src/date/picker/__demos__/entry-boundary.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"`, including runtime changes and local overrides. Calendar dates, months and years follow reading order; navigation icons mirror, while date values keep their meaning. In paged grids, Left/Right moves focus visually, Up/Down moves one row, and Home/End moves to the row boundary, skipping disabled items. Focus navigation does not select; Enter/Space keeps the existing selection behavior. Navigation is bounded by the displayed grid. Explicit `shortcuts-position="left|right"` remains physical; `bottom` stays below. Field popovers inherit their source direction. ## API ### Props Pure panels do not accept field/popup props such as open/default-open, popup-container, placement, trigger-props, placeholder, variant or clearable. Configure popups through Date/DateRange popup-props, and typing through input-editable. disable-confirm alone controls confirmation tools; show-confirm-btn is removed. | Arguments | Description | Type | Default | | ------------------- | ------------------------------- | ------------------------------------------ | ------- | | `model-value` | Bound value | `Date \| string \| number` | `-` | | `type` | Panel type | `date \| week \| month \| year \| quarter` | `date` | | `format` | Display format | `string \| Function` | `-` | | `day-start-of-week` | First weekday, calendar only; integer 0–6 | `DateWeekStart` | `0` | | `readonly` | Readonly; does not change selection | `boolean` | `false` | | `time-picker-props` | Local time-panel display options | `Partial` | `-` | | `show-time` | Include time selection | `boolean` | `false` | | `disabled` | Disable interaction | `boolean` | `false` | | `disabled-date` | Return true to disable a date | `Function` | `-` | Desktop calendar capabilities, including shortcuts, footer and cell slots, remain in a separate presentation implementation. ### Shared date-family contract | Arguments | Description | Type | Default | | ----------------- | ------------------------------------------------------- | ------------------------------------------------ | ------- | | `default-value` | Uncontrolled initial value, read once | DateValue / DateValue[] | — | | `value-format` | Model and event value format: a date format string, Date, or timestamp | string | Follows type | | `min` / `max` | Inclusive bounds; string bounds use value-format | DateValue | — | | `disabled-time` | Disabled times for the current date and endpoint | (date: Date, side: DateSide) => DateDisabledTime | — | | `disable-confirm` | Commit immediately | boolean | true | `DateValue = Date | string | number`. Clearing a single value produces undefined; clearing a range produces []. The date argument of `disabledDate(date, side)` and `disabledTime(date, side)` is always a Date; side is start/end. Time callbacks return numeric lists from `disabledHours()`, `disabledMinutes(hour)` and `disabledSeconds(hour, minute)`. Invalid dates and incomplete/reversed ranges cannot be committed. Confirmation revalidates dynamic disabling rules. Locked range endpoints cannot be cleared or changed. Nested panel props configure presentation only; they must not override top-level model-value, format, bounds, disabling rules or control events. ### Events | Event | Description | Arguments | | -------------------- | ----------------------- | --------------------------------- | | `update:model-value` | Request a model update | value | | `select` | Select a draft; does not imply submission | value, date(s), formatted text(s) | | `change` | Committed value changes | value, date(s), formatted text(s) | | `confirm` | Confirm valid selection; does not use ok | value, date(s), formatted text(s) | Set `:disable-confirm="false"` to show confirmation tools. The `actions` slot provides `{ confirm, disabled }`; custom `actions` must still call confirm to validate. --- Document: llms/en-US/components/date-range.md # DateRange A date range field. The bound model is an array; use DateRangePicker for a standalone panel. ## String range models Set format="MM-DD" and value-format="MM-DD" to get ['09-10', '10-10'] directly. These values have no year; parsing uses the current year and cannot preserve cross-year ordering. For real bookings store YYYY-MM-DD and map the payload in application code. format only changes display, while value-format changes the model and events. Without time-zone the browser-local time zone remains in effect. An explicit IANA time zone changes the civil-time interpretation of strings; Date/timestamp values preserve their instant. Editing one endpoint does not change an untouched endpoint's repeated-hour occurrence or milliseconds. ## Basic examples ### Basic Example source: src/date-range/__demos__/basic.vue ```vue ``` ### Interaction state comparison Toggle disabled, read-only and error states, then interact with the same instance. Recovery controls remain outside the target; error appearance alone does not validate data.
Configuration details and limits #### State Lab ## Appearance and date presentation ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | ---------------------------------------------------------------------- | ----------------------------------- | | `clearable` | Show the clear action | Mode, Separator | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Appearance configuration comparison | | `type` | Mode | Mode | | `separator` | Range separator | Separator | | `placeholder` | Placeholder | Separator | Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/date-range/__demos__/appearance-lab.vue ```vue ``` ### Mode Example source: src/date-range/__demos__/mode.vue ```vue ``` ### Separator Example source: src/date-range/__demos__/separator.vue ```vue ``` ## Time and range rules ### Show Time #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ---------------------------------------------------------------------- | --------------------- | | `format` | Display format | Show Time, Boundaries | | `show-time` | Include time selection | Show Time | | `clearable` | Show the clear action | Show Time | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Boundaries | | `disabled-date` | Return true to disable a date | Boundaries | Example source: src/date-range/__demos__/show-time.vue ```vue ``` ### Boundaries Example source: src/date-range/__demos__/boundaries.vue ```vue ``` ## Value model and text input ### String Values #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | ---------------------------------------------------------------------- | ------------------------- | | `format` | Display format | String Values, Text Entry | | `value-format` | Model and event value format: a date format string, Date, or timestamp | String Values | | `disabled` | Disable interaction | Text Entry | Example source: src/date-range/__demos__/en-US/string-values.vue ```vue ``` ### Text Entry Example source: src/date/picker/__demos__/text-entry.vue ```vue ``` ## Interaction and field configuration ### Api Review #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------------------- | ---------------------------------------------------------------------------- | ----------------------------------- | | `open` | Controlled popup visibility | Rejected Close, Passthrough Options | | `date-range-picker-props` | Panel presentation options | Field Panel Tools, Entry Boundary | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Api Review | | `readonly` | Read-only interaction | Api Review | | `format` | Display format | Field Panel Tools | | `popup-props` | Trigger presentation options; cannot override owned visibility or date rules | Passthrough Options |
Example source: src/date-range/__demos__/state-lab.vue ```vue ``` ### Rejected Close Example source: src/date-range/__demos__/rejected-close.vue ```vue ``` ### Field Panel Tools Example source: src/date-range/__demos__/field-panel-tools.vue ```vue ``` ### Entry Boundary Example source: src/date-range/__demos__/entry-boundary.vue ```vue ``` ### Passthrough Options Example source: src/date-range/__demos__/passthrough-options.vue ```vue ``` ### Props | Arguments | Description | Type | Default | | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | --------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value` | Bound value | `(Date \| string \| number)[]` | `-` | | `type` | Date precision | `date \| week \| month \| year \| quarter` | `date` | | `open` | Controlled popup visibility | `boolean` | `-` | | `clearable` | Show the clear action | `boolean` | `true` | | `disabled` | Disable interaction | `boolean \| boolean[]` | `-` | | `readonly` | Read-only interaction | `boolean` | `false` | | `size` | Component size | `xs \| sm \| md \| lg \| xl` | `-` | | `variant` | Field appearance | `filled \| outline \| standard` | `filled` | | `separator` | Range separator | `string` | `-` | | `placeholder` | Placeholder | `string[]` | `-` | | `disabled-date` | Return true to disable a date | `Function` | `-` | | `format` | Display format | `string` | `-` | | `show-time` | Include time selection | `boolean` | `false` | | `date-range-picker-props` | Panel presentation options | `DateRangePickerOptions` | `{}` | #### Copying and editing With open-trigger-target="icon", use the input area to edit or copy and the suffix button to open. Existing text remains copyable when editing or search is disabled. Example source: src/date-range/__demos__/open-trigger-target.en-US.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## Reading direction Range values remain `[start, end]` across direction changes; switching direction neither swaps endpoints nor commits drafts. Range ribbons and boundary corners follow reading order. Paged calendar grids use visual Left/Right focus movement and chronological rows. Maple endpoint editing and continuous range highlighting are separate presentations. Explicit shortcut positions `left/right` remain physical, and popovers inherit their source direction. ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Arguments | Description | Type | Default | | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | --------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value` | Bound value | `(Date \| string \| number)[]` | `-` | | `type` | Date precision | `date \| week \| month \| year \| quarter` | `date` | | `open` | Controlled popup visibility | `boolean` | `-` | | `clearable` | Show the clear action | `boolean` | `true` | | `disabled` | Disable interaction | `boolean \| boolean[]` | `-` | | `readonly` | Read-only interaction | `boolean` | `false` | | `size` | Size | `xs \| sm \| md \| lg \| xl` | `-` | | `variant` | Field appearance | `filled \| outline \| standard` | `filled` | | `separator` | Range separator | `string` | `-` | | `placeholder` | Placeholder | `string[]` | `-` | | `disabled-date` | Return true to disable a date | `Function` | `-` | | `format` | Display format | `string` | `-` | | `show-time` | Include time selection | `boolean` | `false` | | `date-range-picker-props` | Panel presentation options | `DateRangePickerOptions` | `{}` | ### Shared date-family contract | Arguments | Description | Type | Default | | ----------------- | ----------------------------------------------------------------------------- | -------------------------------------------------- | ------------ | | `default-value` | Uncontrolled initial value, read once | DateValue / DateValue[] | — | | `value-format` | Model and event value format: a date format string, Date, or timestamp | string | Follows type | | `min` / `max` | Inclusive bounds; string bounds use value-format | DateValue | — | | `disabled-time` | Disabled times for the current date and endpoint | (date: Date, side: DateSide) => DateDisabledTime | — | | `disable-confirm` | Commit immediately | boolean | false | | `default-open` | Uncontrolled initial open state | boolean | false | | `popup-props` | Trigger presentation options; cannot override owned visibility or date rules | object | {} | | `popup-container` | Portal target; the top-level value wins, including false for inline rendering | string / HTMLElement / (() => HTMLElement) / false | — | `DateValue = Date | string | number`. Clearing a single value produces undefined; clearing a range produces []. The date argument of `disabledDate(date, side)` and `disabledTime(date, side)` is always a Date; side is start/end. `disabled-date` restricts range endpoints. A range may cross disabled interior values; it is not scanned item by item or truncated automatically. This applies to dates, months and years. Interior disabled values remain gray. Changing pages preserves the selected start and clears hover preview; reverse selection is sorted chronologically. Time callbacks return numeric lists from `disabledHours()`, `disabledMinutes(hour)` and `disabledSeconds(hour, minute)`. Invalid dates and incomplete/reversed ranges cannot be committed. Confirmation revalidates dynamic disabling rules. Locked range endpoints cannot be cleared or changed. Nested panel props configure presentation only; they must not override top-level model-value, format, bounds, disabling rules or control events. ### Events | Event | Description | Arguments | | ----------------------------- | ----------------------------------------- | --------------------------------- | | `update:model-value` | Request a model update | value | | `select` | Select a draft; does not imply submission | value, date(s), formatted text(s) | | `change` | Committed value changes | value, date(s), formatted text(s) | | `update:open` / `open-change` | Popup visibility changes | open: boolean | | `clear` | Clear the selection | None | | `focus` / `blur` | Focus enters or leaves the whole field | None | | `click` | Click the field | event | Desktop supports keyboard editing. The default panel edits a draft before confirmation; disable-confirm commits directly. Escape or closing discards the draft. focus(index = 0) focuses a start/end input, and blur() closes the popup. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. --- Document: llms/en-US/components/date.md # Date Floating date panels use the visual viewport height so the full calendar is visible when space permits. Short windows scroll content while keeping actions visible. Override `--c-date-picker-popover-max-height` to adjust the limit (default `100dvh - 32px`). A date field with a trigger. Use DatePicker for a standalone panel. ## String models and time zones format controls display; value-format controls the model and events. Use YYYY-MM-DD for a date string or YYYY-MM for a month string. MM-DD has no year and parsing uses the current year, so retain a full date for cross-year ordering or explicit leap-year rules. Omitting time-zone preserves browser-local behavior. With an IANA time zone, Date and timestamps represent instants while strings represent local civil times in that zone. Invalid DST times are rejected; newly entered repeated times resolve to the first occurrence. Untouched Date/timestamp range endpoints preserve their exact instant and hidden precision. Maple-only scroll/line views do not change Cedar panel defaults. ## Basic examples ### Basic Example source: src/date/__demos__/basic.vue ```vue ``` ### Interaction state comparison Toggle disabled, read-only and error states, then interact with the same instance. Recovery controls remain outside the target; error appearance alone does not validate data.
Configuration details and limits #### State Lab ## Appearance and date presentation ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | ---------------------------------------------------------------------- | ----------------------------------------------------- | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Appearance configuration comparison, Locale Isolation | | `type` | Type | Type, Locale Isolation | | `size` | Size | Control Sizes | | `variant` | Field appearance | Control Sizes | | `placeholder` | Placeholder | Control Sizes | | `clearable` | Show the clear action | Type | Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/date/__demos__/appearance-lab.vue ```vue ``` ### Control Sizes Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ### Type Example source: src/date/__demos__/type.vue ```vue ``` ### Month Labels Example source: src/date/picker/__demos__/month-labels.vue ```vue ``` ### Locale Isolation Example source: src/date/picker/__demos__/locale-isolation.vue ```vue ``` ## Time and selection rules ### Show Time #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | ---------------------------------------------------------------------- | ---------------- | | `show-time` | Include time selection | Show Time | | `format` | Display format | Show Time | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Show Time | | `clearable` | Show the clear action | Show Time | Example source: src/date/__demos__/show-time.vue ```vue ``` ### Time Presentation Example source: src/date/picker/__demos__/time-presentation.vue ```vue ``` ## Value model and text input ### Value Formats #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------------- | ---------------------------------------------------------------------- | ---------------------------------------- | | `format` | Display format | Value Formats, String Values, Text Entry | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Value Formats, String Values | | `type` | Type | String Values, Period Text | | `date-picker-props` | Panel presentation options | Period Text | Example source: src/date/__demos__/value-formats.vue ```vue ``` ### String Values Example source: src/date/__demos__/en-US/string-values.vue ```vue ``` ### Period Text Example source: src/date/picker/__demos__/period-text.vue ```vue ``` ### Text Entry Example source: src/date/picker/__demos__/text-entry.vue ```vue ``` ## Interaction and field configuration ### Api Review #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------------- | ---------------------------------------------------------------------- | ----------------------------------- | | `disabled` | Disable interaction | Api Review, Field Protocol | | `open` | Controlled popup visibility | Rejected Close, Passthrough Options | | `date-picker-props` | Panel presentation options | Field Panel Tools, Entry Boundary | | `placeholder` | Placeholder | Field Protocol, Entry Boundary | | `value-format` | Model and event value format: a date format string, Date, or timestamp | Api Review | | `readonly` | Read-only interaction | Api Review |
Example source: src/date/__demos__/state-lab.vue ```vue ``` ### Rejected Close Example source: src/date/__demos__/rejected-close.vue ```vue ``` ### Field Panel Tools Example source: src/date/picker/__demos__/field-panel-tools.vue ```vue ``` ### Field Protocol Example source: src/date/__demos__/field-protocol.vue ```vue ``` ### Entry Boundary Example source: src/date/picker/__demos__/entry-boundary.vue ```vue ``` ### Passthrough Options Example source: src/date/__demos__/passthrough-options.vue ```vue ``` ### Props | Arguments | Description | Type | Default | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | --------------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value` | Bound value | `Date \| string \| number` | `-` | | `type` | Date precision | `date \| week \| month \| year \| quarter` | `date` | | `open` | Controlled popup visibility | `boolean` | `-` | | `clearable` | Show the clear action | `boolean` | `true` | | `disabled` | Disable interaction | `boolean` | `false` | | `readonly` | Read-only interaction | `boolean` | `false` | | `size` | Component size | `xs \| sm \| md \| lg \| xl` | `-` | | `variant` | Field appearance | `filled \| outline \| standard` | `filled` | | `placeholder` | Placeholder | `string` | `-` | | `disabled-date` | Return true to disable a date | `Function` | `-` | | `format` | Display format | `string \| Function` | Depends on type | | `show-time` | Include time selection | `boolean` | `false` | | `date-picker-props` | Panel presentation options | `DatePickerOptions` | `{}` | #### Copying and editing With open-trigger-target="icon", use the input area to edit or copy and the suffix button to open. Existing text remains copyable when editing or search is disabled. Example source: src/date/__demos__/open-trigger-target.en-US.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## Reading direction Inherits the nearest `dir="ltr|rtl"`, including runtime changes and local overrides. Calendar dates, months and years follow reading order; navigation icons mirror, while date values keep their meaning. In paged grids, Left/Right moves focus visually, Up/Down moves one row, and Home/End moves to the row boundary, skipping disabled items. Focus navigation does not select; Enter/Space keeps the existing selection behavior. Navigation is bounded by the displayed grid. Explicit `shortcuts-position="left|right"` remains physical; `bottom` stays below. Field popovers inherit their source direction. ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Arguments | Description | Type | Default | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value` | Bound value | `Date \| string \| number` | `-` | | `type` | Date precision | `date \| week \| month \| year \| quarter` | `date` | | `open` | Controlled popup visibility | `boolean` | `-` | | `clearable` | Show the clear action | `boolean` | `true` | | `disabled` | Disable interaction | `boolean` | `false` | | `readonly` | Read-only interaction | `boolean` | `false` | | `size` | Size | `xs \| sm \| md \| lg \| xl` | `-` | | `variant` | Field appearance | `filled \| outline \| standard` | `filled` | | `placeholder` | Placeholder | `string` | `-` | | `disabled-date` | Return true to disable a date | `Function` | `-` | | `format` | Display format | `string \| Function` | Follows `type` | | `show-time` | Include time selection | `boolean` | `false` | | `date-picker-props` | Panel presentation options | `DatePickerOptions` | `{}` | ### Shared date-family contract | Arguments | Description | Type | Default | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ------------ | | `default-value` | Uncontrolled initial value, read once | DateValue / DateValue[] | — | | `value-format` | Model and event value format: a date format string, Date, or timestamp | string | Follows type | | `min` / `max` | Inclusive bounds; string bounds use value-format | DateValue | — | | `disabled-time` | Disabled times for the current date and endpoint | (date: Date, side: DateSide) => DateDisabledTime | — | | `disable-confirm` | Commit immediately | boolean | false | | `default-open` | Uncontrolled initial open state | boolean | false | | `popup-props` | Optional field-popup presentation settings. Placement defaults to bottom-start and is positioned automatically by the underlying Trigger; the preferred side can be overridden. No top-level placement prop; field state and rules cannot be overridden | object | {} | | `popup-container` | Portal target; the top-level value wins, including false for inline rendering | string / HTMLElement / (() => HTMLElement) / false | — | `DateValue = Date | string | number`. Clearing a single value produces undefined; clearing a range produces []. The date argument of `disabledDate(date, side)` and `disabledTime(date, side)` is always a Date; side is start/end. Time callbacks return numeric lists from `disabledHours()`, `disabledMinutes(hour)` and `disabledSeconds(hour, minute)`. Invalid dates and incomplete/reversed ranges cannot be committed. Confirmation revalidates dynamic disabling rules. Locked range endpoints cannot be cleared or changed. Nested panel props configure presentation only; they must not override top-level model-value, format, bounds, disabling rules or control events. ### Events | Event | Description | Arguments | | ----------------------------- | ----------------------------------------- | --------------------------------- | | `update:model-value` | Request a model update | value | | `select` | Select a draft; does not imply submission | value, date(s), formatted text(s) | | `change` | Committed value changes | value, date(s), formatted text(s) | | `update:open` / `open-change` | Popup visibility changes | open: boolean | | `clear` | Clear the selection | None | | `focus` / `blur` | Focus enters or leaves the whole field | None | | `click` | Click the field | event | Desktop supports keyboard editing. The default panel edits a draft before confirmation; disable-confirm commits directly. Escape or closing discards the draft. focus(index = 0) focuses a start/end input, and blur() closes the popup. ## Explicit time zones `timeZone` accepts IANA names such as `Asia/Shanghai`. Date objects and millisecond timestamps represent instants; strings represent local time in the target zone. Display, typed input, min/max, shortcuts and disabling rules use the same protocol; event Date objects retain the actual instant. Omitting `timeZone` preserves local-zone behavior. Nonexistent daylight-saving times and invalid zones cannot be committed; repeated times use the first occurrence. Maple scroll / line are mobile calendar presentations; desktop retains its existing panel. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. ### Placement semantics and configuration The Date field prefers bottom-start below its input. Override the preferred side through popupProps.placement only when needed; the underlying Trigger positions it, not Popup or Popover. DatePicker is a standalone date panel with no input anchor; placement in the legacy date/picker directory is not a current public DatePicker prop. --- Document: llms/en-US/components/descriptions.md # Descriptions Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `data`: Supplies the example data. Example source: src/descriptions/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Label Text Alignment #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `data` | Description-list data | Label Text Alignment, Layout Pattern | | `title` | Description-list title | Label Text Alignment, Layout Pattern | | `layout` | Description-list arrangement | Label Text Alignment, Layout Pattern | | `align` | Text alignment | Label Text Alignment | | `size` | Description-list size | Layout Pattern | | `bordered` | Whether to show border | Layout Pattern | - `data`: Supplies the example data. - `align`: Controls alignment on the cross axis. Example source: src/descriptions/__demos__/label-text-alignment.vue ```vue ``` ### Layout Pattern - `data`: Supplies the example data. - `size`: Controls the component size. Example source: src/descriptions/__demos__/layout-pattern.vue ```vue ``` ## Content and presentation ### Singel Column Style #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `data` | Description-list data | Singel Column Style, Border Background List | | `title` | Description-list title | Singel Column Style, Border Background List | | `column` | Items per row. Responsive configuration is supported since 2.20.0; see Grid | Singel Column Style | | `size` | Description-list size | Singel Column Style | | `bordered` | Whether to show border | Border Background List | - `data`: Supplies the example data. - `size`: Controls the component size. Example source: src/descriptions/__demos__/singel-column-style.vue ```vue ``` ### Border Background List - `data`: Supplies the example data. Example source: src/descriptions/__demos__/border-background-list.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Labels, values, borders and default text alignment follow logical reading edges. Direction changes do not reverse records, column definitions or span semantics. ## API ### `` Props | Prop | Description | Type | Default | | ------------ | ------------------------------------------------------------------ | :---------------------------------------------------------------------------------------: | :------------- | | data | Description-list data | `DescData[]` | `[]` | | column | Items per row. Responsive configuration is supported since 2.20.0; see Grid | `number \| ResponsiveValue` | `3` | | title | Description-list title | `string` | `-` | | layout | Description-list arrangement | `'horizontal' \| 'vertical' \| 'inline-horizontal' \| 'inline-vertical' \| 'inline-auto'` | `'horizontal'` | | align | Text alignment | `TextAlign \| { label?: TextAlign; value?: TextAlign }` | `'left'` | | size | Description-list size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `-` | | bordered | Whether to show border | `boolean` | `false` | | label-style | Label styles | `CSSProperties` | `-` | | value-style | Content styles | `CSSProperties` | `-` | | table-layout | Table-style `layout-fixed`; setting `fixed` distributes widths evenly | `'auto' \| 'fixed'` | `'auto'` | | aria-label | Accessible description-list label | `string` | `-` | ### `` Slots | Slot | Description | Arguments | | ------ | :------: | ------------------------------------------------------ | | value | Content | value: `string`
index: `number`
data: `DescData` | | label | Label | label: `string`
index: `number`
data: `DescData` | | title | Title | - | ### `` Props | Prop | Description | Type | Default | | ----- | -------- | :------: | :----- | | span | Column span | `number` | `1` | | label | Label | `string` | `-` | ### `` Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | default | Content | - | | label | Label | - | ### DescData | Parameter | Description | Type | Default | | ------ | -------- | -------------------------- | :----: | | label | Label | `string \| RenderFunction` | `-` | | value | Data | `string \| RenderFunction` | `-` | | span | Column span | `number` | `-` | ## Type definitions The component exports the following types ```ts import type { DescriptionsProps } from "@cedar-design/ui"; ``` --- Document: llms/en-US/components/dialog.md # Dialog A modal dialog with matching declarative and programmatic APIs. ## Basic examples ### Basic Example source: src/dialog/__demos__/basic.vue ```vue ``` ## Invocation and content ### Global #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title | Confirm, Form, Simple | | `type` | Status icon: `info`, `success`, `warning` or `error` | Confirm, Simple | | `message` | Message content; the default slot is also supported | Confirm, Simple | | `before-close` | Return a boolean/Promise or call done; the first completion wins | Form | | `simple` | Compact layout with a centered footer | Simple | Example source: src/dialog/__demos__/global.vue ```vue ``` ### Alert Example source: src/dialog/__demos__/alert.vue ```vue ``` ### Confirm Example source: src/dialog/__demos__/confirm.vue ```vue ``` ### Message Example source: src/dialog/__demos__/message.vue ```vue ``` ### Form Example source: src/dialog/__demos__/form.vue ```vue ``` ### Simple Example source: src/dialog/__demos__/simple.vue ```vue ``` ## Sizing and layout ### Dialog sizing and long content #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title | No Padding, Max Height | | `body-style` | Body style | No Padding, Max Height | | `width` | Width | Dialog sizing and long content | | `fullscreen` | Fullscreen layout | Dialog sizing and long content | Open one dialog at a time to compare widths, fullscreen layouts and long-content boundaries. Example source: src/dialog/__demos__/size-comparison.vue ```vue ``` ### No Padding Example source: src/dialog/__demos__/no-padding.vue ```vue ``` ### Max Height Example source: src/dialog/__demos__/max-height.vue ```vue ``` ## Interaction and customization ### Draggable #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `unmount-on-close` | Unmount after closing | Custom Text, Advanced | | `draggable` | Draggable | Draggable | | `confirm-button-text` | Confirm button text | Custom Text | | `cancel-button-text` | Cancel button text | Custom Text | | `footer` | Whether to show the footer | Advanced | | `type` | Status icon: `info`, `success`, `warning` or `error` | Advanced | Example source: src/dialog/__demos__/draggable.vue ```vue ``` ### Custom Footer Example source: src/dialog/__demos__/custom-footer.vue ```vue ``` ### Custom Text Example source: src/dialog/__demos__/custom-text.vue ```vue ``` ### Advanced Example source: src/dialog/__demos__/advanced.vue ```vue ``` ## Async actions and closing ### Async #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `before-close` | Return a boolean/Promise or call done; the first completion wins | Async, Guard Protocol | | `title` | Title | Async | | `message` | Message content; the default slot is also supported | Async | Example source: src/dialog/__demos__/async.vue ```vue ``` ### Api Review ### Guard Protocol Example source: src/dialog/__demos__/en-US/guard-protocol.vue ```vue ``` ### `` Props | Name | Description | Type | Default | | ------------------------- | -------------------------------------------- | -------------------------------- | ------------ | | dir | Reading direction; inherits the source scope when omitted. Physical left/right placements keep their meaning. | `ReadingDirection` (`ltr` / `rtl`) | — | | `open` **(v-model)** | Visible state | `boolean` | `-` | | `default-open` | Initial uncontrolled state | `boolean` | `false` | | `title` | Title | `string` | `-` | | `message` | Message content; the default slot is also supported | `string` | `-` | | `message-align` | Message alignment | `'left' \| 'center' \| 'right'` | `'left'` | | `type` | Status icon: info, success, warning or error | `string` | `-` | | `simple` | Compact layout with a centered footer | `boolean` | `false` | | `width` | Width | `number \| string` | `-` | | `top` | Top offset; ignored when align-center is enabled | `number \| string` | `-` | | `title-align` | Title alignment | `'start' \| 'center'` | `'center'` | | `align-center` | Center vertically and horizontally | `boolean` | `true` | | `overlay` | Show overlay | `boolean` | `true` | | `overlay-class` | Overlay class | `string` | `-` | | `overlay-style` | Overlay style | `CSSProperties` | `-` | | `overlay-closable` | Request closure on an overlay click | `boolean` | `true` | | `esc-to-close` | Request closure on Escape | `boolean` | `true` | | `lock-scroll` | Lock background scrolling while open | `boolean` | `true` | | `close-on-route-change` | Close on browser history or hash changes | `boolean` | `false` | | `popup-container` | Teleport target; `false` disables teleport | `string \| HTMLElement \| false` | `'body'` | | `confirm-button` | Show the confirm button | `boolean` | `true` | | `cancel-button` | Show the cancel button | `boolean` | `true` | | `closable` | Show close button | `boolean` | `true` | | `confirm-button-text` | Confirm button text | `string` | `-` | | `cancel-button-text` | Cancel button text | `string` | `-` | | `confirm-button-loading` | Confirm button loading state | `boolean` | `false` | | `cancel-button-loading` | Cancel button loading state | `boolean` | `false` | | `confirm-button-disabled` | Disable the confirm button | `boolean` | `false` | | `cancel-button-disabled` | Disable the cancel button | `boolean` | `false` | | `confirm-button-props` | Confirm button props | `ButtonProps` | `-` | | `cancel-button-props` | Cancel button props | `ButtonProps` | `-` | | `footer` | Show the footer | `boolean` | `true` | | `dialog-class` | Dialog class | `string \| any[]` | `-` | | `dialog-style` | Dialog style | `CSSProperties` | `-` | | `body-class` | Body class | `string \| any[]` | `-` | | `body-style` | Body style | `StyleValue` | `-` | | `hide-title` | Hide the title | `boolean` | `false` | | `unmount-on-close` | Unmount after closing | `boolean` | `false` | | `draggable` | Allow dragging | `boolean` | `false` | | `fullscreen` | Fullscreen layout | `boolean` | `false` | | `overlay-animation-name` | Overlay animation name | `string` | `fade-modal` | | `dialog-animation-name` | Dialog animation name | `string` | `zoom-modal` | | `z-index` | Stack level | `number` | `-` | | `before-close` | Return a boolean/Promise or call done; the first completion wins | `DialogBeforeClose` | — | ### `` Events | Event | Description | Arguments | | ------------ | ------------- | --------------- | | `open` | Opening begins | `-` | | `opened` | Opening transition completes | `-` | | `close` | Closing begins | `-` | | `closed` | Closing transition completes | `-` | | `confirm` | Accepted confirm action | `Event` | | `cancel` | Accepted cancel or close action | `Event` | | `click-overlay` | `MouseEvent` | `MouseEvent` | | `key-escape` | ESC | `KeyboardEvent` | ### `` Slots | Slot | Description | Arguments | | --------- | ---- | ---------------------------- | | `default` | Content | `-` | | `title` | Title | `-` | | `footer` | Footer | `cancel`, `confirm`, `close` | ### DialogConfig | Name | Description | Type | | ------------- | ---------------------------------- | -------------------------- | | `content` | Renderable content; takes priority over message | `RenderContent` | | `footer` | Footer visibility or custom footer content | `boolean \| RenderContent` | | `onConfirm` | Confirm callback | `(e?: Event) => void` | | `onCancel` | Cancel callback | `(e?: Event) => void` | | `onClickOverlay` | Overlay click callback | `() => void` | | `onKeyEscape` | Escape callback | `() => void` | ### DialogMethod | Method | Description | Return value | | ---------------------------------- | ------------------------------ | -------------------------------------- | | `Dialog.open(config)` | Open a dialog | `Promise & DialogReturn` | | `Dialog.confirm(config)` | Confirmation dialog; defaults to warning | Same as above | | `Dialog.alert(config)` | Alert dialog without a cancel button | Same as above | | `Dialog.info(config)` | Information dialog | Same as above | | `Dialog.success(config)` | Success dialog | Same as above | | `Dialog.warning(config)` | Warning dialog | Same as above | | `Dialog.error(config)` | Error dialog | Same as above | | `Dialog.close()` | Close the latest functional dialog | `void` | | `Dialog.setDefaultOptions(config)` | Set default programmatic options | `void` | | `Dialog.resetDefaultOptions()` | Reset default programmatic options | `void` | ### DialogReturn | Prop | Description | | ---------------- | -------- | | `close()` | Close | | `update(config)` | Update options | ### Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Content, headings and action gaps use logical edges. Portals inherit their source direction. Direction changes preserve close, confirm, cancel and pending-state semantics. ## API details | Variable | Default | | --- | --- | | `--c-dialog-background` | `var(--c-sys-color-surface-raised)` | | `--c-dialog-overlay-background` | `var(--c-sys-color-scrim)` | | `--c-dialog-border-color` | `var(--c-sys-color-border-default)` | | `--c-dialog-border-width` | `1px` | | `--c-dialog-border-radius` | `var(--c-sys-radius-md)` | | `--c-dialog-width` | `520px` | | `--c-dialog-margin-top` | `100px` | | `--c-dialog-title-text-color` | `var(--c-sys-color-content-primary)` | | `--c-dialog-title-font-size` | `var(--c-sys-font-size-lg)` | | `--c-dialog-title-font-weight` | `var(--c-sys-font-weight-medium)` | | `--c-dialog-title-padding` | `0 var(--c-sys-space-8)` | | `--c-dialog-title-min-height` | `48px` | | `--c-dialog-title-justify` | `center` | | `--c-dialog-content-text-color` | `var(--c-sys-color-content-primary)` | | `--c-dialog-content-font-size` | `var(--c-sys-font-size-md)` | | `--c-dialog-content-line-height` | `var(--c-line-height)` | | `--c-dialog-content-padding` | `28px var(--c-sys-space-8)` | | `--c-dialog-actions-padding` | `var(--c-sys-space-7) var(--c-sys-space-8)` | | `--c-dialog-actions-button-gap` | `var(--c-sys-space-6)` | | `--c-dialog-close-button-size` | `32px` | | `--c-dialog-close-button-color` | `var(--c-sys-color-content-secondary)` | | `--c-dialog-close-button-font-size` | `var(--c-sys-font-size-lg)` | | `--c-dialog-close-button-inset-inline-end` | `var(--c-sys-space-7)` | | `--c-dialog-status-icon-size` | `18px` | | `--c-dialog-status-icon-gap` | `var(--c-sys-space-5)` | | `--c-dialog-status-info-color` | `var(--c-sys-color-content-info)` | | `--c-dialog-status-success-color` | `var(--c-sys-color-content-success)` | | `--c-dialog-status-warning-color` | `var(--c-sys-color-content-warning)` | | `--c-dialog-status-danger-color` | `var(--c-sys-color-content-danger)` | | `--c-dialog-simple-width` | `400px` | | `--c-dialog-simple-border-radius` | `var(--c-sys-radius-md)` | | `--c-dialog-simple-padding` | `28px 32px 32px` | | `--c-dialog-simple-content-gap` | `28px` | | `--c-dialog-simple-actions-gap` | `32px` | | `--c-dialog-fullscreen-width` | `100vw` | | `--c-dialog-fullscreen-height` | `100vh` | | `--c-dialog-animation-duration` | `var(--c-sys-motion-duration-slow)` | | `--c-dialog-animation-easing` | `var(--c-sys-motion-easing-standard)` | Promise and done share a single completion state: false/done(false) rejects; true/done() allows; a resolved Promise<void> allows. The first completion wins. Errors emit guard-error; cancellation/unmount invalidates late completion. Synchronous void retains the callback protocol and waits for done on these close/confirm guards. Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. ## API ### `` Props | Parameter | Description | Type | Default | | ------------------------- | -------------------------------------------- | -------------------------------- | ------------ | | dir | Reading direction; inherits the source scope when omitted. Physical left/right placements keep their meaning. | `ReadingDirection` (`ltr` / `rtl`) | — | | `open` **(v-model)** | Visible state | `boolean` | `-` | | `default-open` | Initial uncontrolled state | `boolean` | `false` | | `title` | Title | `string` | `-` | | `message` | Message content; the default slot is also supported | `string` | `-` | | `message-align` | Message alignment | `'left' \| 'center' \| 'right'` | `'left'` | | `type` | Status icon: `info`, `success`, `warning` or `error` | `string` | `-` | | `simple` | Compact layout with a centered footer | `boolean` | `false` | | `width` | Width | `number \| string` | `-` | | `top` | Top offset; ignored when `align-center` is enabled | `number \| string` | `-` | | `title-align` | Title alignment | `'start' \| 'center'` | `'center'` | | `align-center` | Center vertically and horizontally | `boolean` | `true` | | `overlay` | Show overlay | `boolean` | `true` | | `overlay-class` | Overlay class | `string` | `-` | | `overlay-style` | Overlay style | `CSSProperties` | `-` | | `overlay-closable` | Request closure on an overlay click | `boolean` | `true` | | `esc-to-close` | Request closure on Escape | `boolean` | `true` | | `lock-scroll` | Lock background scrolling while open | `boolean` | `true` | | `close-on-route-change` | Close on browser history or hash changes | `boolean` | `false` | | `popup-container` | Teleport target; `false` disables teleport | `string \| HTMLElement \| false` | `'body'` | | `confirm-button` | Show the confirm button | `boolean` | `true` | | `cancel-button` | Show the cancel button | `boolean` | `true` | | `closable` | Show close button | `boolean` | `true` | | `confirm-button-text` | Confirm button text | `string` | `-` | | `cancel-button-text` | Cancel button text | `string` | `-` | | `confirm-button-loading` | Confirm button loading state | `boolean` | `false` | | `cancel-button-loading` | Cancel button loading state | `boolean` | `false` | | `confirm-button-disabled` | Disable the confirm button | `boolean` | `false` | | `cancel-button-disabled` | Disable the cancel button | `boolean` | `false` | | `confirm-button-props` | Confirm button props | `ButtonProps` | `-` | | `cancel-button-props` | Cancel button props | `ButtonProps` | `-` | | `footer` | Whether to show the footer | `boolean` | `true` | | `dialog-class` | Dialog class | `string \| any[]` | `-` | | `dialog-style` | Dialog style | `CSSProperties` | `-` | | `body-class` | Body class | `string \| any[]` | `-` | | `body-style` | Body style | `StyleValue` | `-` | | `hide-title` | Hide the title | `boolean` | `false` | | `unmount-on-close` | Unmount after closing | `boolean` | `false` | | `draggable` | Allow dragging | `boolean` | `false` | | `fullscreen` | Fullscreen layout | `boolean` | `false` | | `overlay-animation-name` | Overlay animation name | `string` | `fade-modal` | | `dialog-animation-name` | Dialog animation name | `string` | `zoom-modal` | | `z-index` | Stack level | `number` | `-` | | `before-close` | Return a boolean/Promise or call done; the first completion wins | `DialogBeforeClose` | — | ### `` Events | Event | Description | Arguments | | ------------ | ------------- | --------------- | | `open` | When opened | `-` | | `opened` | Opening transition completes | `-` | | `close` | Closing begins | `-` | | `closed` | Closing transition completes | `-` | | `confirm` | Accepted confirm action | `Event` | | `cancel` | Accepted cancel or close action | `Event` | | `click-overlay` | `MouseEvent` | `MouseEvent` | | `key-escape` | ESC | `KeyboardEvent` | The `close` button, overlay, ESC and `close()` use `close` semantics without an additional `cancel` event. ### `` Slots | Slot | Description | Arguments | | --------- | ---- | ---------------------------- | | `default` | Content | `-` | | `title` | Title | `-` | | `footer` | Footer | `cancel`, `confirm`, `close` | Confirm and cancel buttons use Button's `default` status and `text` variant unless `confirmButtonProps` or `cancelButtonProps` overrides them. ### Global methods Function-based Dialog calls default to simple layout (`simple: true`) with the top-right close button hidden (`closable: false`). Explicit options or global defaults can override both. #### DialogConfig Accepts the component props in camelCase, plus: | Parameter | Description | Type | | ------------- | ---------------------------------- | -------------------------- | | `content` | Renderable content; takes priority over `message` | `RenderContent` | | `footer` | Whether to show a footer, or custom footer content | `boolean \| RenderContent` | | `onConfirm` | Confirm callback | `(e?: Event) => void` | | `onCancel` | Cancel callback | `(e?: Event) => void` | | `onClickOverlay` | Overlay click callback | `() => void` | | `onKeyEscape` | Escape callback | `() => void` | #### DialogMethod | Method | Description | Returns | | ---------------------------------- | ------------------------------ | -------------------------------------- | | `Dialog.open(config)` | Open a dialog | `Promise & DialogReturn` | | `Dialog.confirm(config)` | Confirmation dialog; defaults to `type: warning` | As above | | `Dialog.alert(config)` | Alert dialog without a cancel button | As above | | `Dialog.info(config)` | Information dialog | As above | | `Dialog.success(config)` | Success dialog | As above | | `Dialog.warning(config)` | Warning dialog | As above | | `Dialog.error(config)` | Error dialog | As above | | `Dialog.close()` | Close the latest functional dialog | `void` | | `Dialog.setDefaultOptions(config)` | Set default programmatic options | `void` | | `Dialog.resetDefaultOptions()` | Reset default programmatic options | `void` | #### DialogReturn | Prop | Description | | ---------------- | -------- | | `close()` | Close | | `update(config)` | Update options | After installation, call through `app.config.globalProperties.$dialog`. ### Type definitions ```ts import type { DialogAction, DialogConfig, DialogMethod, DialogReturn, DialogService, DialogType, } from "@cedar-design/ui"; ``` ### Style variables Dialog public color variables have the same meanings as Maple: `--c-dialog-background` is the raised panel background (`surface-raised`); `--c-dialog-overlay-background` is the scrim; `--c-dialog-title-text-color` and `--c-dialog-content-text-color` are primary content; `--c-dialog-close-button-color` is the secondary action. `--c-dialog-status-{info|success|warning|danger}-color` uses readable content-info/success/warning/danger, not status fills. Business themes should override these component variables; shared themes should override the corresponding system variables. Borders, widths, spacing and layout retain desktop specifications. #### Complete variable defaults The backdrop consumes `sys-color-scrim` through the Dialog component variable. Maple no longer uses Popup colors for Dialog. Set a per-instance backdrop variable via `overlay-style`; a variable on the panel (`dialog-style`) does not inherit to its sibling backdrop. Explicit `overlay-style.backgroundColor` wins. Teleported content needs variables on its actual DOM ancestors. Dark themes inherit the same semantic colors; geometry remains platform-specific. Status icons use readable content colors. Variables are grouped by purpose: background/overlay-background for panel/scrim; border-* for panel/divider borders; title-* for title typography; content-* for body typography; actions-* for actions; close-button-* for the close button; status-* for semantic icons; simple-*/fullscreen-* for mode dimensions; animation-* for enter/leave motion. width/margin-top control ordinary panel layout. Internal drag/position variables are not public customization points. | Variable | Default | | --- | --- | | `--c-dialog-background` | `var(--c-sys-color-surface-raised)` | | `--c-dialog-overlay-background` | `var(--c-sys-color-scrim)` | | `--c-dialog-border-color` | `var(--c-sys-color-border-default)` | | `--c-dialog-border-width` | `1px` | | `--c-dialog-border-radius` | `var(--c-sys-radius-md)` | | `--c-dialog-width` | `520px` | | `--c-dialog-margin-top` | `100px` | | `--c-dialog-title-text-color` | `var(--c-sys-color-content-primary)` | | `--c-dialog-title-font-size` | `var(--c-sys-font-size-lg)` | | `--c-dialog-title-font-weight` | `var(--c-sys-font-weight-medium)` | | `--c-dialog-title-padding` | `0 var(--c-sys-space-8)` | | `--c-dialog-title-min-height` | `48px` | | `--c-dialog-title-justify` | `center` | | `--c-dialog-content-text-color` | `var(--c-sys-color-content-primary)` | | `--c-dialog-content-font-size` | `var(--c-sys-font-size-md)` | | `--c-dialog-content-line-height` | `var(--c-line-height)` | | `--c-dialog-content-padding` | `28px var(--c-sys-space-8)` | | `--c-dialog-actions-padding` | `var(--c-sys-space-7) var(--c-sys-space-8)` | | `--c-dialog-actions-button-gap` | `var(--c-sys-space-6)` | | `--c-dialog-close-button-size` | `32px` | | `--c-dialog-close-button-color` | `var(--c-sys-color-content-secondary)` | | `--c-dialog-close-button-font-size` | `var(--c-sys-font-size-lg)` | | `--c-dialog-close-button-inset-inline-end` | `var(--c-sys-space-7)` | | `--c-dialog-status-icon-size` | `18px` | | `--c-dialog-status-icon-gap` | `var(--c-sys-space-5)` | | `--c-dialog-status-info-color` | `var(--c-sys-color-content-info)` | | `--c-dialog-status-success-color` | `var(--c-sys-color-content-success)` | | `--c-dialog-status-warning-color` | `var(--c-sys-color-content-warning)` | | `--c-dialog-status-danger-color` | `var(--c-sys-color-content-danger)` | | `--c-dialog-simple-width` | `400px` | | `--c-dialog-simple-border-radius` | `var(--c-sys-radius-md)` | | `--c-dialog-simple-padding` | `28px 32px 32px` | | `--c-dialog-simple-content-gap` | `28px` | | `--c-dialog-simple-actions-gap` | `32px` | | `--c-dialog-fullscreen-width` | `100vw` | | `--c-dialog-fullscreen-height` | `100vh` | | `--c-dialog-animation-duration` | `var(--c-sys-motion-duration-slow)` | | `--c-dialog-animation-easing` | `var(--c-sys-motion-easing-standard)` | ### Before-hook waiting feedback Before-hook waits show visible feedback and aria-busy. Rejected or failed operations recover; duplicate submissions do not start another copy. Notification event Promises never drive loading. Service notification callbacks do not control task completion. The selected/closed result is settled independently of callback errors, and closing completion always releases the owned host. Callback errors still propagate through the calling/Vue error path; returned Promises do not control loading or closing. --- Document: llms/en-US/components/divider.md # Divider Separate content sections in lists and layouts. ## Basic examples ### Basic Usage Separate adjacent content sections. Example source: src/divider/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Vertical Divider #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `orientation` | Horizontal/vertical orientation of the divider itself, default horizontal; does not control text alignment | Vertical Divider | | `type` | Line style | Vertical Divider | | `text-align` | Text position along the line; start/end follow logical direction | Vertical Divider | | `description` | Description text; the default slot takes priority | Vertical Divider | Set `orientation="vertical"` in a flex container with available height. Text follows the vertical direction. Example source: src/divider/__demos__/vertical.vue ```vue ``` ## Content and presentation ### Line size, style and color #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `inset` | Inset along the line: left/right horizontally, top/bottom vertically | Line size, style and color | | `spacing` | Outer spacing across the line: top/bottom horizontally, left/right vertically | Line size, style and color | | `orientation` | Horizontal/vertical orientation of the divider itself, default horizontal; does not control text alignment | Line size, style and color | | `type` | Line style | Line size, style and color | | `thickness` | Line width in px; theme defaults to 1px; hairline takes priority | Line size, style and color | | `color` | Line color; defaults to the theme border color | Line size, style and color | Compare thickness or insets, line style and color. Text and custom content remain separate.
Configuration details and limits #### Spacing & Inset Compare five presets, numbers, CSS lengths and asymmetric pairs. The vertical example shows how spacing follows orientation. #### Line Style Compare solid, dashed, dotted and double lines using `type`. Use a `thickness` of at least 3px for a visible double line. #### Color, Thickness & Opacity Customize the line using `color`, `thickness` and `opacity`. Zero opacity preserves layout; `hairline` takes priority over `thickness`.
Example source: src/divider/__demos__/line-appearance-comparison.vue ```vue ``` ### With Text Use `description` and `text-align` to position text at the start, center or end. Toggle RTL to inspect logical start/end alignment. Example source: src/divider/__demos__/with-text.vue ```vue ``` ## Customization and slots ### Custom Content #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `type` | Line style | Custom Content | | `description` | Description text; the default slot takes priority | Custom Content | The default slot takes priority over `description`. Provide padding for custom content in the caller. Example source: src/divider/__demos__/custom.vue ```vue ``` ## Interaction and control ### Live Properties #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `orientation` | Horizontal/vertical orientation of the divider itself, default horizontal; does not control text alignment | Live Properties | | `opacity` | Opacity of the entire divider, including text, from 0 to 1; zero preserves layout | Live Properties | | `hairline` | Scale the theme line width by half; 0.5px with the default theme | Live Properties | | `thickness` | Line width in px; theme defaults to 1px; hairline takes priority | Live Properties | | `inset` | Inset along the line: left/right horizontally, top/bottom vertically | Live Properties | | `spacing` | Outer spacing across the line: top/bottom horizontally, left/right vertically | Live Properties | Toggle orientation, default slot text, opacity and hairline to inspect updates and restoration. Example source: src/divider/__demos__/live-properties.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"`. Horizontal text start/end follows reading order; vertical start/end remains top/bottom. Inset controls along-line indentation and spacing controls perpendicular margins. Paired horizontal inset and vertical spacing uses logical start/end. Vertical borders use inline start; hairline, border type and aria-orientation retain their meaning. Direction changes preserve content nodes. ### Content height and minimum thickness Explicit thickness accepts finite numbers greater than or equal to 1. hairline still takes priority, using half the theme width. Values below 1 (including zero and negative values), and non-finite values, are ignored and use the theme width; development builds warn. Multiline descriptions and custom content occupy their full height, including spacing=0. Subsequent content stays below the divider. Example source: src/divider/__demos__/content-flow.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | `orientation` | Horizontal/vertical orientation of the divider itself, default horizontal; does not control text alignment | `horizontal` \| `vertical` | `horizontal` | | `type` | Line style | `solid` \| `dashed` \| `dotted` \| `double` | `solid` | | `text-align` | Text position along the line; start/end follow logical direction | `start` \| `center` \| `end` | `center` | | `description` | Description text; the default slot takes priority | `string` | — | | `inset` | Inset along the line: left/right horizontally, top/bottom vertically | `DividerSize` | — | | `spacing` | Outer spacing across the line: top/bottom horizontally, left/right vertically | `DividerSize` | `md` | | `thickness` | Line width in px; theme defaults to 1px; hairline takes priority | `number` | — | | `hairline` | Scale the theme line width by half; 0.5px with the default theme | `boolean` | `false` | | `color` | Line color; defaults to the theme border color | `string` | — | | `opacity` | Opacity of the entire divider, including text, from 0 to 1; zero preserves layout | `number` | — | ### Spacing values `DividerSize = number | string | [number | string] | [number | string, number | string]` `inset` controls the ends of the line; `spacing` controls the outer gap between the line and adjacent content. Both accept presets `xs`, `sm`, `md`, `lg`, `xl`, a number in px, a CSS length, or an array. A scalar or single-item array applies to both ends; `[start, end]` sets each end separately. Array entries are lengths, not preset names. | Direction | inset array order | spacing array order | | --- | --- | --- | | horizontal | Inline start/end inset; right/left in RTL | Top/bottom margin | | vertical | Top/bottom inset | Inline start/end margin; right/left in RTL | `inset` has no `inset` by default; `spacing` defaults to the platform’s `md` `spacing`. Presets use platform theme tokens, so pixel values may differ. Development builds diagnose invalid orientation, text-align, type, size structure, thickness and opacity. Invalid enums use their defaults; invalid inset is omitted, invalid spacing uses md, and invalid opacity is omitted. Opacity must be finite and within [0,1]. Size arrays contain one or two lengths, without preset names inside arrays. Finite negative margins and CSS var/calc expressions remain supported; the browser parses CSS expressions. ### Slots | Slot | Description | | --- | --- | | `default` | Custom divider content; overrides description | ## Type definitions ```ts import type { DividerProps, DividerInstance, DividerSize, DividerSizePreset, DividerOrientation, DividerTextAlign, DividerType } from '@cedar-design/ui' ``` ### Style variables | Variable | Default | | --- | --- | | `--c-divider-color` | `var(--c-sys-color-border-default)` | | `--c-divider-text-color` | `var(--c-sys-color-content-secondary)` | | `--c-divider-border-width` | `1px` | | `--c-divider-text-padding` | `16px` | | `--c-divider-text-align-inset` | `24px` | | `--c-divider-orientation-vertical-inset-xs` | `2px` | | `--c-divider-orientation-horizontal-inset-xs` | `12px` | | `--c-divider-orientation-vertical-spacing-xs` | `4px` | | `--c-divider-orientation-horizontal-spacing-xs` | `8px` | | `--c-divider-orientation-vertical-inset-sm` | `4px` | | `--c-divider-orientation-horizontal-inset-sm` | `16px` | | `--c-divider-orientation-vertical-spacing-sm` | `8px` | | `--c-divider-orientation-horizontal-spacing-sm` | `12px` | | `--c-divider-orientation-vertical-inset-md` | `6px` | | `--c-divider-orientation-horizontal-inset-md` | `24px` | | `--c-divider-orientation-vertical-spacing-md` | `12px` | | `--c-divider-orientation-horizontal-spacing-md` | `16px` | | `--c-divider-orientation-vertical-inset-lg` | `8px` | | `--c-divider-orientation-horizontal-inset-lg` | `32px` | | `--c-divider-orientation-vertical-spacing-lg` | `16px` | | `--c-divider-orientation-horizontal-spacing-lg` | `24px` | | `--c-divider-orientation-vertical-inset-xl` | `12px` | | `--c-divider-orientation-horizontal-inset-xl` | `40px` | | `--c-divider-orientation-vertical-spacing-xl` | `24px` | | `--c-divider-orientation-horizontal-spacing-xl` | `32px` | Presets read the active platform theme. Text spacing is 16px on desktop and 8px on mobile. --- Document: llms/en-US/components/drawer.md # Drawer A side panel with declarative and programmatic APIs and cancellable before-close operations. ## Basic examples ### Basic Example source: src/drawer/__demos__/basic.vue ```vue ``` ## Sizing and positioning ### Drawer size and placement #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `unmount-on-close` | Unmount content after the closing transition | Drawer size and placement | | `placement` | Side of the containing area where the drawer appears, default right. It is not anchored to a button and does not perform popup collision flipping | Drawer size and placement | | `popup-container` | Portal container | Popup Container | Open each drawer separately to compare placement and occupied space. Nesting, containers and guards remain separate. Example source: src/drawer/__demos__/position-size-comparison.vue ```vue ``` ### Popup Container Example source: src/drawer/__demos__/popup-container.vue ```vue ``` ## Content and nesting ### Nest Drawer Example source: src/drawer/__demos__/nest-drawer.vue ```vue ``` ### Custom Node Example source: src/drawer/__demos__/custom-node.vue ```vue ``` ### Function Call Example source: src/drawer/__demos__/function-call.vue ```vue ``` ### Api Review ## Closing and async control ### Guard Protocol Example source: src/drawer/__demos__/en-US/guard-protocol.vue ```vue ``` ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | dir | Reading direction; inherits the source scope when omitted. Physical left/right placements keep their meaning. | `ReadingDirection` (`ltr` / `rtl`) | — | | open **(v-model)** | Controlled visibility | `boolean` | - | | default-open | Initial uncontrolled visibility | `boolean` | `false` | | placement | Side of the containing area where the drawer appears, default right. It is not anchored to a button and does not perform popup collision flipping | `'top' \| 'right' \| 'bottom' \| 'left'` | `'right'` | | title | Title | `string` | - | | overlay | Show the overlay | `boolean` | `true` | | overlay-class / overlay-style | Overlay class and style | `string / CSSProperties` | - | | overlay-closable | Request closure on overlay click | `boolean` | `true` | | closable | Show the close button | `boolean` | `true` | | confirm-button-text / cancel-button-text | Action button text | `string` | - | | confirm-button-loading / cancel-button-loading | Action button loading state | `boolean` | `false` | | confirm-button-disabled / cancel-button-disabled | Action button disabled state | `boolean` | `false` | | confirm-button-props / cancel-button-props | Action button props | `ButtonProps` | - | | unmount-on-close | Unmount content after the closing transition | `boolean` | `false` | | width / height | Width for left/right placement; height for top/bottom placement | `number \| string` | `250` | | popup-container | Portal container | `string \| HTMLElement \| false` | `'body'` | | drawer-class / drawer-style | Panel class and style | `string \| any[] / CSSProperties` | - | | body-class / body-style | Body class and style | `string \| any[] / StyleValue` | - | | `before-close` | Return a boolean/Promise or call done; the first completion wins | `DrawerBeforeClose` | — | | esc-to-close | Request closure on Escape | `boolean` | `true` | | lock-scroll | Lock scrolling on the host | `boolean` | `true` | | close-on-route-change | Request closure on route changes | `boolean` | `false` | | z-index | Custom z-index | `number` | Automatically allocated | | header / footer / cancel-button | Show the corresponding region | `boolean` | `true` | ### Events | Event | Description | Arguments | | --- | --- | --- | | update:open | Request a visibility update | `boolean` | | confirm / cancel | Accepted confirm or cancel action | `Event` | | open / close | Opening or closing begins | - | | opened / closed | Opening or closing transition completes | - | | click-overlay | Click the topmost overlay | `MouseEvent` | | key-escape | Escape reaches the topmost drawer | `KeyboardEvent` | ### CSS | Variable | Default | | --- | --- | | `--c-drawer-header-height` | `var(--c-size-12)` | | `--c-drawer-footer-button-margin-left` | `var(--c-spacing-6)` | | `--c-drawer-header-font-size` | `var(--c-font-size-title-1)` | | `--c-drawer-padding-horizontal` | `var(--c-spacing-7)` | | `--c-drawer-footer-padding-vertical` | `var(--c-spacing-7)` | | `--c-drawer-content-padding-vertical` | `var(--c-spacing-6)` | | `--c-drawer-header-font-weight` | `var(--c-font-weight-500)` | | `--c-drawer-border-color` | `var(--c-sys-color-border-default)` | | `--c-drawer-border-width` | `var(--c-border-width-1)` | | `--c-drawer-header-text-color` | `var(--c-sys-color-content-primary)` | | `--c-drawer-content-text-color` | `var(--c-sys-color-content-primary)` | | `--c-drawer-bg` | `var(--c-sys-color-surface-raised)` | | `--c-drawer-overlay-bg` | `var(--c-sys-color-scrim)` | | `--c-drawer-line-height` | `var(--c-line-height)` | | `--c-drawer-z-index` | `var(--c-z-index-drawer)` | | `--c-drawer-close-icon-font-size` | `var(--c-size-3)` | | `--c-drawer-close-btn-margin-left` | `var(--c-spacing-4)` | | `--c-drawer-transition-duration` | `var(--c-transition-duration-3)` | | `--c-drawer-transition-timing-function` | `var(--c-transition-timing-function-standard)` | Promise and done share a single completion state: false/done(false) rejects; true/done() allows; a resolved Promise<void> allows. The first completion wins. Errors emit guard-error; cancellation/unmount invalidates late completion. Synchronous void retains the callback protocol and waits for done on these close/confirm guards. Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Drawer placement=left/right remains physical, including entry and exit motion. Headings, content and footer actions inherit reading direction. Direction changes do not submit or clear content. ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | dir | Reading direction; inherits the source scope when omitted. Physical left/right placements keep their meaning. | `ReadingDirection` (`ltr` / `rtl`) | — | | open **(v-model)** | Controlled visibility | `boolean` | - | | default-open | Initial uncontrolled visibility | `boolean` | `false` | | placement | Side of the containing area where the drawer appears, default right. It is not anchored to a button and does not perform popup collision flipping | `'top' \| 'right' \| 'bottom' \| 'left'` | `'right'` | | title | Title | `string` | - | | overlay | Show the overlay | `boolean` | `true` | | overlay-class / overlay-style | Overlay class and style | `string / CSSProperties` | - | | overlay-closable | Request closure on overlay click | `boolean` | `true` | | closable | Show the close button | `boolean` | `true` | | confirm-button-text / cancel-button-text | Action button text | `string` | - | | confirm-button-loading / cancel-button-loading | Action button loading state | `boolean` | `false` | | confirm-button-disabled / cancel-button-disabled | Action button disabled state | `boolean` | `false` | | confirm-button-props / cancel-button-props | Action button props | `ButtonProps` | - | | unmount-on-close | Unmount content after the closing transition | `boolean` | `false` | | width / height | Width for left/right placement; height for top/bottom placement | `number \| string` | `250` | | popup-container | Portal container | `string \| HTMLElement \| false` | `'body'` | | drawer-class / drawer-style | Panel class and style | `string \| any[] / CSSProperties` | - | | body-class / body-style | Body class and style | `string \| any[] / StyleValue` | - | | `before-close` | Return a boolean/Promise or call done; the first completion wins | `DrawerBeforeClose` | — | | esc-to-close | Request closure on Escape | `boolean` | `true` | | lock-scroll | Lock scrolling on the host | `boolean` | `true` | | close-on-route-change | Request closure on route changes | `boolean` | `false` | | z-index | Custom z-index | `number` | Automatically distributed | | header / footer / cancel-button | Show the corresponding region | `boolean` | `true` | ### Events | Event | Description | Arguments | | --- | --- | --- | | update:open | Request a visibility update | `boolean` | | confirm / cancel | Accepted confirm or cancel action | `Event` | | open / close | Opening or closing begins | - | | opened / closed | Opening or closing transition completes | - | | click-overlay | Click the topmost overlay | `MouseEvent` | | key-escape | Escape reaches the topmost drawer | `KeyboardEvent` | ### Slots `default`, `header`, `title`, `footer`. The `footer` slot receives `confirm`, `cancel` and `close` methods. ### Imperative calls `Drawer.open(config)` uses camelCase options such as `cancelButtonText`, `beforeClose` and `closeOnRouteChange`. Notifications use `onConfirm`, `onCancel`, `onOpen`, `onOpened`, `onClose`, `onClosed`, `onClickOverlay` and `onKeyEscape`. ```ts import type { DrawerAction, DrawerConfig, DrawerProps } from '@cedar-design/ui' ``` ## CSS variables and color semantics Built-in fade and four-direction slide disable transitions and initial displacement under prefers-reduced-motion: reduce. Component styles handle this without global fallbacks. Default durations remain unchanged; business-defined animations require separate handling. Compiled-CSS checks do not substitute for testing live OS preference changes. Panel bg uses surface-raised; overlay-bg uses sys-color-scrim; header-text-color/content-text-color use content-primary, with the close button inheriting header-text-color; border-color uses border-default. Drawer keeps its existing geometry, motion and stacking defaults. Drawer is a Cedar component; Maple does not define empty same-name variables. overlay-style sets instance scrim variables; drawer-style sets panel variables. These sibling nodes do not inherit variables from one another. Set global system theme variables on a real common ancestor. Explicit background props take precedence over variable consumption. The unused close-icon-right variable is removed; title layout and close-btn-margin-left position the close button, without an ineffective compatibility alias. | Variable | Default | | --- | --- | | `--c-drawer-header-height` | `var(--c-size-12)` | | `--c-drawer-footer-button-margin-left` | `var(--c-spacing-6)` | | `--c-drawer-header-font-size` | `var(--c-font-size-title-1)` | | `--c-drawer-padding-horizontal` | `var(--c-spacing-7)` | | `--c-drawer-footer-padding-vertical` | `var(--c-spacing-7)` | | `--c-drawer-content-padding-vertical` | `var(--c-spacing-6)` | | `--c-drawer-header-font-weight` | `var(--c-font-weight-500)` | | `--c-drawer-border-color` | `var(--c-sys-color-border-default)` | | `--c-drawer-border-width` | `var(--c-border-width-1)` | | `--c-drawer-header-text-color` | `var(--c-sys-color-content-primary)` | | `--c-drawer-content-text-color` | `var(--c-sys-color-content-primary)` | | `--c-drawer-bg` | `var(--c-sys-color-surface-raised)` | | `--c-drawer-overlay-bg` | `var(--c-sys-color-scrim)` | | `--c-drawer-line-height` | `var(--c-line-height)` | | `--c-drawer-z-index` | `var(--c-z-index-drawer)` | | `--c-drawer-close-icon-font-size` | `var(--c-size-3)` | | `--c-drawer-close-btn-margin-left` | `var(--c-spacing-4)` | | `--c-drawer-transition-duration` | `var(--c-transition-duration-3)` | | `--c-drawer-transition-timing-function` | `var(--c-transition-timing-function-standard)` | ### Before-hook waiting feedback Before-hook waits show visible feedback and aria-busy. Rejected or failed operations recover; duplicate submissions do not start another copy. Notification event Promises never drive loading. --- Document: llms/en-US/components/ellipsis.md # Ellipsis Single-line or multi-line truncation with optional expansion and Tooltip. ## Basic examples ### Single line Example source: src/ellipsis/__demos__/basic.vue ```vue ``` ## Content and presentation ### Multiple lines Example source: src/ellipsis/__demos__/multiline.vue ```vue ``` ## Customization and slots ### Custom tooltip Example source: src/ellipsis/__demos__/custom-tooltip.vue ```vue ``` ## Interaction and control ### Interactive expansion #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `line-clamp` | Positive line count; omitted or invalid means single line | Interactive expansion, Controlled expansion | | `expand-trigger` | Enable click / Enter / Space toggling | Interactive expansion, Controlled expansion | | `tooltip` | Tooltip configuration; false disables it | Interactive expansion, Controlled expansion | | `expand` | Controlled expansion | Controlled expansion | Example source: src/ellipsis/__demos__/expand.vue ```vue ``` ### Controlled expansion Example source: src/ellipsis/__demos__/controlled.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | `expand` | Controlled expansion | `boolean` | `undefined` | | `default-expand` | Initial uncontrolled expansion | `boolean` | `false` | | `expand-trigger` | Enable click / Enter / Space toggling | `'click'` | `—` | | `line-clamp` | Positive line count; omitted or invalid means single line | `number \| string` | `—` | | `tooltip` | Tooltip configuration; false disables it | `boolean \| TooltipProps` | `true` | Providing `expand` makes the component request updates from its parent rather than changing controlled state. When omitted, internal state is used, initialized once by `default-expand`. Tooltip follows its own width and trigger defaults; display does not depend on measured overflow. Touch callers can include `click` in `tooltip.trigger` explicitly. External class/style/width apply directly to the text node. ### Events and slots - `update:expand(expand: boolean)`: the new state requested by user interaction; external updates do not emit it. - `default`: body text. - `tooltip-content`: tooltip content. Without it, tooltip.content takes precedence, then body text; content is not concatenated twice. - Keyboard: expandable text supports Enter / Space; tooltip-enabled text is focusable with Tab. No public instance methods. ### Types ```ts import type { EllipsisProps, EllipsisInstance, EllipsisExpandTrigger } from '@cedar-design/ui' ``` ### Style variables | Token | Default | | --- | --- | | `--c-ellipsis-focus-color` | `var(--c-sys-color-content-brand)` | | `--c-ellipsis-focus-width` | `2px` | | `--c-ellipsis-focus-offset` | `2px` | --- Document: llms/en-US/components/empty.md # Empty Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `description="暂无数据"`. Example source: src/empty/__demos__/basic.vue ```vue ``` ## Appearance and states ### Size #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `image-size` | Image/icon size | Size | | `description` | Description; falls back to i18n | Size | Preview configuration: `:image-size="size"`, `:description="image-size: ${size}"`. Example source: src/empty/__demos__/size.vue ```vue ``` ## Content and presentation ### Empty-state image and actions #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `description` | Description; falls back to i18n | Empty-state image and actions, Show | | `image-url` | Custom image URL | Empty-state image and actions | | `alt` | Image alternative text | Empty-state image and actions | | `show-icon` | Whether to show the icon | Show | | `show-description` | Whether to show the description | Show | Compare custom artwork and extra actions to distinguish content replacement from supplemental controls. Example source: src/empty/__demos__/content-comparison.vue ```vue ``` ### Show Preview configuration: `data-demo-empty`, `description="Dynamic empty state"`, `:show-icon="showIcon"`, `:show-description="showDescription"`. Example source: src/empty/__demos__/show.vue ```vue ``` ## API ### `` Props | Prop | Description | Type | Default | | ------------------ | ---------------------------- | -------------------------------------------------------- | ------- | | description | Description; falls back to i18n | `string` | - | | image-url | Custom image URL | `string` | - | | alt | Image alternative text | `string` | `''` | | image-size | Image/icon size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| number \| string` | `'md'` | | show-icon | Whether to show the icon | `boolean` | `true` | | show-description | Whether to show the description | `boolean` | `true` | ### `` Events | Event | Description | Arguments | | ------ | -------- | --------------------- | | click | Click callback | `(ev: MouseEvent)` | ### `` Slots | Slot | Description | Arguments | | ------- | --------- | ---- | | image | Image/icon | - | | default | Description content | - | | extra | Extra actions | - | ### Type definitions The component exports the following types ```ts import type { EmptyImageSize, EmptyProps } from '@cedar-design/ui' ``` ConfigProvider's `empty` slot can replace Empty content when no custom content is supplied; it is not a public Empty prop. ### Style variables | Variable | Default | Purpose | | --- | --- | --- | | `--c-empty-description-color` | `var(--c-sys-color-content-tertiary)` | Low-emphasis empty-state description | | `--c-empty-icon-color` | `var(--c-sys-color-content-decorative)` | Decorative nontext icon; not for text users need to read | | `--c-empty-padding` | `var(--c-spacing-5) 0` | Container spacing | | `--c-empty-image-margin-bottom` | `var(--c-spacing-2)` | Icon-to-description gap | | `--c-empty-description-font-size` | `var(--c-font-size-body-3)` | Description font size | | `--c-empty-description-line-height` | `var(--c-line-height)` | Description line height | | `--c-empty-extra-margin-top` | `var(--c-spacing-5)` | Gap above additional actions | | `--c-empty-size-xs/sm/md/lg/xl` | `var(--c-size-15/20/25/35/45)` | Default icon/image size presets | Descriptions are text and must meet text contrast requirements; decorative icons may be weaker. Custom images/slots may have their own colors and are not forcibly recolored by `icon-color`. Desktop/mobile maintain their own dimensions and spacing while keeping variable responsibilities consistent. --- Document: llms/en-US/components/field-decorator.md # Field Decorator Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. Focused inputs do not draw an additional outer outline. Existing variant borders, underlines or backgrounds provide focus feedback. This applies to consumers including Input, Textarea, Date and Time. Input, textarea and numeric-input carets use `currentColor`, matching the current input text. Error state does not override caret color separately. `--c-field-caret-color` defaults to `currentColor` and controls Input, InputNumber and Textarea carets without changing text color. ## Basic examples ### Control Sizes Preview configuration: `aria-label="Comparison size"`, `:value="item"`, `aria-label="Comparison variant"`, `:size="size"`. Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ## Loading and waiting ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. Example source: src/field-decorator/__demos__/loading.vue ```vue ``` ### Loading tokens | Token | Default | | --- | --- | | `--c-field-loading-line-size` | `2px` | | `--c-field-loading-duration` | `1s` | | `--c-field-loading-color` | `var(--c-field-focus-color)` | ## Props The outline notch uses `fieldset / legend`, not a background mask. It starts aligned with the content column and reserves `hint-space` on both sides. CSS `max()/calc()` in `padding-inline-start` must be emitted verbatim by Less, preventing different Less versions from prematurely evaluating it as `0px`. `check:input` checks source parity and both libraries’ Less output. | Prop | Type | Default / meaning | | --- | --- | --- | | `tag` | `'div' \| 'span'` | `div`; wrapper element | | `value` | `unknown` | Checks only whether content is empty | | `id` | `string` | Native control id associated with the floating label | | `title` | `string` | Native title tooltip | | `size` | `ComponentSize` | `md`; implements all five sizes | | `variant` | `'outline' \| 'filled' \| 'standard'` | `outline` | | `placeholder` | `string` | Floating label text | | `hint` | `boolean` | Cedar false / Maple true | | `hint-center` | `boolean` | `true`; use false for multiline controls | | `line` | `boolean` | `true`; whether to show a border or underline | | `focused` | `boolean` | Consumer-supplied focus state | | `composing` | `boolean` | Keep the label floated during IME composition | | `disabled` / `readonly` / `error` | `boolean` | Provided by the consumer after merging Form / Group state | | `clearable` | `boolean` | `false`; whether clearing is allowed | | `text-color` / `focus-color` / `blur-color` | `string` | Custom text, focused and unfocused colors | | `cursor` | `string` | Custom caret | ## Slots and events `default` contains a native input, tags or display content. `prefix` / `suffix` contain adornments. `clear-icon` receives `clear(event?)`; a custom button should call it. Clearing does not bubble to open the selection panel. `clear(event)` asks the consumer to update the value; `mousedown(event)` lets the consumer manage focus. The wrapper does not mutate the model itself. Style semantics use `--c-field-*` / `--mp-field-*`, declared in each library's `style/token.less`. Implementations are not shared across libraries. Consumers must not draw a second border. ## Error and disabled border variables Prefix these suffixes with `--c-field-` / `--mp-field-`: `variant-outline-border-color-error` controls outline error borders; `variant-standard-line-color-error` controls standard error underlines; `variant-standard-line-color-disabled` controls standard disabled underlines and defaults to system border-subtle. Disabled overrides error, hover and focus. All three support local overrides. `field-error-color` still controls error text. Internal variables are not business API; unused legacy declarations are removed without aliases. Changing `tag` rebinds size observation to the current root and content elements. KeepAlive deactivation releases observation and queued measurement; frames from an earlier activation cannot update the current layout. --- Document: llms/en-US/components/filter-form.md # Filter Form Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `v-model:collapsed="collapsed"`, `:fields="fields"`, `:rules="rules"`. Example source: src/filter-form/__demos__/basic.vue ```vue ``` ## Content and presentation ### Registered Fields #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `fields` | Filter-item schema | Registered Fields | | `field-map` | Optional field-component registry | Registered Fields | | `collapsible` | Whether expanding/collapsing is enabled | Registered Fields | Preview configuration: `:fields="fields"`, `:field-map="fieldMap"`, `:collapsible="false"`. Example source: src/filter-form/__demos__/registered-fields.vue ```vue ``` ## Async and dynamic data ### Async Options #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `fields` | Filter-item schema | Async Options | | `collapsible` | Whether expanding/collapsing is enabled | Async Options | Preview configuration: `:fields="fields"`, `:collapsed="false"`, `:collapsible="false"`. Example source: src/filter-form/__demos__/async-options.vue ```vue ``` ## API ### Value and default value Use ordinary `v-model`. `modelValue` is the filter-fields object. `defaultValue` initializes uncontrolled state once; later changes do not reset it. Explicit binding takes precedence, and initialization emits no `update:modelValue`. ### FilterForm Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | model-value **(v-model)** | Form value | `Record` | `{}` | | fields | Filter-item schema | `FilterFormField[]` | `[]` | | field-map | Optional field-component registry | `FilterFormFieldMap` | `{}` | | rules | Forwarded Form validation rules | object | - | | collapsed **(v-model)** | Whether to collapse extra items | boolean | `true` | | collapsible | Whether expanding/collapsing is enabled | boolean | `true` | | cols | Responsive column count | number \| object | `{ xs:1, sm:2, md:3, lg:3, xl:4, xxl:5 }` | | grid-props | Other Grid props | object | - | | change-debounce | Change debounce interval in milliseconds | number | `500` | ### FilterFormField | Prop | Description | Type | Default | | --- | --- | --- | --- | | component | Vue component or a key in `fieldMap` | `string \| Component` | - | | field | Form field path | string | - | | label | Label | string | - | | visible | Whether to render | boolean | `true` | | autoEmitChange | Whether input emits change while editing | boolean | `true` | | props | Props forwarded to the field component | object | - | | gridItemProps | GridItem props | object | - | | formItemProps | FormItem props | object | - | ### FilterFormFieldRegistration | Prop | Description | Type | Default | | --- | --- | --- | --- | | component | Field component | Component | - | | defaultProps | Default props | object | - | ### Events | Event | Description | Arguments | | --- | --- | --- | | update:model-value | v-model | `(value) => void` | | update:collapsed | Collapsed state changes | `(collapsed) => void` | | change | Debounced field-value changes | `(value, field) => void` | ### Slots | Slot | Description | | --- | --- | | actions | Action area for search/reset, on the same row as the expand/collapse control | ### Methods | Method | Description | | --- | --- | | formRef | Internal Form instance | ## Style variables | Variable | Default | | --- | --- | | `--c-filter-form-border-radius` | `var(--c-border-radius-md)` | | `--c-filter-form-background-color` | `var(--c-sys-color-surface-default)` | | `--c-filter-form-padding` | `var(--c-sys-space-7)`(20px) | | `--c-filter-form-border-color` | `var(--c-sys-color-border-subtle)` | | `--c-filter-form-border-width` | `1px` | | `--c-filter-form-action-offset` | `calc(1em * var(--c-form-line-height) + var(--c-form-vertical-label-margin-bottom))` | | `--c-filter-form-item-margin-bottom` | `0px`; Grid controls row spacing | | `--c-filter-form-actions-gap` | `var(--c-sys-space-5)`(12px) | | `--c-filter-form-collapse-gap` | `4px` | | `--c-filter-form-collapse-color` | `var(--c-color-text-2)` | | `--c-filter-form-collapse-hover-color` | `var(--c-sys-color-content-brand)` | | `--c-filter-form-focus-width` | `2px` | | `--c-filter-form-focus-offset` | `3px` | Consumption verified on 2026-10-16: real Less compilation and mounted DOM confirm these 13 variables feed the container, FormItem, action-area and collapse-button rules. The static style entry also imports Form styles. Multi-column action `padding-top` consumes action-offset; stacked single-column mode overrides it to `0`. Root derived aliases do not necessarily recompute after locally overriding Form dependencies; adjust alignment by overriding `--c-filter-form-action-offset` on the actual FilterForm root. ## Types ```ts import type { FilterFormProps, FilterFormField, FilterFormFieldMap, FilterFormFieldRegistration, } from '@cedar-design/ui' ``` Grid column spacing is controlled by `grid-props.colGap` in numeric px. There is no same-name CSS override, ensuring numerical Grid measurements match actual spacing. Changing changeDebounce reschedules a pending snapshot with the new delay;0 publishes immediately. Enter cancels its pending duplicate. Model resets invalidate stale snapshots while an accepted matching update:modelValue echo retains its change notification. Deactivation/unmount cancel pending work; reactivation accepts new input. --- Document: llms/en-US/components/form.md # Form Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Reading direction Form and FormItem accept start/end/left/center/right for content-align and start/end/left/right for label-align. Content defaults to start and labels to end: default LTR placement stays the same while RTL follows reading order. Explicit left/right remain physical. Item overrides and explicit label-column styles retain precedence. Direction changes preserve values, validation and disabled/readonly state. ## Basic examples ### Basic usage - `model`: Form data object Example source: src/form/__demos__/basic.vue ```vue ``` ## Form appearance and layout ### Disabled #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------------ | ----------------------------------------------------------------------------- | ------------------------------------------ | | `layout` | The layout of the form, including horizontal, vertical, and multi-column | Layout, Decoration, Label width strategies | | `model` | Form data object | Decoration, Label width strategies | | `disabled` | Whether to disable the form | Disabled | | `label-align` | Label alignment | Label width strategies | | `auto-label-width` | Automatically measure label widths; only effective with `layout="horizontal"` | Label width strategies | | `label-col-flex` | Label-column flex; numbers are flex ratios, unit-bearing strings are widths | Label width strategies | - `disabled`: Whether to disable the form Example source: src/form/__demos__/disabled.vue ```vue ``` ### Layout `edit-mode` describes editing behavior: `direct` always shows the control; `click` and `dblclick` activate the existing editor overlay near the field. `readPretty` is an independent boolean. FormItem and fields inherit the mode when omitted. The legacy field `presentation` prop has been removed; use `edit-mode` to configure editing behavior. Replace `presentation="inline"` with `edit-mode="direct"`; `layout="inline"` is unchanged. Combine `layout`, `content-align` with `direct / click / dblclick` editing and the independent `readPretty` boolean to compare label, value and wrapped-text alignment. Notes can override the form layout, and values survive every switch. Click or double-click a value to edit in a popover; readPretty displays saved text. Example source: src/form/__demos__/en-US/layout.vue ```vue ``` ### Decoration - `model`: Form data object - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/decoration.vue ```vue ``` ### Extra Preview configuration: `type="text"`, `placeholder="请输入"`. Example source: src/form/__demos__/extra.vue ```vue ``` ### Label width strategies Enter values, then switch between measured labels, responsive columns and fixed widths: all three strategies retain the same form model. Edit the longest label or hide the contact field to observe remeasurement. Below 576px, the responsive strategy stacks labels above controls; fixed widths use 6rem with an 8rem contact-field override. Example source: src/form/__demos__/en-US/label-width-comparison.vue ```vue ``` ## Fields and data model ### Nested Data - `model`: Form data object Example source: src/form/__demos__/nested-data.vue ```vue ``` ### Field Components - `model`: Form data object Example source: src/form/__demos__/field-components.vue ```vue ``` ### Field Choice - `model`: Form data object Example source: src/form/__demos__/field-choice.vue ```vue ``` ### Field Selection - `model`: Form data object Example source: src/form/__demos__/field-selection.vue ```vue ``` ### Field Tree - `model`: Form data object Example source: src/form/__demos__/field-tree.vue ```vue ``` ### Field Date - `model`: Form data object Example source: src/form/__demos__/field-date.vue ```vue ``` ### Field Time - `model`: Form data object Example source: src/form/__demos__/field-time.vue ```vue ``` ### Field Rating - `model`: Form data object Example source: src/form/__demos__/field-rating.vue ```vue ``` ### Field Upload - `model`: Form data object Example source: src/form/__demos__/field-upload.vue ```vue ``` ### Field Specialized - `model`: Form data object Example source: src/form/__demos__/field-specialized.vue ```vue ``` ## Validation and submission ### Validate #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------------------------------------------ | ------------------------------------ | | `model` | Form data object | Validate, Cross Field, Clear Trigger | | `layout` | The layout of the form, including horizontal, vertical, and multi-column | Clear Trigger | - `model`: Form data object Example source: src/form/__demos__/validate.vue ```vue ``` ### Cross Field - `model`: Form data object Example source: src/form/__demos__/cross-field.vue ```vue ``` ### Clear Trigger - `model`: Form data object - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/clear-trigger.vue ```vue ``` ### Empty markers and required validation The API uses -1 for no selection. Validate the initial value to see a required error, choose a department and validate successfully, then clear to -1 and validate again. Form provides recognition settings; the field defines clear output. Custom validators still receive the original value. Example source: src/form/__demos__/en-US/empty-values-validation.vue ```vue ``` ### Feedback Preview configuration: `placeholder="please enter your username..."`. Example source: src/form/__demos__/feedback.vue ```vue ``` ## Field presentation and interaction ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | `layout` | The layout of the form, including horizontal, vertical, and multi-column | State Lab, Presentation Status, Platform Presentation | | `model` | Form data object | Field Presentation, Platform Presentation, Scroll Assign | | `disabled` | Whether to disable the form | State Lab | | `readonly` | Whether form controls are readonly | State Lab | | `scroll-to-error` | After failed validation, scroll to the first (start) or last (end) invalid field in document order; this is not viewport alignment | Scroll Assign | - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/state-lab.vue ```vue ``` ### Field Presentation - `model`: Form data object Example source: src/form/__demos__/field-presentation.vue ```vue ``` ### Reading placeholders and inheritance Initially in reading mode, Name inherits Form’s default “-”, Code uses the FormItem override, Nickname uses the field override, and Quantity remains 0. Changing Form text only affects inheriting fields. Toggling reading/editing does not rewrite the model. Precedence is Field > FormItem > Form; custom read slots win. Example source: src/form/__demos__/en-US/empty-text.vue ```vue ``` ### Presentation Status - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/presentation-status.vue ```vue ``` ### Platform Presentation - `model`: Form data object - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/platform-presentation.vue ```vue ``` ### Field Panel Actions Preview configuration: `default-value="2026-10-20 09:30:00"`, `show-time`, `:disable-confirm="false"`. Example source: src/form/__demos__/field-panel-actions.vue ```vue ``` ### Scroll Assign - `model`: Form data object - `scroll-to-error`: Scroll to the first (start) or last (end) invalid field; omitted disables scrolling Example source: src/form/__demos__/scroll-assign.vue ```vue ``` ## Dynamic and async fields ### Dynamic Form #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ---------------------------------- | ----------------------------------------------- | | `model` | Form data object | Dynamic Form, Async Validate Form, Async Fields | | `disabled` | Whether to disable the form | Presentation State, Async Race | | `readonly` | Whether form controls are readonly | Presentation State, Async Race | | `rules` | Form item validation rules | Presentation State | - `model`: Form data object Example source: src/form/__demos__/dynamic-form.vue ```vue ``` ### Async Validate Form - `model`: Form data object Example source: src/form/__demos__/async-validate-form.vue ```vue ``` ### Async Fields - `model`: Form data object Example source: src/form/__demos__/async-fields.vue ```vue ``` ### Presentation State - `model`: Form data object - `disabled`: Whether to disable the form - `readonly`: Whether form controls are readonly - `rules`: Form item validation rules Example source: src/form/__demos__/presentation-state.vue ```vue ``` ### Async Race - `model`: Form data object - `disabled`: Whether to disable the form - `readonly`: Whether form controls are readonly Example source: src/form/__demos__/async-race.vue ```vue ``` ### Field Range Boundaries - `model`: Form data object Example source: src/form/__demos__/field-range-boundaries.vue ```vue ``` ## Business workflows ### Task Workflow #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------------------------------------------ | ---------------- | | `model` | Form data object | Task Workflow | | `layout` | The layout of the form, including horizontal, vertical, and multi-column | Task Workflow | - `model`: Form data object - `layout`: The layout of the form, including horizontal, vertical, and multi-column Example source: src/form/__demos__/task-workflow.vue ```vue ``` ## API ### Empty values and reading placeholders Form / FormItem provide empty recognition through `empty-values`; each field defines clear output with its own `empty-value`. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### `
` Props | Parameter | Description | Type | Default | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | :-------------------: | | model | Form data object | `object` | `{}` | | layout | The layout of the form, including horizontal, vertical, and multi-column | `'horizontal' \| 'vertical' \| 'inline'` | `'horizontal'` | | size | The size of the form | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | | label-col-flex | Label-column flex; numbers are flex ratios, unit-bearing strings are widths | `number \| string` | `-` | | label-col-style | Per-instance label column style | `CSSProperties` | `-` | | wrapper-col-style | Per-instance control column style | `CSSProperties` | `-` | | label-col-props | Label layout options; same parameters as the col component | `object` | `span: 5, offset: 0` | | wrapper-col-props | Form-control layout options; same parameters as the col component | `object` | `span: 19, offset: 0` | | label-align | Label alignment | `'start' \| 'end' \| 'left' \| 'right'` | `'end'` | | `content-align` | Content alignment shared by direct fields, editor triggers and readPretty output; independent of label-align | `'start' \| 'end' \| 'left' \| 'center' \| 'right'` | `'start'` | | `read-pretty` | Independent reading toggle. When true, displays the saved value; when false, restores the current edit-mode. FormItem inherits Form when unset | `boolean` | `-` | | `edit-mode` | Shared editing mode for form fields; when unset, preserves each field default | `'direct' \| 'click' \| 'dblclick'` | `-` | | disabled | Whether to disable the form | `boolean` | `-` | | readonly | Whether form controls are readonly | `boolean` | `-` | | rules | Form item validation rules | `Record` | `-` | | auto-label-width | Automatically measure label widths; only effective with `layout="horizontal"` | `boolean` | `false` | | id | Prefix for form-control ids | `string` | `-` | | scroll-to-error | After failed validation, scroll to the first (start) or last (end) invalid field in document order; this is not viewport alignment | `'start' \| 'end'` | Do not scroll | ### `` Events | Event | Description | Arguments | | -------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | submit | Triggered when the form is submitted | data: `{values: Record; errors: Record \| undefined}`
ev: `Event` | | submit-success | Emitted when validation succeeds | values: `Record`
ev: `Event` | | submit-failed | Emitted when validation fails | data: `{values: Record; errors: Record}`
ev: `Event` | | reset | Emitted on native reset; also resets field values and validation state | ev: `Event` | ### `` Methods | Method | Description | Arguments | Returns | | ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | validate | Validate all form data | callback: `(errors: undefined \| Record) => void` | Promise> | | validateField | Validate selected form fields | field: `string \| string[]`
callback: `(errors: undefined \| Record) => void` | Promise> | | resetFields | Reset form data | field: `string \| string[]` | - | | clearValidate | Clear validation state | field: `string \| string[]` | - | | setFields | Set form-item values and states | data: `Record` | - | | scrollToField | Scroll to a form item | `field: string` | `-` | ### `` Props Layout, label/content columns, styles, alignment and flex inherit from Form when omitted; explicit values override them. | Parameter | Description | Type | Default | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | :-----------------: | | field | Field path in the data object; required for data fields | `string` | `''` | | label | Label text | `string` | `-` | | tooltip | Hint content | `string` | `-` | | show-colon | Whether to show a colon | `boolean` | `false` | | no-style | Whether to remove styling | `boolean` | `false` | | disabled | Whether disabled | `boolean` | `-` | | readonly | Readonly state; inherits from Form when omitted | `boolean` | `-` | | help | Help text | `string` | `-` | | extra | Extra text | `string` | `-` | | required | Whether a value is required | `boolean` | `false` | | asterisk-position | Logical start/end position of the required asterisk within the field label, default start; not the form or popup position | `'start' \| 'end'` | `'start'` | | rules | Field validation rules; take precedence over Form rules | `FieldRule \| FieldRule[]` | `-` | | validate-status | Validation state | `'success' \| 'warning' \| 'error' \| 'validating'` | `-` | | validate-trigger | Events that trigger validation; `clear` is emitted only by a control `clear` action and is distinct from `change` | `'change' \| 'input' \| 'focus' \| 'blur' \| 'clear'` | `'change'` | | size | Control size; inherits from Form when omitted. Form layout still controls label appearance | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `-` | | layout | Form-item layout; inherits from Form when omitted | `'horizontal' \| 'vertical' \| 'inline'` | `-` | | label-align | Label alignment; inherits from Form when omitted | `'start' \| 'end' \| 'left' \| 'right'` | `-` | | `content-align` | Content alignment shared by direct fields, editor triggers and readPretty output; independent of label-align | `'start' \| 'end' \| 'left' \| 'center' \| 'right'` | `-` (inherits Form) | | `read-pretty` | Independent reading toggle. When true, displays the saved value; when false, restores the current edit-mode. FormItem inherits Form when unset | `boolean` | `-` | | `edit-mode` | Editing mode; inherits Form when unset and may be overridden by individual fields | `'direct' \| 'click' \| 'dblclick'` | `-` | | label-col-props | Label layout options; same parameters as the col component | `object` | `-` | | wrapper-col-props | Form-control layout options; same parameters as the col component | `object` | `-` | | hide-label | Hide label | `boolean` | `false` | | hide-asterisk | Whether to hide the required marker | `boolean` | `false` | | label-col-style | Style for the label layout component | `object` | `-` | | wrapper-col-style | Style for the control layout component | `object` | `-` | | row-props | Form-item layout options; same parameters as the row component | `object` | `-` | | row-class | Class for the form-item layout component | `string\|array\|object` | `-` | | content-class | Class for the control wrapper | `string\|array\|object` | `-` | | content-flex | Whether the content wrapper uses flex layout | `boolean` | `true` | | label-col-flex | Sets flex on the label `Col` component; the control `Col` flex is then set to `auto` | `number\|string` | `-` | | feedback | Whether to show control feedback icons | `boolean` | `false` | | label-component | Element used to render the form-item label | `string` | `'label'` | | label-attrs | Native label attributes; for targets the actual control id | `object` | `-` | ### `` Slots | Slot | Description | Arguments | | ----- | :-----------: | --------- | | label | Label | - | | help | Help content | - | | extra | Extra content | - | ## Type ### FieldRule | Parameter | Description | Type | Default | | --------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | :-----: | | type | Validated value type; defaults to `'string'` | `'string' \| 'number' \| 'boolean' \| 'array' \| 'object' \| 'email' \| 'url' \| 'ip'` | `-` | | required | Whether the value is required | `boolean` | `false` | | message | Message displayed on validation failure | `string` | `-` | | length | Required length for string/array values | `number` | `-` | | maxLength | Maximum string length | `number` | `-` | | minLength | Minimum string length | `number` | `-` | | match | Pattern matching for strings | `RegExp` | `-` | | uppercase | Uppercase string validation | `boolean` | `false` | | lowercase | Lowercase string validation | `boolean` | `false` | | min | Minimum numeric value | `number` | `-` | | max | Maximum numeric value | `number` | `-` | | equal | Numeric-value validation | `number` | `-` | | positive | Positive-number validation | `boolean` | `false` | | negative | Negative-number validation | `boolean` | `false` | | true | Whether a boolean is `true` | `boolean` | `false` | | false | Whether a boolean is `false` | `boolean` | `false` | | includes | Whether an array contains the specified value | `any[]` | `-` | | deepEqual | Whether array elements are equal | `any` | `-` | | empty | Whether an object is empty | `boolean` | `false` | | hasKeys | Whether an object contains the specified property | `string[]` | `-` | | validator | Custom validation rule | `( value: FieldValue \| undefined, callback: (error?: string) => void ) => void` | `-` | ### FieldData | Parameter | Description | Type | Default | | --------- | ------------------- | ---------------- | :-----: | | value | Field value | `any` | `-` | | status | Field state | `ValidateStatus` | `-` | | message | Field error message | `string` | `-` | ### ValidatedError | Parameter | Description | Type | Default | | --------------- | ---------------------------------------- | --------- | :-----: | | label | Label text | `string` | `-` | | field | Field name | `string` | `-` | | value | Field value | `any` | `-` | | type | Field type | `string` | `-` | | isRequiredError | Whether this is a `required`-field error | `boolean` | `false` | | message | Error message | `string` | `-` | ### FormItemEventHandler | Parameter | Description | Type | Default | | --------- | ----------- | ---------------------- | :-----: | | onChange | onChange | `(ev?: Event) => void` | `-` | | onInput | onInput | `(ev?: Event) => void` | `-` | | onFocus | onFocus | `(ev?: Event) => void` | `-` | | onBlur | onBlur | `(ev?: Event) => void` | `-` | ### useFormItem ```ts const useFormItem = (data: { size?: Ref; disabled?: Ref; error?: Ref; }) => { mergedSize: Ref; mergedDisabled: Ref; mergedError: Ref; feedback: Ref; eventHandlers: Ref; }; ``` ## Type definitions The component exports the following types ```ts import type { FormProps } from "@cedar-design/ui"; ``` ### Five density levels and item spacing xs/sm/md/lg/xl select geometry through size classes. Item bottom spacing and reserved validation-message height both use size-*-item-margin-bottom. Inline layout uses inline-item-margin-bottom; error/help do not add item bottom spacing again. | Variable | Default | | ------------------------------------- | --------------------------- | | `--c-form-size-xl-height` | `var(--c-size-xl)` | | `--c-form-size-xl-label-font-size` | `var(--c-sys-font-size-lg)` | | `--c-form-size-xl-item-margin-bottom` | `var(--c-spacing-8)` | ### edit-mode inheritance Form supports `direct / click / dblclick`. When unset, each field retains its own default; FormItem and fields inherit explicitly configured ancestor values, and an explicit field value takes precedence. readPretty controls reading independently of readonly/disabled. Submitting the form fails while a confirmation editor remains unfinished, preserving its draft; reset cancels editing. Existing default slots and v-model are unchanged, and no editor slot is required. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. --- Document: llms/en-US/components/grid.md # Grid CSS Grid columns, spans, gaps, collapse and suffix items. Use Row / Col for 24-column Flex layouts. > **Choosing a layout** > > - Grid + GridItem: Use for form columns and card grids with consistent column widths, spans, responsive column counts, or collapsed rows and suffix items. > - Row + Col: Use for 24-column Flex layouts that need horizontal/vertical alignment, wrapping control, fixed and flexible widths together, or responsive ordering. Row controls the row; Col controls width, offset and order. > - Space: Use for simple groups of buttons, tags or text that only need spacing, direction and alignment. Use native Flex for more flexible width allocation. ## Basic examples ### Columns, spans and offsets Example source: src/grid/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Responsive columns, gaps and spans #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `cols` | Columns per row, minimum 1 | Responsive columns, gaps and spans | | `col-gap` | Column gap in px | Responsive columns, gaps and spans | | `row-gap` | Row gap in px | Responsive columns, gaps and spans | Example source: src/grid/__demos__/responsive.vue ```vue ``` ## Customization and slots ### Collapsed rows and suffix slot #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `cols` | Columns per row, minimum 1 | Collapsed rows and suffix slot | | `col-gap` | Column gap in px | Collapsed rows and suffix slot | | `row-gap` | Row gap in px | Collapsed rows and suffix slot | | `collapsed` | Collapse overflowing rows | Collapsed rows and suffix slot | | `collapsed-rows` | Visible rows while collapsed, minimum 1 | Collapsed rows and suffix slot | Example source: src/grid/__demos__/collapse.vue ```vue ``` ## Interaction and control ### Insert, remove and reorder #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `cols` | Columns per row, minimum 1 | Insert, remove and reorder | | `col-gap` | Column gap in px | Insert, remove and reorder | | `row-gap` | Row gap in px | Insert, remove and reorder | | `collapsed` | Collapse overflowing rows | Insert, remove and reorder | Example source: src/grid/__demos__/dynamic.vue ```vue ``` ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | cols | Columns per row, minimum 1 | `number / ResponsiveValue` | `24` | | row-gap | Row gap in px | `number / ResponsiveValue` | `0` | | col-gap | Column gap in px | `number / ResponsiveValue` | `0` | | collapsed | Collapse overflowing rows | `boolean` | `false` | | collapsed-rows | Visible rows while collapsed, minimum 1 | `number` | `1` | ### Events | Event | Description | | --- | --- | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | cols | Columns per row, minimum 1 | `number / ResponsiveValue` | `24` | | row-gap | Row gap in px | `number / ResponsiveValue` | `0` | | col-gap | Column gap in px | `number / ResponsiveValue` | `0` | | collapsed | Collapse overflowing rows | `boolean` | `false` | | collapsed-rows | Visible rows while collapsed, minimum 1 | `number` | `1` | ### Events | Event | Description | | --- | --- | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | ## Responsiveness and accessibility Breakpoints use the browser viewport: xs is the base; sm ≥576, md ≥768, lg ≥992, xl ≥1200 and xxl ≥1600px. Configured values resolve downward from the largest matching breakpoint. SSR starts with xs and responds to the viewport after mounting. Grid collapsing and dynamic ordering are calculated after mounting. These layout containers add no keyboard shortcuts; callers supply content semantics and focusable elements. There are no public methods or dedicated theme tokens. ## GridItem | Prop | Description | Type | Default | | --- | --- | --- | --- | | span | Grid span | number / ResponsiveValue | 1 | | offset | Empty tracks before the item | number / ResponsiveValue | 0 | | suffix | Suffix at the end of the row | boolean | false | The default slot receives `{ overflow: boolean }`, indicating whether collapsing hides content. No custom events or public methods. ## Imports Grid contains only Grid.Item. Row and Col are independent components with their own source, styles, navigation, documentation and demos. Grid.Row/Grid.Col, Row/Col re-exports from Grid and GridRowInstance/GridColInstance are removed. Import them from the library root or separate row/col entries. Installing Grid no longer registers Row/Col automatically. --- Document: llms/en-US/components/hover.md # Hover Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:hovering="hovering"`, `:focusing="focusing"`. Example source: src/hover/__demos__/basic.vue ```vue ``` ## API ### Directives | Usage | Description | | --- | --- | | `v-hover="callback"` | Notifies `(hovering: boolean) => void` on mouse enter and leave | | `v-hover="styleObject"` | Applies styles on mouse enter and restores them on leave | | `v-hover:desktop` / `v-hover:mobile` | Enabled according to the directive's platform detection; this does not imply real touchscreen hover support | ### HoverOverlay Props | Prop | Type | Default | Description | | --- | --- | --- | --- | | hovering | boolean | false | Hover decoration state | | focusing | boolean | false | Focus decoration state | `useHoverOverlay()` returns `hovering` and `handleHovering` for connection to directive callbacks. The overlay is absolutely positioned, so its host must establish a positioning context. For independent use, import `@cedar-design/ui/hover/style`. --- Document: llms/en-US/components/icon.md # Icon Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic Usage - `size`: Controls the component size. - `color`: Overrides the color. Example source: src/icon/__demos__/basic-usage.vue ```vue ``` ## Appearance and states ### Icon size and color #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | `inherit` | Icon size and color | | `color` | Icon color | Icon size and color | Compare size and color independently of rotation, animation and click handling. Example source: src/icon/__demos__/appearance-comparison.vue ```vue ``` ## Content and presentation ### Rotate Spin #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | `inherit` | Rotate Spin | | `rotate` | Rotation angle | Rotate Spin | | `spin` | Whether to rotate continuously | Rotate Spin | - `size`: Controls the component size. Example source: src/icon/__demos__/rotate-spin.vue ```vue ``` ### Catalog Preview configuration: `clearable`, `placeholder="搜索图标名称"`. Example source: src/icon/__demos__/catalog.vue ```vue ``` ## Customization and slots ### Custom #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | `inherit` | Custom | | `color` | Icon color | Custom | - `size`: Controls the component size. - `color`: Overrides the color. Example source: src/icon/__demos__/custom.vue ```vue ``` ### IconPark custom projects You can use the **SVG Symbol JS** or **Web Component JS** generated by an IconPark custom project directly. Exporting individual SVG files or generating a Vue component for every icon is optional. These are SVG resource mechanisms, separate from loading text fonts with `@font-face`. The public `@icon-park/vue-next` component package and your custom project's JS are separate resource sources. Installing the public package does not automatically include your team's uploaded or maintained icons. | Approach | Resource source | Rendering | Loading unit | | --- | --- | --- | --- | | SVG Symbol JS | Custom project script | `svg` / `use` in the default slot | The icon collection in that file | | Web Component JS | Custom project script | A custom element in the default slot | Depends on the generated implementation; do not assume individual icon loading | | Individual SVG Vue components | Local files or a component package | Vue components in the default slot | Imported modules, subject to build configuration | SVG Symbol is a suitable starting point: it reuses the Icon container without configuring Vue custom element recognition. **Current API:** `CIcon` does not have a `symbol` prop and does not download, register or inject IconPark resources. The examples below use the existing default slot. `name` only resolves icon components registered in the current Vue application; it does not resolve Symbol IDs or Web Component icon names. Default slot content takes precedence over `name`. #### SVG Symbol: load the project script Copy the **SVG Symbol** script URL from your custom project and load it once in the application's HTML entry, such as `index.html` in a Vite application: ```html ``` After execution, the script should inject an SVG collection containing `symbol` nodes into the page. The application owns the resource URL and decides whether to use a remote URL or a deployed static file. The component library does not embed business project URLs. Load the script type you chose; using the same collection does not require loading both script variants. #### SVG Symbol: reference an icon Suppose the script injects ``. You can render it as follows. Paths and IDs in these examples are placeholders; use the values in your generated output. ```vue ``` `href` uses the complete Symbol ID with a leading `#`. Display names, the library's `name` prop and IconPark icon names may differ from the Symbol ID. Do not invent or strip prefixes; inspect `symbol[id]` in developer tools. This references resources injected into the current page: do not use `href="project.js#project-home"`. `size` sets the container's font size, and the inner SVG follows it through `1em`. `rotate` and `spin` affect the entire container. Without an explicit `size`, normal Icon size inheritance applies. Preserve the generated Symbol's `viewBox` to avoid clipping or incorrect scaling. #### An application wrapper for shorter usage Create an application component named `ProjectIcon.vue` if you want to pass an ID as a prop. This requires neither a library API change nor a generated Vue file for each icon: ```vue ``` Use it in the application: ```vue ``` Here, `symbol` belongs to the application wrapper and excludes `#`. Undeclared attributes such as `size`, `color`, `rotate` and `spin` fall through to the single `CIcon` root. Forward `$attrs` explicitly if you add multiple roots or disable `inheritAttrs`. The existing `transition` prop only animates `CIcon`'s `name` changes; it does not animate Symbol reference changes inside the slot. #### Web Component: script and compiler configuration Alternatively, load your project's **Web Component JS** and place its registered element in the slot. The following assumes the generated element is named `iconpark-icon` and uses a `name` attribute. Confirm element names, attributes and theme support against your project's generated usage instructions. ```html ``` Configure the build that compiles Vue SFCs containing this tag to recognize the custom element. For Vite: ```ts import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' export default defineConfig({ plugins: [ vue({ template: { compilerOptions: { isCustomElement: (tag) => tag === 'iconpark-icon', }, }, }), ], }) ``` Merge this into the existing Vue plugin configuration instead of adding a duplicate plugin. `isCustomElement` is a compile-time setting; setting only `app.config.compilerOptions` does not replace this configuration when using a build tool. Configure the library build when the tag is wrapped inside library source, or the application build when application source uses the tag directly. ```vue ``` This example uses the application's existing `c-icon` import or registration. The outer `CIcon` does not automatically forward theme, stroke width or other attributes to slot content. Set supported attributes directly on the custom element. If it uses Shadow DOM, external `.c-icon svg` rules cannot directly style its inner SVG; use the element's supported attributes, inherited styles or CSS variables. #### Size, color and multicolor icons | Setting | Behavior and limitations | | --- | --- | | `size` | Symbol examples inherit through `1em`; check the Web Component's own sizing API | | `color` | Works only when the graphic uses `currentColor` or supports corresponding inheritance | | Fixed `fill` / `stroke` | Colors embedded in the graphic are not automatically overridden by the container's `color` | | Multicolor icons | Preserve their colors; avoid forcing a single `fill` or `stroke` across all paths | | Themes and stroke width | Depend on generated output; public Vue icon package props do not automatically apply to project scripts | #### On-demand loading and bundle size Importing components on demand and loading icon resources are independent. Slot usage does not make `CIcon` depend on the entire IconPark package, and existing Resolver imports still work. The Resolver does not load resources based on a `use` ID. A Symbol script that injects a collection loads that entire file. If it contains 200 icons and a page references three, all 200 are still downloaded and injected. `href="#project-home"` selects a graphic; it does not request an individual icon. A static script is outside the application's module tree-shaking analysis, and string IDs do not automatically remove unused Symbols. | Goal | Approach | | --- | --- | | Small collection reused across pages | Load once at application entry and reuse the browser cache by file version | | Large collection with distinct business modules | Split resources into shared and module collections; load each when its route or module needs it | | Render the page before loading icons | Manage loading, failure and placeholder states in the application; show icons when resources are ready | | Require individual icons to participate in tree shaking | Use separate SVG modules or Vue components and verify package exports and actual build output | Remote JS is outside the library's npm package but still contributes to application download size. Updating the project requires updating generated resources and their cache versions. The component library's build size alone does not describe page cost. #### Loading order, SSR and accessibility - Make static resources available when icons are needed. For dynamic loading, wait for successful script execution. For Web Components, `customElements.whenDefined('iconpark-icon')` can additionally wait for registration; it neither downloads the script nor automatically settles on a resource loading failure. - Load each resource once per application instead of inserting a script on every component mount. Keep Symbol IDs unique across collections to avoid conflicting references. - Do not execute scripts requiring `window`, `document` or `customElements` on the server. Use HTML scripts or client lifecycle loading. When rendering conditionally, keep server and initial client placeholders consistent. Icons remain invisible until their resources exist; strict first-paint requirements need server-inlined Symbols or individual SVGs. - Use `aria-hidden="true"` for decorative SVGs. Give standalone informative SVGs `role="img"` and an accessible name. Give icon-only buttons an `aria-label` on the button itself. #### Troubleshooting | Symptom | Check | | --- | --- | | Blank icon | Successful script execution, correct script variant, exact ID and nonzero container size | | `Failed to resolve component: iconpark-icon` | Compile-time `isCustomElement` configuration for the source containing the tag | | Color does not change | Fixed graphic colors or the Web Component's supported color interface | | Size does not follow `CIcon` | Inner SVG / element sizing through `1em` and any fixed pixel dimensions | | Old icon after a project update | Current script version and browser / CDN caching | | Works locally but fails after deployment | Resource base paths, network requests, CSP `script-src` and script execution errors | | Wrong icon with multiple collections | Symbol ID collisions, duplicate scripts and the unique IDs in actual output | References: [Vue and Web Components](https://vuejs.org/guide/extras/web-components), [SVG use element](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/use). ## Interaction and control ### Click #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | `inherit` | Click, Dynamic Name | | `color` | Icon color | Click | | `name` | Explicitly registered icon name | Dynamic Name | | `transition` | Name-change animation duration in ms | Dynamic Name | - `size`: Controls the component size. - `color`: Overrides the color. Example source: src/icon/__demos__/click.vue ```vue ``` ### Dynamic Name - `size`: Controls the component size. Example source: src/icon/__demos__/dynamic-name.vue ```vue ``` ## Lifecycle and edge cases ### Lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `name` | Explicitly registered icon name | Lifecycle | | `transition` | Name-change animation duration in ms | Lifecycle | | `size` | `inherit` | Lifecycle | - `size`: Controls the component size. Example source: src/icon/__demos__/lifecycle.vue ```vue ``` ## API ### Icon Props | Prop | Description | Type | Default | | --------------- | ---------------------- | ---------------- | ------ | | name | Explicitly registered icon name | string | - | | size | `inherit` | number \| string | - | | color | Icon color | string | - | | rotate | Rotation angle | number | - | | spin | Whether to rotate continuously | boolean | false | | transition | Name-change animation duration in ms | number \| string | 0 | | animation-class | Custom transition animation class | string | - | ### Icon-xxx Props | Prop | Description | Type | Default | | --------------- | ---------- | ------------------------------------------ | ------- | | size | `inherit` | number \| string | - | | color | Icon color | string | - | | rotate | Rotation angle | number | - | | spin | Whether to rotate | boolean | false | | title | Accessible title | string | - | | stroke-width | Stroke width | number | 4 | | stroke-linecap | Stroke line cap | 'butt' \| 'round' \| 'square' | 'butt' | | stroke-linejoin | Stroke line join | 'bevel' \| 'inherit' \| 'miter' \| 'round' | 'miter' | ### Icon Events | Event | Description | Arguments | | ------ | -------------- | --------------------------- | | click | Click event | (event: MouseEvent) => void | ### Icon Slots | Slot | Description | | ------- | -------------- | | default | Custom default content | ### Type definitions The component exports the following types ```ts import type { IconProps } from "@cedar-design/ui"; ``` ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. Only icons registered in the current application are resolved. Repeated name changes cancel stale timers; no changes run after unmount. Each library locally adapts its registration prefix and legacy spin class; icon resources are not imported across libraries. Icons inherit the host font size on both platforms. For a fixed 20px icon, set size="20" or icon-size explicitly. The size prop overrides the variable; color inherits from the host by default. ### Motion variables | Token | Default | | --- | --- | | `--c-icon-spin-duration` | `1s` | Built-in motion follows prefers-reduced-motion: reduce: content and state feedback remain, while decorative spinning, shimmer and ripples stop. Icon name changes display the latest value immediately and cancel unfinished phases, keeping CSS and JS durations aligned. Callers must adapt custom animation classes. Ripple duration/cleanup follows Ripple documentation; its historical 250ms rule is not an Icon duration limit. --- Document: llms/en-US/components/image.md # Image Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `width`: Sets the configured width. Example source: src/image/__demos__/basic.vue ```vue ``` ## Image presentation and states ### Fit Mode #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `width` | Displayed image width | Fit Mode, Captions and additional content, Error | | `src` | Image source URL | Fit Mode, Captions and additional content, Error | | `height` | Displayed image height | Fit Mode, Error, Loader | | `preview-disabled` | Whether click preview is disabled | Fit Mode, Loader, Lazy | | `object-fit` | How the image fits its container | Fit Mode, Lazy | | `title` | Title | Captions and additional content | - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/fit-mode.vue ```vue ``` ### Captions and additional content Compare caption and extra-slot placement independently of previews, loading and failures. Example source: src/image/__demos__/content-comparison.vue ```vue ``` ### Error - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/error.vue ```vue ``` ### Loader - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/loader.vue ```vue ``` ### Lazy - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/lazy.vue ```vue ``` ## Preview entries and groups ### Disable Preview #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `width` | Displayed image width | Disable Preview, Preview Entry, Preview Group | | `src` | Image source URL | Disable Preview, Preview Entry, Preview Group | | `height` | Displayed image height | Preview Entry, Preview Group | | `object-fit` | How the image fits its container | Preview Entry, Preview Group | | `preview-disabled` | Whether click preview is disabled | Disable Preview | | `preview-props` | Preview options | Preview Entry | - `width`: Sets the configured width. Example source: src/image/__demos__/disable-preview.vue ```vue ``` ### Preview Entry - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/preview-entry.vue ```vue ``` ### Component Preview Preview configuration: `v-model:open="open"`, `src="/cat.jpg"`. Example source: src/image/__demos__/component-preview.vue ```vue ``` ### Imperative Preview Example source: src/image/__demos__/imperative-preview.vue ```vue ``` ### Preview Group - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/preview-group.vue ```vue ``` ### Component Preview Group Preview configuration: `v-model:open="open"`, `:images="images"`, `:loop="false"`. Example source: src/image/__demos__/component-preview-group.vue ```vue ``` ## Preview customization and interaction ### Ripple #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `width` | Displayed image width | Ripple, Overlay Closable, Hide Footer Never | | `src` | Image source URL | Ripple, Overlay Closable, Hide Footer Never | | `height` | Displayed image height | Ripple, Overlay Closable, Presentation | | `object-fit` | How the image fits its container | Ripple, Overlay Closable, Presentation | | `preview-disabled` | Whether click preview is disabled | Ripple, Hide Footer Never, Presentation | | `preview-props` | Preview options | Overlay Closable, Preview Popup Container | - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/ripple.vue ```vue ``` ### Overlay Closable - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/overlay-closable.vue ```vue ``` ### Hide Footer Never - `width`: Sets the configured width. Example source: src/image/__demos__/hide-footer-never.vue ```vue ``` ### Preview Features Preview configuration: `v-model:open="open"`, `:images="images"`, `:loop="false"`, `name="切换"`. Example source: src/image/__demos__/preview-features.vue ```vue ``` ### Presentation - `width`: Sets the configured width. - `height`: Constrains the component height. Example source: src/image/__demos__/presentation.vue ```vue ``` ### Preview Popup Container - `width`: Sets the configured width. Example source: src/image/__demos__/preview-popup-container.vue ```vue ``` ## Lifecycle ### Track Lifecycle Preview configuration: `v-model:open="open"`, `:images="images"`, `:loop="loop"`, `name="Replace images / 换图"`. Example source: src/image/__demos__/track-lifecycle.vue ```vue ``` ### Controller Lifecycle Preview configuration: `v-model:open="open"`, `:src="source"`, `interaction="touch"`, `:keyboard="true"`. Example source: src/image/__demos__/controller-lifecycle.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Preview collection navigation, horizontal keys and swipes follow reading direction without reversing the image array. Direction changes cancel pending gestures while preserving the current image, scale and rotation. Images and zoomed pan coordinates are not mirrored. Numerical indicators remain LTR. ## API ImagePreviewGroup binds a one-based image number through ordinary `v-model`; `defaultValue` initializes the uncontrolled index. Panel opening uses `v-model:open` and `defaultOpen` independently. Programmatic preview options also use modelValue/`defaultValue` and onUpdate:modelValue. ### `` Props | Parameter | Description | Type | Default | Version | | -------------------------- | ------------------------------------------------------- | ---------------------------------------------------------- | :-------: | :----- | | src | Image source URL | `string` | `-` | | | width | Displayed image width | `string \| number` | `-` | | | height | Displayed image height | `string \| number` | `-` | | | title | Title | `string` | `-` | | | description | Caption displayed at the bottom; also used as alt when alt is empty | `string` | `-` | | | object-fit | How the image fits its container | `'contain' \| 'cover' \| 'fill' \| 'none' \| 'scale-down'` | `-` | | | alt | Image text description | `string` | `-` | | | hide-footer | Whether to hide the footer; supports `'never'`, which retains the footer on error | `boolean \| 'never'` | `false` | | | footer-position | Footer region inside (inner) or outside (outer) the image, default inner; not four-side popup placement | `'inner' \| 'outer'` | `'inner'` | | | show-loader | Whether to show a loading effect | `boolean` | `false` | | | preview-disabled | Whether click preview is disabled | `boolean` | `false` | | | open **(v-model)** | Controlled preview open state | `boolean` | `-` | | | default-open | Default preview open state | `boolean` | `false` | | | preview-props | Preview options | `ImagePreviewProps` | `-` | | | footer-class | Footer-area class | `string\|array\|object` | `-` | 2.23.0 | | popup-container | Preview mount container | `string \| HTMLElement \| false` | `-` | | ### `` Events | Event | Description | Arguments | | ------------------- | -------------------- | --------------- | | open-change | Preview open/close event | open: `boolean` | ### `` Slots | Slot | Description | Arguments | | --------------- | :------------------: | ---- | | error | Custom error-state content | - | | error-icon | Custom error-state icon | - | | loader | Custom loading effect | - | | extra | Additional footer content | - | | preview-actions | Custom preview toolbar | - | ### `` Props | Parameter | Description | Type | Default | | ------------------ | ----------------------------------------------------------------- | ----------------------- | :----------------------------------------------------------------------------------------: | | src | Image source URL | `string` | `-` | | open **(v-model)** | Whether open | `boolean` | `-` | | default-open | Default uncontrolled open state | `boolean` | `false` | | overlay-closable | Whether clicking the overlay outside the image requests closing; clicking the image does not close it | `boolean` | `true` | | closable | Show the close button | `boolean` | `true` | | actions-layout | Action layout | `string[]` | `[ 'fullScreen', 'rotateRight', 'rotateLeft', 'zoomIn', 'zoomOut', 'originalSize',]` | | popup-container | Popup mount target, matching `teleport` `to`; defaults `to` document.body | `HTMLElement \| string \| false` | `-` | | esc-to-close | Whether ESC closes the preview | `boolean` | `true` | | wheel-zoom | Whether mouse-wheel zoom is enabled | `boolean` | `true` | | keyboard | Whether keyboard controls are enabled | `boolean` | `true` | | default-scale | Default zoom scale | `number` | `1` | | scale-step | Zoom increment per action | `number` | `0.5` | ### `` Events | Event | Description | Arguments | | ----------- | ------------ | --------------- | | close | Close event | - | | open-change | Open-state change | open: `boolean` | ### `` Slots | Slot | Description | Arguments | Version | | ------- | :----------------: | ---- | :----- | | actions | Additional custom actions | - | 2.17.0 | ### `` Props | Parameter | Description | Type | Default | | --------------------- | ----------------------------------------------------------------- | ----------------------- | :----------------------------------------------------------------------------------------: | | images | Image list; providing it disables collection of child Image sources | `string[]` | `-` | | model-value **(v-model)** | Index of the current image, starting at 1 | `number` | `-` | | default-value | Initially displayed image index, starting at 1 | `number` | `1` | | loop | Whether to loop indefinitely | `boolean` | `false` | | open **(v-model)** | Controlled open state | `boolean` | `-` | | default-open | Default uncontrolled open state | `boolean` | `false` | | overlay-closable | Whether clicking the overlay outside the image requests closing; clicking the image does not close it | `boolean` | `true` | | closable | Show the close button | `boolean` | `true` | | actions-layout | Toolbar layout | `string[]` | `[ 'fullScreen', 'rotateRight', 'rotateLeft', 'zoomIn', 'zoomOut', 'originalSize',]` | | popup-container | Popup mount target, matching `teleport` `to`; defaults `to` document.body | `string \| HTMLElement \| false` | `-` | ### `` Events | Event | Description | Arguments | | ----------- | ---------------- | --------------- | | change | Switch image | imageNumber: `number`,previousImageNumber: `number` | | open-change | Preview open/close | open: `boolean` | ### `` Slots | Slot | Description | Arguments | Version | | ------- | :----------------: | ---- | :----- | | actions | Additional custom actions | - | 2.46.0 | ### `` Props (2.17.0) | Parameter | Description | Type | Default | | -------- | -------- | --------- | :-----: | | name | Name | `string` | `-` | | disabled | Whether disabled | `boolean` | `false` | ### Type definitions ```ts import type { ImageInstance } from "@cedar-design/ui"; import { imagePreview } from "@cedar-design/ui"; ``` ### `imagePreview` methods Replacing an imperative preview disposes the previous instance and invokes its `onClosed` once, just like normal closure. Use this callback to release owned resources such as Object URLs. Old handles never close newer previews. If `onClosed` synchronously opens a new preview, that newer call wins and the interrupted outer call returns `undefined`. | Method | Description | Arguments | | ---------------------------------- | ------------ | ------------------------------------- | | `imagePreview` | Open the image preview | `url \| url[] \| ImagePreviewOptions` | | `imagePreview.close` | Close the preview | `-` | | `imagePreview.setDefaultOptions` | Set default configuration | `ImagePreviewOptions` | | `imagePreview.resetDefaultOptions` | Reset default configuration | `-` | ## FAQ ### `image-preview` prop notes 1. With `keyboard` set to `true`, shortcuts are enabled according to `actions-layout`. - `esc`: close the preview - `left`: previous image - `right`: next image - `up`: zoom in - `down`: zoom out - `space`: restore original size 2. `defaultScale` sets the initial zoom ratio. For example, 1.5 initially displays the image at 1.5 times its original size. 3. `scaleStep` sets the zoom increment for wheel, double-click and toolbar actions. ### Variable consumption boundaries `--c-image-preview-arrow-font-size` controls preview-group arrows. DOM for old actions-item, trigger, scale-value dimensions and simple-toolbar variables no longer exists; these ineffective entries are removed. The toolbar uses preview-color-action-* and preview-padding-action-content; the footer uses existing footer variables. Error/loading layers fill the image without an extra 100px minimum height. Zoom/track transitions use system motion and stop under reduced motion. ### Image-preview group numbering `modelValue/defaultValue` start at `1`. `open(imageNumber = 1)` and `to(imageNumber)` use the same numbering; invalid/noninteger values are ignored. `prev()/next()` retain this numbering at loop boundaries. Model events are `update:modelValue(imageNumber)`; navigation emits `change(imageNumber, previousImageNumber)`, while external assignments do not. Long press emits `long-press(imageNumber)`; the indicator slot receives `{ imageNumber, length }`. Internal array indices remain zero-based. Root `class` and `style` merge with the Image wrapper. Use `img-props.class/style` to style the inner image. Preview `open-change` is a Vue notification event: each state transition emits once, `.once` uses Vue event semantics, and returned Promises do not control loading. The typed `onOpenChange` listener uses this same event path. --- Document: llms/en-US/components/infinite-scroll.md # Infinite Scroll Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### List - `status`: Selects the semantic state. Example source: src/infinite-scroll/__demos__/list.vue ```vue ``` ## Content and presentation ### Error #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Pagination state; supports `v-model:status` | Error | | `target` | Scroll container; defaults to the nearest scrolling ancestor | Error | - `status`: Selects the semantic state. Example source: src/infinite-scroll/__demos__/error.vue ```vue ``` ## Customization and slots ### Custom Status #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Pagination state; supports `v-model:status` | Custom Status | | `target` | Scroll container; defaults to the nearest scrolling ancestor | Custom Status | | `bottom-offset` | Distance-to-bottom threshold; numbers are px, strings are CSS lengths | Custom Status | - `status`: Selects the semantic state. Example source: src/infinite-scroll/__demos__/custom-status.vue ```vue ``` ## Lifecycle and edge cases ### Scheduler Lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Pagination state; supports `v-model:status` | Scheduler Lifecycle | | `target` | Scroll container; defaults to the nearest scrolling ancestor | Scheduler Lifecycle | | `immediate` | Whether to check immediately after mounting and resolving the scroll container | Scheduler Lifecycle | - `status`: Selects the semantic state. Example source: src/infinite-scroll/__demos__/scheduler-lifecycle.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ------------- | -------------------------------------------------- | ---------------------------------------------- | -------- | | status | Pagination state; supports `v-model:status` | `'idle' \| 'loading' \| 'error' \| 'finished'` | `'idle'` | | bottom-offset | Distance-to-bottom threshold; numbers are px, strings are CSS lengths | `string \| number` | `0` | | immediate | Whether to check immediately after mounting and resolving the scroll container | `boolean` | `true` | | disabled | Pause loading and retry | `boolean` | `false` | | target | Scroll container; defaults to the nearest scrolling ancestor | `string \| HTMLElement` | `-` | ### `` Events | Event | Description | Arguments | | ------------- | -------------------------- | --------- | | update:status | Requests pagination status `loading` | `loading` | | load | Emitted when idle and the threshold is reached | - | | retry | Emitted when retry is invoked in the error state | - | `retry` does not also emit `load`. Both events may call the same business request function. ### `` Methods | Method | Description | | ------ | ---------------------------- | | check | Immediately check whether the loading threshold is reached | | retry | Request a retry in the `error` state | ### `` Slots | Slot | Description | Arguments | | -------- | ---------------- | ------------------- | | default | Observed content | - | | loading | Pagination loading state | - | | error | Pagination error state | `retry: () => void` | | finished | All-pages-loaded state | - | The default error area retries on click. `finished` is terminal; detection resumes only when the parent resets `status` to `idle`. ### Type definitions ```ts import type { InfiniteScrollInstance, InfiniteScrollMethods, InfiniteScrollProps, InfiniteScrollStatus, } from "@cedar-design/ui"; ``` ### Style variables | Variable | Default | | ----------------------------------------------- | ----------------------- | | `--c-infinite-scroll-status-min-height` | `50px` | | `--c-infinite-scroll-status-padding` | `12px 0` | | `--c-infinite-scroll-status-color` | `var(--c-color-text-3)` | | `--c-infinite-scroll-status-font-size` | `var(--c-font-size-md)` | | `--c-infinite-scroll-loading-gap` | `8px` | | `--c-infinite-scroll-error-color` | `var(--c-color-danger)` | --- Document: llms/en-US/components/input-number.md # InputNumber Numeric editing with bounds and formatting. ## Reading direction The numeric input inherits its source `dir`; step buttons follow reading order. Values, precision and vertical keys retain their meaning: ArrowUp increases and ArrowDown decreases. Neither values nor display strings are reversed. ## Basic examples ### Basic usage Example source: src/input-number/__demos__/field-basic.vue ```vue ``` ## Appearance and layout ### Appearance Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------- | ---------------------------- | | `size` | All five sizes implemented; inheritable | Control Sizes, Field Options | | `variant` | Field variant; inherits InputGroup | Control Sizes, Field Options | | `placeholder` | Placeholder | Control Sizes, Field Options | | `min` | Minimum | Appearance Lab | | `max` | Maximum | Appearance Lab | | `mode` | Step-button layout | Field Modes | - `min`: Sets the lower bound. - `max`: Sets the upper bound. Example source: src/input-number/__demos__/appearance-lab.vue ```vue ``` ### Control Sizes - `size`: Controls the component size. - `variant`: Selects the visual variant. Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ### Field Modes Example source: src/input-number/__demos__/field-modes.vue ```vue ``` ### Field Options - `size`: Controls the component size. - `variant`: Selects the visual variant. Example source: src/input-number/__demos__/field-options.vue ```vue ``` ## Numeric input and formatting ### Quantity Controls #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------------- | -------------------------------------------------- | | `clearable` | Allow clearing an editable field | Quantity Controls, Format Slots, Number Boundaries | | `mode` | Step-button layout | Quantity Controls, Format Slots | | `min` | Minimum | Quantity Controls, Number Boundaries | | `max` | Maximum | Quantity Controls, Number Boundaries | | `step` | Positive finite step; scientific notation supported | Quantity Controls, Number Boundaries | | `formatter` | Display formatting only; does not change the number | Format Slots, Number Boundaries | - `min`: Sets the lower bound. - `max`: Sets the upper bound. - `step`: Controls the allowed increment. - `disabled`: Prevents user interaction. Example source: src/input-number/__demos__/quantity-controls.vue ```vue ``` ### Format Slots Example source: src/input-number/__demos__/format-slots.vue ```vue ``` ### Number Boundaries - `step`: Controls the allowed increment. - `max`: Sets the upper bound. - `min`: Sets the lower bound. Example source: src/input-number/__demos__/number-boundaries.vue ```vue ``` ### Empty markers and valid zero Configure empty-values and empty-value when an API uses -1 for missing data. Initially the input is blank while the model remains -1. Set it to 0 to see a valid zero; clearing returns -1. A second field clears to a valid 0, showing that clear output need not mean missing data. Example source: src/input-number/__demos__/en-US/empty-value.vue ```vue ``` ## Interaction and forms ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------- | ----------------------------------- | | `disabled` | Disabled; inherits when omitted | State Lab, Form Inheritance | | `readonly` | Read-only; allows focus/copy but no mutations | State Lab, Form Inheritance | | `clearable` | Allow clearing an editable field | Controlled Events, Form Inheritance | | `min` | Minimum | State Lab | | `max` | Maximum | State Lab | | `error` | Error state; inherits FormItem when omitted | State Lab | - `min`: Sets the lower bound. - `max`: Sets the upper bound. Example source: src/input-number/__demos__/state-lab.vue ```vue ``` ### Controlled Events Example source: src/input-number/__demos__/controlled-events.vue ```vue ``` ### Form Inheritance - `disabled`: Prevents user interaction. - `readonly`: Displays the current value without allowing edits. - `size`: Controls the component size. Example source: src/input-number/__demos__/form-inheritance.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Clear output `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. ### Props | Prop | Description | Type | Default | | ------------- | ---------------------------------------------------------------- | ------------------------------- | -------------------------- | | model-value | Controlled number; undefined denotes an empty/uncontrolled value | `number` | — | | default-value | Initial uncontrolled value | `number` | — | | mode | Step-button layout | `embed \| button \| input` | `embed` | | precision | Decimal places (0–100), at least the step precision | `number` | — | | step | Positive finite step; scientific notation supported | `number` | `1` | | disabled | Disabled; inherits when omitted | `boolean` | Inherited, otherwise false | | error | Error state; inherits FormItem when omitted | `boolean` | Inherited, otherwise false | | max | Maximum | `number` | `Infinity` | | min | Minimum | `number` | `-Infinity` | | formatter | Display formatting only; does not change the number | `(text: string) => string` | — | | parser | Parse the original text once per edit | `(text: string) => string` | — | | placeholder | Placeholder | `string` | — | | size | All five sizes implemented; inheritable | `xs \| sm \| md \| lg \| xl` | Inherited, otherwise md | | variant | Field variant; inherits InputGroup | `outline \| filled \| standard` | `outline` | | hint | Floating hint; inherits InputGroup / FieldDecorator | `boolean` | Library default | | clearable | Allow clearing an editable field | `boolean` | `false` | | model-event | Model update timing; change only reports commits | `change \| input` | `change` | | readonly | Read-only; allows focus/copy but no mutations | `boolean` | Inherited, otherwise false | | input-attrs | Additional native input attributes | `Record` | — | ### Events | Event | Arguments | Description | | ------------------ | ---------------------------------------------------------- | ---------------------------------------------------------------- | | input | `(value: number \| undefined, text: string, event: Event)` | Parsed value and display text while editing | | update:model-value | `(value: number \| undefined)` | Proposed model update | | change | `(value: number \| undefined, event: Event)` | Commit, step or clear | | clear | `(event: Event)` | Explicit clear | | focus | `(event: FocusEvent)` | Focus | | blur | `(event: FocusEvent)` | Blur | | keydown | `(event: KeyboardEvent)` | Native keyboard event; preventDefault intercepts default actions | ### Slots | Slot | Arguments | Description | | ---------------- | ------------------------------------ | ------------------- | | prefix / suffix | — | Inside the field | | prepend / append | — | Outside the field | | plus / minus | — | Step-button icons | | clear-icon | `{ clear: (event?: Event) => void }` | Custom clear button | ### Methods | Method / property | Type | Description | | ----------------- | ---------------------------------- | --------------------------------- | | focus | `(options?: FocusOptions) => void` | Focus; ineffective while disabled | | blur | `() => void` | Blur | | select | `() => void` | Select all text | | inputRef | `HTMLInputElement \| undefined` | Native input element | ## Type definitions / Types ```ts import type { InputNumberProps, InputNumberInstance, InputNumberMode, InputNumberModelEvent, InputNumberSize, InputNumberVariant, InputNumberFormatter, InputNumberParser, } from "@cedar-design/ui"; ``` ## Style variables | Token | Default | | -------------------------------------------------- | -------------------------------------- | | `--c-input-number-step-button-width` | `var(--c-sys-control-height-md)` | | `--c-input-number-step-button-color` | `var(--c-sys-color-content-secondary)` | | `--c-input-number-step-button-disabled-color` | `var(--c-sys-color-content-disabled)` | | `--c-input-number-step-button-border-color` | `var(--c-sys-color-border-subtle)` | | `--c-input-number-step-button-background` | `var(--c-sys-color-surface-muted)` | | `--c-input-number-step-button-hover-background` | `var(--c-sys-color-state-hover)` | | `--c-input-number-step-button-active-background` | `var(--c-sys-color-state-selected)` | | `--c-input-number-step-button-icon-size` | `14px` | | `--c-input-number-step-button-transition-duration` | `0.2s` | | `--c-input-number-addon-background` | `var(--c-sys-color-surface-muted)` | | `--c-input-number-addon-color` | `var(--c-sys-color-content-primary)` | | `--c-input-number-addon-border-color` | `var(--c-sys-color-border-default)` | | `--c-input-number-border-width` | `1px` | | `--c-input-number-border-radius` | `var(--c-field-border-radius)` | | `--c-input-number-size-xs-step-button-width` | `var(--c-sys-control-height-xs)` | | `--c-input-number-size-sm-step-button-width` | `var(--c-sys-control-height-sm)` | | `--c-input-number-size-md-step-button-width` | `var(--c-sys-control-height-md)` | | `--c-input-number-size-lg-step-button-width` | `var(--c-sys-control-height-lg)` | | `--c-input-number-size-xl-step-button-width` | `var(--c-sys-control-height-xl)` | Old `--c-field-number-*` tokens are removed in favor of `--c-input-number-*`, without aliases. Shared field appearance still uses FieldDecorator `--c-field-*` tokens. ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. `--c-field-caret-color` sets the shared caret color, defaulting to `currentColor`. `--c-input-number-caret-color` overrides this component and defaults to `var(--c-field-caret-color)`. An explicit beforeCommit wait uses the existing loadingMode indicator and native aria-busy. Manual loading remains independent and does not implicitly make the input readonly; the beforeCommit guard owns its existing input lock. Returned change/step notification Promises do not control waiting. --- Document: llms/en-US/components/input-tag.md # InputTag Editable tag values with controlled array models. ## Reading direction Tags follow reading order while their source array stays unchanged. With empty input, Backspace removes the last closable value; Enter adds a tag. Composition does not submit or delete tags. ## Basic examples ### Basic usage Example source: src/input-tag/__demos__/basic.vue ```vue ``` ## Appearance and states ### Tag input size and state #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ---------------------------------- | ------------------------ | | `default-value` | Default value (uncontrolled state) | Tag input size and state | | `placeholder` | Placeholder | Tag input size and state | | `size` | The size of the input | Tag input size and state | | `clearable` | Enables the clear action | Tag input size and state | | `disabled` | Whether disabled | Tag input size and state | | `readonly` | Whether it is read-only mode | Tag input size and state | Compare sizes and disabled, read-only or error appearance while keeping the empty-value protocol separate. Example source: src/input-tag/__demos__/appearance-state-comparison.vue ```vue ``` ## Content and presentation ### Max #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | --------------------------------------------------------- | ---------------- | | `default-value` | Default value (uncontrolled state) | Max | | `placeholder` | Placeholder | Max | | `max-tag-count` | The maximum number of tags displayed, `0` means unlimited | Max | | `clearable` | Enables the clear action | Max | - `default-value`: Default value (uncontrolled state) - `placeholder`: Placeholder - `max-tag-count`: The maximum number of tags displayed, `0` means unlimited - `clearable`: Whether to allow clear Example source: src/input-tag/__demos__/max.vue ```vue ``` ## Loading and waiting ### Controlled loading | Prop | Description | Type | Default | | --- | --- | --- | --- | | `loading` | Explicit business loading state | `boolean` | `false` | Set loading explicitly to display feedback. Ordinary event return values do not drive loading. Before hooks retain their documented pending behavior. Example source: src/input-tag/__demos__/loading.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### `` Props | Parameter | Description | Type | Default | | ------------------------- | --------------------------------------------------------- | ------------------------------------------------- | :--------: | | model-value **(v-model)** | Bound value | `(string \| number \| TagData)[]` | `-` | | default-value | Default value (uncontrolled state) | `(string \| number \| TagData)[]` | `[]` | | input-value **(v-model)** | The value of the input | `string` | `-` | | default-input-value | The default value of the input (uncontrolled state) | `string` | `''` | | placeholder | Placeholder | `string` | `-` | | disabled | Whether disabled | `boolean` | `false` | | error | Whether it is an error state | `boolean` | `false` | | readonly | Whether it is read-only mode | `boolean` | `false` | | clearable | Enables the clear action | `boolean` | `false` | | size | The size of the input | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | | variant | The variant of the input | `'filled' \| 'outline' \| 'standard'` | `'filled'` | | max-tag-count | The maximum number of tags displayed, `0` means unlimited | `number` | `0` | | retain-input-value | Whether to keep the content of the input box | `boolean \| { create?: boolean; blur?: boolean }` | `false` | | format-tag | Format tag content | `(data: TagData) => string` | `-` | | unique-value | Whether to create only unique values | `boolean` | `false` | | field-names | Customize fields in `TagData` | `InputTagFieldNames` | `-` | | tag-nowrap | Tag content does not wrap | `boolean` | `false` | ### `` Events | Event | Description | Arguments | | ------------------ | --------------------------------------------- | ------------------------------------------------------- | | change | Emitted when the value changes | value: `(string \| number \| TagData)[]`
ev: `Event` | | input-value-change | Emitted when the input value changes | inputValue: `string`
ev: `Event` | | press-enter | Emitted when Enter is pressed | inputValue: `string`
ev: `KeyboardEvent` | | remove | Emitted when a tag's remove button is clicked | removed: `string \| number`
ev: `Event` | | clear | Emitted when the clear button is clicked | ev: `MouseEvent` | | focus | Emitted when the input gains focus | ev: `FocusEvent` | | blur | Emitted when the input loses focus | ev: `FocusEvent` | ### `` Methods | Method | Description | Arguments | Returns | | ------ | --------------- | --------- | ------- | | focus | Focus the input | - | - | | blur | Blur the input | - | - | ### `` Slots | Slot | Description | Arguments | | ------ | :-------------------------: | --------------- | | tag | Displayed input-tag content | data: `TagData` | | prefix | Prefix content | - | | suffix | Suffix content | - | ### TagData | Parameter | Description | Type | Default | | --------- | ---------------- | ------------------ | :-----: | | value | Tag value | `string \| number` | `-` | | label | Tag content | `string` | `-` | | closable | Whether closable | `boolean` | `false` | | tagProps | Tag props | `TagProps` | `-` | ### Type definitions The component exports the following types ```ts import type { InputTagInstance } from "@cedar-design/ui"; ``` ## Removing legacy InputTag icon references Cedar InputTag embeds Tag's actual close-btn and renders no old c-icon-hover pseudo-element. The old mixin import, default/focus pseudo-element backgrounds and duplicate custom Tag text rules are removed; Tag owns its text. Existing close-button appearance, click removal and readonly/disabled behavior remain, without a new hover background. Both libraries remove tag-custom-icon-bg-hover; Cedar also removes input-tag-tag-remove-icon-color-bg / input-tag-tag-remove-icon-color-bg-focus. Unused variables have no replacements; remove ineffective overrides. No aliases remain. Maple has no InputTag component and only synchronizes shared Tag-variable cleanup. The former cross-component exemptions are closed. check:token-consumers checks 414 Badge/Tag declarations without exemptions and compiles InputTag to prevent legacy icon selectors/variables returning. Integration tests cover actual DOM, close interactions and custom colors. The 553 shared defaults are unchanged because removed shared variables previously registered names only. This does not claim complete InputTag token, browser-visual or keyboard governance. ## InputTag wrapper and content responsibilities FieldDecorator owns InputTag outline / filled / standard wrappers. Form must not redraw backgrounds, borders or focus shadows; old Form overrides for obsolete InputTag state classes are removed, while validation messages remain. filled default/hover/focus still use FieldDecorator fill-1 / fill-2 / fill-3. input-tag-* controls content density, default tag backgrounds and disabled text. Selectors match actual c-field-decorator--size-* / --focus / --disabled classes rather than nonexistent old InputTag classes; disabled overrides focus. All xs/sm/md/lg/xl sizes are covered. xl uses 32px tags, 16px input text and 4px vertical padding. Removed 33 unused wrapper variables: size-{xs,sm,md,lg}-height; color-text-error; color-placeholder, color-icon-clear, color-icon-clear-bg-hover; color-border-{default,error,disabled} and -hover/-focus forms; color-bg-{default,error}, their -hover/-focus forms, color-bg-disabled and its -hover form; color-shadow-{default,error}-focus; size-shadow-{default,error}-focus; border-radius, border-width, size-icon-clear and size-icon-clear-hover. All use --c-input-tag-. No compatibility aliases remain. Migrate by responsibility: field-variant-{variant}-background for wrapper backgrounds; field-border-radius for corners; field-placeholder-text-color for placeholders; field-clear-icon-color / field-clear-icon-size for clear icons. Prefer size for geometry; do not override internal variables. Unused legacy variables have no one-to-one replacement. Tag content uses the InputTag variables below. InputTag retains 27 content variables in unused-consumer checks. Both libraries’ Badge/Tag plus Cedar InputTag cover 441 declarations and 80 size/focus/disabled cascades. The shared-default contract remains 553 entries; Cedar-only InputTag is not a cross-platform shared component. Default text, disabled text, tag backgrounds and focused backgrounds use content-primary, content-disabled, surface-default and state-hover. Disabled restyles neutral tags only, preserving explicit color/status; business themes own custom-color contrast. Parent disabled/readonly overrides tagProps.closable/checkable. Loading or explicitly nonclosable tags cannot be removed with Backspace. Cedar spot checks cover five sizes, xl input/keyboard removal, light/dark modes and disabled custom colors, not a complete visual audit. ### Current content variables | Variable | Default | | ----------------------------------------- | ------------------------------------- | | `--c-input-tag-size-xs-tag-height` | `20px` | | `--c-input-tag-size-sm-tag-height` | `20px` | | `--c-input-tag-size-md-tag-height` | `24px` | | `--c-input-tag-size-lg-tag-height` | `28px` | | `--c-input-tag-size-xl-tag-height` | `32px` | | `--c-input-tag-size-xs-font-size` | `12px` | | `--c-input-tag-size-sm-font-size` | `14px` | | `--c-input-tag-size-md-font-size` | `14px` | | `--c-input-tag-size-lg-font-size` | `14px` | | `--c-input-tag-size-xl-font-size` | `16px` | | `--c-input-tag-color-text-default` | `var(--c-sys-color-content-primary)` | | `--c-input-tag-color-text-disabled` | `var(--c-sys-color-content-disabled)` | | `--c-input-tag-tag-margin-right` | `4px` | | `--c-input-tag-tag-margin-y` | `2px` | | `--c-input-tag-padding-x` | `4px` | | `--c-input-tag-size-xs-padding-y` | `0px` | | `--c-input-tag-size-sm-padding-y` | `2px` | | `--c-input-tag-size-md-padding-y` | `2px` | | `--c-input-tag-size-lg-padding-y` | `2px` | | `--c-input-tag-size-xl-padding-y` | `4px` | | `--c-input-tag-tag-font-size` | `12px` | | `--c-input-tag-tag-color-bg` | `var(--c-sys-color-surface-default)` | | `--c-input-tag-tag-color-bg-focus` | `var(--c-sys-color-state-hover)` | | `--c-input-tag-tag-color-bg-disabled` | `var(--c-sys-color-state-hover)` | | `--c-input-tag-tag-color-border` | `var(--c-color-fill-3)` | | `--c-input-tag-tag-color-border-disabled` | `var(--c-color-fill-3)` | | `--c-input-tag-tag-color-border-focus` | `var(--c-sys-color-state-hover)` | ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. --- Document: llms/en-US/components/input.md # Input Text input with controlled and uncontrolled values. ## Reading direction The input inherits `dir` from its page or local scope. Affixes, clear actions and input groups follow reading order. Runtime changes retain the native editor, focus and selection; the browser handles caret movement, mixed text and composition without swapping editing keys. Parent rerenders preserve the native composition buffer; older selection-restoration tasks do not overwrite a newer composition. ## Basic examples ### Control Sizes - `size`: Controls the component size. - `variant`: Selects the visual variant. Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` Example source: src/input/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ---------------------------------------- | ---------------------------- | | `placeholder` | Hint text | Form Feedback, Floating Hint | | `hint` | Whether hint text floats | Form Feedback, Floating Hint | | `clearable` | Whether to allow the input to be cleared | Form Feedback, Floating Hint | | `variant` | Field appearance | Floating Hint | Choose an axis to compare its available values with the same content and model. Other settings remain unchanged while comparing. Example source: src/input/__demos__/appearance-lab.vue ```vue ``` ### Form Feedback Example source: src/input/__demos__/form-feedback.vue ```vue ``` ### Floating Hint - `variant`: Selects the visual variant. Example source: src/input/__demos__/floating-hint.vue ```vue ``` ## Input content and layout ### Word Limit #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------- | -------------------------------------------------------------------------------- | ------------------------------- | | `placeholder` | Hint text | Word Limit, Prefix, Group | | `clearable` | Whether to allow the input to be cleared | Word Limit, Prefix, Group State | | `max-length` | Maximum input length | Word Limit | | `show-word-limit` | Show the character counter | Word Limit | | `default-value` | Uncontrolled initial value; read only at creation, never written into the parent | Group State | | `disabled` | Disabled state; can inherit from Form | Group State | Example source: src/input/__demos__/word-limit.vue ```vue ``` ### Password Example source: src/input/__demos__/password.vue ```vue ``` ### Prefix Example source: src/input/__demos__/prefix.vue ```vue ``` ### Group Example source: src/input/__demos__/group.vue ```vue ``` ### Group State - `disabled`: Prevents user interaction. - `readonly`: Displays the current value without allowing edits. Example source: src/input/__demos__/group-state.vue ```vue ``` ## Value model and interaction ### Default Value #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | -------------------------------------------------------------------------------- | ---------------------------- | | `clearable` | Whether to allow the input to be cleared | Event Pipeline, TypeScript | | `default-value` | Uncontrolled initial value; read only at creation, never written into the parent | Default Value | | `aria-label` | Native input accessible label | Default Value | | `disabled` | Disabled state; can inherit from Form | Interaction state comparison | | `readonly` | Readonly state; can inherit from Form | Interaction state comparison | | `error` | Error state; can inherit from FormItem | Interaction state comparison | Example source: src/input/__demos__/default-value.vue ```vue ``` ### Clear icon and manual deletion Set clear output to null. Clear with the icon, restore the initial value, then delete all text with Backspace. The model shows null for the icon and an empty string for manual deletion. Example source: src/input/__demos__/en-US/empty-value.vue ```vue ``` ### Interaction state comparison Toggle the state, interact with the component, and restore editing using the controls outside the specimen. Error appearance alone does not run validation. Example source: src/input/__demos__/state-lab.vue ```vue ``` ### Event Pipeline Example source: src/input/__demos__/event-pipeline.vue ```vue ``` ### Commit approval `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes null unchanged; omitted values preserve the existing default. Editors render null as blank without converting ordinary empty-string input to null. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. Example source: src/input/__demos__/en-US/commit-protocol.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## Loading and waiting ### Loading Toggle loading to compare the default indicator and bottom line. The input remains editable while loading. Example source: src/input/__demos__/loading.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### `` Props | Parameter | Description | Type | Default | | ------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------- | :---------: | | model-value **(v-model)** | Bound value | `string \| null` | `-` | | `loading` | Loading presentation; keeps the input editable | `boolean` | `false` | | `loading-mode` | Loading layout: default indicator or bottom line | `default / line` | `default` | | model-modifiers | `v-model` modifiers; supports `trim` | `{ trim?: boolean }` | `{}` | | default-value | Uncontrolled initial value; read only at creation, never written into the parent | `string` | `''` | | variant | Field appearance | `'filled' \| 'outline' \| 'standard'` | `'outline'` | | size | Input size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | | clearable | Whether to allow the input to be cleared | `boolean` | `false` | | empty-value | Clear output; omission clears to an empty string and manual deletion is unchanged | `string \| null \| (() => string \| null)` | `undefined` | | disabled | Disabled state; can inherit from Form | `boolean` | `-` | | readonly | Readonly state; can inherit from Form | `boolean` | `-` | | error | Error state; can inherit from FormItem | `boolean` | `-` | | placeholder | Hint text | `string` | `-` | | hint | Whether hint text floats | `boolean` | `false` | | line | Whether to draw a border or underline | `boolean` | `true` | | text-color | Input text color | `string` | `-` | | focus-color | Focused hint and supported border colors; does not control the caret | `string` | `-` | | blur-color | Unfocused hint color | `string` | `-` | | aria-label | Native input accessible label | `string` | `-` | | autofocus | Focus automatically after mount | `boolean` | `false` | | enterkeyhint | Mobile virtual-keyboard enter-key hint | `string` | `-` | | max-length | Maximum input length | `number \| { length: number; errorOnly?: boolean }` | `0` | | show-word-limit | Show the character counter | `boolean` | `false` | | word-length | Length-counting function | `(value: string) => number` | `-` | | word-slice | Text-slicing function, used with wordLength | `(value: string, maxLength: number) => string` | `-` | | input-attrs | Attributes for the internal input element | `object` | `-` | `disabled / readonly / size` resolve from child → InputGroup → FormItem/Form → library defaults; Cedar size also supports ConfigProvider. `clearable` applies only to nonempty editable inputs: PC shows it on hover/focus, while touch devices and Maple keep it visible. Native name/id/aria-_/data-_ reach the input; class/style stay on the wrapper. `input-attrs` cannot override controlled value, type, disabled/readonly state or length policy. ### `` Events | Event | Description | Arguments | | ----------- | --------------------------------------------- | ------------------------------ | | input | Emitted on user input | value: `string`
ev: `Event` | | change | Emitted on blur, Enter submission or clearing | value: `string`
ev: `Event` | | press-enter | Emitted when the user presses Enter | ev: `KeyboardEvent` | | clear | Emitted when the user clicks the clear button | ev: `MouseEvent` | | focus | Emitted when the input gains focus | ev: `FocusEvent` | | blur | Emitted when the input loses focus | ev: `FocusEvent` | ### `` Methods | Method | Description | Arguments | Returns | | ------ | --------------- | --------- | ------- | | focus | Focus the input | - | - | | blur | Blur the input | - | - | | select | Select all text | - | - | ### `` Slots | Slot | Description | Arguments | | ---------- | :-----------------: | ---------------------- | | suffix | Suffix content | - | | prefix | Prefix content | - | | clear-icon | Custom clear button | `clear(event?: Event)` | ### `` Props | Parameter | Description | Type | Default | | ------------------ | ----------------------------------------------------------- | --------- | :-----: | | visibility-toggle | Whether to show the password-visibility toggle | `boolean` | `true` | | default-visibility | Default uncontrolled visibility | `boolean` | `false` | | visibility | Controlled password visibility; supports v-model:visibility | `boolean` | `-` | InputPassword supports all Input props, events, slots and methods. ### `` Props | Parameter | Description | Type | Default | | --------- | -------------------------------- | ------------------------------- | ------------------------------------------- | | size | Default size within the group | `ComponentSize` | Inherited from Form/ConfigProvider, or `md` | | variant | Default variant within the group | `filled \| outline \| standard` | `filled` | | disabled | Group disabled state | `boolean` | Inherited from Form, or `false` | | readonly | Group readonly state | `boolean` | Inherited from Form, or `false` | | hint | Group floating hint | `boolean` | Library default | ### `` Events | Parameter | Description | Arguments | | ----------------- | ------------------------------- | ----------------- | | visibility-change | Emitted when visibility changes | `visible:boolean` | ## Type definitions The component exports the following types ```ts import type { InputProps } from "@cedar-design/ui"; ``` Public types: `InputEmits`, `InputSlots`, `InputExpose`, `InputGroupSlots`, `InputPasswordEmits`, `InputPasswordSlots`, `InputPasswordExpose`. ### Form presentation inheritance Supports `edit-mode`: `direct / click / dblclick`. Inherits FormItem/Form when unset; standalone usage defaults to direct. readPretty displays plain text; popup editing updates v-model after confirmation by default. Optional before-commit can intercept saving after candidate validation. See the Form documentation for usage and comparison demos. ### Input caret theme | CSS variable | Default | Description | | ----------------------- | -------------- | ------------------------------------------------------ | | `--c-input-caret-color` | `currentColor` | Caret color, independently overridable from text color | `--c-field-caret-color` sets the shared caret color, defaulting to `currentColor`. `--c-input-caret-color` overrides this component and defaults to `var(--c-field-caret-color)`. --- Document: llms/en-US/components/layout.md # Layout Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/layout/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Scroll Preview configuration: `bordered`, `scrollable`. Example source: src/layout/__demos__/scroll.vue ```vue ``` ### Sider Options - `has-sider`: Indicates that there is a Sider in the sub-element, which generally does not need to be specified. Used to avoid style flicker when rendering on the server side. Example source: src/layout/__demos__/sider-options.vue ```vue ``` ## Content and presentation ### Resize Preview configuration: `:resize-directions="['right']"`. Example source: src/layout/__demos__/resize.vue ```vue ``` ### Collapse - `has-sider`: Indicates that there is a Sider in the sub-element, which generally does not need to be specified. Used to avoid style flicker when rendering on the server side. Example source: src/layout/__demos__/collapse.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Content inherits reading direction. Sider placement=left/right and physical ResizeBox handles keep their physical-side semantics. Nested headings and content may override dir locally. ## API ### Layout Props | Parameter | Description | Type | Default | | --------- | ------------------------------------------------------------------ | ------- | :----: | | scrollable | Enable native scrolling on this element; requires constrained height | boolean | false | | has-sider | Indicates that there is a Sider in the sub-element, which generally does not need to be specified. Used to avoid style flicker when rendering on the server side. | boolean | false | ### Layout-Header Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | default | Content | - | ### Layout-content Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | default | Content | - | ### Layout-Footer Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | default | Content | - | ### Layout-Sider Props | Parameter | Description | Type | Default | | ----------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------- | :-----: | | theme | Theme color | 'dark' \| 'light' | 'light' | | collapsed | Current collapsed state | boolean | - | | default-collapsed | Default collapsed state | boolean | false | | collapsible | Whether collapsing is enabled | boolean | false | | width | Width | number \| string | 200 | | collapsed-width | Collapsed width | number | 48 | | reverse-arrow | Reverse the collapse arrow; useful for a right-side Sider | boolean | false | | breakpoint | Responsive breakpoint; see responsive Grid | 'xxl' \| 'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs' | - | | resize-directions | Replace the native aside with ResizeBox; this is the ResizeBox directions parameter. See ResizeBox | Array<'left' \| 'right' \| 'top' \| 'bottom'> | - | | hide-trigger | Hide the bottom collapse trigger | boolean | false | ### Layout-Sider Events | Event | Description | Arguments | | ---------- | ---------------------------------------------------------------- | -------------------------------------------------------- | | collapse | Expand/collapse event, from the collapse control or responsive changes | collapsed: boolean
type: 'clickTrigger'\|'responsive' | | breakpoint | Responsive-breakpoint event | collapsed: boolean | ### Layout-Sider Slots | Slot | Description | Arguments | | ------- | :------------------: | ------------------ | | trigger | Custom bottom collapse trigger | collapsed: boolean | ## Type definitions The component exports the following types ```ts import type { LayoutProps } from '@cedar-design/ui' ``` ### Additional layout capabilities | Component | Prop | Type | Default | Description | | --- | --- | --- | --- | --- | | Content | scrollable | boolean | false | Use this element as a native scroll container | | Header / Footer / Sider | bordered | boolean | false | Show a border adjacent to the content | | Sider | placement | 'left' / 'right' | 'left' | Sidebar placement; handles arrows automatically, while reverse-arrow remains supported | | Sider | collapse-mode | 'width' / 'transform' | 'width' | Resize or translate content while collapsing | Layout, Content and Sider emit `scroll`(event: Event) and expose `scrollTo(options: ScrollToOptions)` / `scrollTo(x: number, y: number)`. Sider scrolls its internal content node by default. `width` accepts numeric px or CSS lengths. Percentage widths with transform mode are discouraged; use definite lengths such as px/rem. The collapse control is a native button supporting Tab, Enter and Space. With `collapsed-width="0"`, the hidden region is inert and the expansion entry stays at the sidebar edge. A custom trigger slot should contain display content without nested buttons. --- Document: llms/en-US/components/link.md # Link Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/link/__demos__/basic.vue ```vue ``` ## Appearance and states ### Link sizes and semantic colors #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Link status | Link sizes and semantic colors, Link Mode, Link Underline | | `href` | Link URL | Link Mode, Hoverable | | `size` | Text, icon and loading-icon size | Link sizes and semantic colors | | `icon` | Icon | Link sizes and semantic colors | | `loading` | Whether the link is loading | Link sizes and semantic colors | | `target` | Native link target | Link Mode | Compare sizes and semantic colors independently of navigation, disabled interception and loading. Example source: src/link/__demos__/appearance-comparison.vue ```vue ``` ### Link Mode - `status`: Selects the semantic state. Example source: src/link/__demos__/link-mode.vue ```vue ``` ### Link Underline - `status`: Selects the semantic state. Example source: src/link/__demos__/link-underline.vue ```vue ``` ### Link Disabled - `disabled`: Prevents user interaction. Example source: src/link/__demos__/link-disabled.vue ```vue ``` ### Hoverable Preview configuration: `hoverable`, `href="#link"`. Example source: src/link/__demos__/hoverable.vue ```vue ``` ## Content and presentation ### Link Icon Preview configuration: `icon`. Example source: src/link/__demos__/link-icon.vue ```vue ``` ## Interaction and control ### Link Loading Preview configuration: `loading`, `:loading="loading"`. Example source: src/link/__demos__/link-loading.vue ```vue ``` ## API ### Native links and controlled loading Provide href for navigation. Disabled/loading links retain their link role when an href was provided, remove navigation attributes and leave the Tab order. Native download, hreflang, referrerpolicy and ARIA attributes pass through. Loading replaces the icon slot. click is a MouseEvent notification with Vue once semantics; returned promises do not manage loading. Use Button for operations without a navigation target. The loading example prepares a report on the first activation, then uses the browser's native download on the next activation. Preparation is canceled when unmounted. ### `` Props | Property | Description | Type | Default | | --- | --- | --- | --- | | `size` | Five text, icon and spinner sizes | 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' | 'md' | | `href` | Native link destination | string | - | | `target` | Native target | string | - | | `rel` | Native rel | string | - | | `status` | Semantic status | SemanticStatus | 'default' | | `underline` | Underline policy | 'always' \| 'hover' \| 'none' | 'none' | | `hoverable` | Padded hover/active backgrounds | boolean | false | | `icon` | Show the leading icon; icon slot takes priority | boolean | false | | `loading` | Show spinner and block navigation/click | boolean | false | | `disabled` | Disable the link | boolean | false | ### `` Events | Event | Description | Arguments | | ------ | -------------- | ----------------------------- | | click | Click event | `(event: MouseEvent) => void` | ### Slots | Slot | Description | | --- | --- | | default | Link content | | icon | Custom icon; replaced by the loading icon while loading | ### Type definitions The component exports the following types ```ts import type { LinkProps, LinkSize, LinkUnderline, LinkInstance } from '@cedar-design/ui' ``` ### Style migration Internal classes use `c-link--status-*`, `c-link--underline-*`, `c-link--disabled`, `c-link--loading` and `c-link__icon`. Migrate old single-hyphen selectors and prefer `--c-link-*` CSS variables. Focus supports `--c-link-focus-width` (2px), `--c-link-focus-offset` (2px), `--c-link-focus-color` (currentColor) and `--c-link-focus-opacity` (0.8). Reduced motion disables loading rotation and transitions. Text colors match Button text variants: default uses content-primary; secondary/tertiary use content-secondary; colored statuses use their semantic content colors; disabled/loading use content-disabled. Both brands inherit these in light/dark modes. Size variables: `--c-link-size-xs-font-size`, `--c-link-size-sm-font-size`, `--c-link-size-md-font-size`, `--c-link-size-lg-font-size`, `--c-link-size-xl-font-size`. Defaults are 12 / 13 / 14 / 16 / 18px. md references `--c-link-font-size`; icons/loading icons use 1em. --- Document: llms/en-US/components/list.md # List Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/list/__demos__/basic.vue ```vue ``` ## Appearance and states ### Size - `size`: Controls the component size. Example source: src/list/__demos__/size.vue ```vue ``` ## Content and layout ### Prefix Suffix #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `bordered` | Outer border | Actions Layout | | `data` | Data consumed by item slot | Actions Layout | Preview configuration: `shape="square"`. Example source: src/list/__demos__/prefix-suffix.vue ```vue ``` ### Actions Layout - `data`: Supplies the example data. Example source: src/list/__demos__/actions-layout.vue ```vue ``` ## Scrolling and virtualization ### Bounded Scroll #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `data` | Data consumed by item slot | Bounded Scroll, Virtual List, Virtual Navigation | | `virtual-list-props` | Data virtualization; ignored when default slot exists | Virtual List, Virtual Navigation | | `max-height` | Maximum ordinary viewport height; number in px or CSS length, zero means unlimited | Bounded Scroll | | `scrollbar` | Ordinary viewport custom scrollbar; false uses native scrolling | Bounded Scroll | | `size` | Implemented sizes only; xs/xl are not supported | Bounded Scroll | | `split` | Item/header/footer separators, independent of border | Bounded Scroll | - `data`: Supplies the example data. - `size`: Controls the component size. Example source: src/list/__demos__/bounded-scroll.vue ```vue ``` ### Virtual List - `data`: Supplies the example data. Example source: src/list/__demos__/virtual-list.vue ```vue ``` ### Virtual Navigation - `data`: Supplies the example data. Example source: src/list/__demos__/virtual-navigation.vue ```vue ``` ## Lifecycle ### Virtual Lifecycle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `data` | Data consumed by item slot | Virtual Lifecycle | | `virtual-list-props` | Data virtualization; ignored when default slot exists | Virtual Lifecycle | - `data`: Supplies the example data. Example source: src/list/__demos__/virtual-lifecycle.vue ```vue ``` ## API ### List Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | data | Data consumed by item slot | unknown[] | undefined | | size | Implemented sizes only; xs/xl are not supported | 'sm' \| 'md' \| 'lg' | md | | bordered | Outer border | boolean | true | | split | Item/header/footer separators, independent of border | boolean | true | | loading | Initial loading/refresh feedback, not pagination state | boolean | false | | max-height | Maximum ordinary viewport height; number in px or CSS length, zero means unlimited | number \| string | 0 | | virtual-list-props | Data virtualization; ignored when default slot exists | ListVirtualListProps | undefined | | scrollbar | Ordinary viewport custom scrollbar; false uses native scrolling | boolean \| ListScrollbarProps | true | Virtual lists use a dedicated viewport without nesting a custom scrollbar. virtualListProps.height overrides maxHeight; with neither, height defaults to 200px. Numeric and unit-bearing CSS lengths are accepted. Invalid/nonpositive max-height does not constrain height. ListVirtualListProps supports height, threshold, fixedSize, estimatedSize, buffer, itemKey and component. Removed isStaticItemHeight is unsupported; List.data supplies data. Counts at or below threshold render all items. Variable heights use measurements and estimatedSize; buffer controls overscan rows. ListScrollbarProps supports type: 'track'|'embed', outerClass, outerStyle, hide, disableHorizontal and disableVertical. JavaScript object fields use camelCase. ### Events / Methods - scroll(event: Event): one notification per real scroll event. - scrollIntoView({ index?, key?, align }): virtual-list positioning. index overrides key; align is top/bottom/auto. auto does nothing for a fully visible item, otherwise scrolls the minimum distance required. Invalid targets or nonvirtual mode do nothing. ### Slots List slots: default (overrides data), item({ item, index }), header, footer, empty. Empty state appears only without a default slot/data and while not loading. ListItem prefix/default/suffix retain list-item semantics without managing buttons/business interactions. ### Types ListProps、ListSize、ListVirtualListProps、ListScrollbarProps、ListExpose、ListSlots、ListEmits、ListInstance、ListItemInstance。 List handles display and an optional virtual viewport. Compose InfiniteScroll status/target behavior for pagination rather than duplicating its loading state machine inside List. ## Style variables | Token | Default | | --- | --- | | `--c-list-background` | `transparent` | | `--c-list-empty-padding` | `16px` | | `--c-list-empty-color` | `var(--c-list-text-color)` | | `--c-list-loading-padding` | `0px` | | `--c-list-border-width` | `1px` | | `--c-list-border-color` | `var(--c-color-neutral-3)` | | `--c-list-border-radius` | `var(--c-border-radius-md)` | | `--c-list-text-color` | `var(--c-color-text-1)` | | `--c-list-font-size` | `var(--c-font-size-body-3)` | | `--c-list-line-height` | `var(--c-line-height)` | | `--c-list-text-color-header` | `var(--c-color-text-1)` | | `--c-list-font-size-header` | `var(--c-font-size-title-1)` | | `--c-list-font-weight-header` | `var(--c-font-weight-500)` | | `--c-list-line-height-header` | `1.5` | | `--c-list-size-sm-padding-vertical-header` | `var(--c-spacing-4)` | | `--c-list-size-sm-padding-horizontal-header` | `var(--c-spacing-8)` | | `--c-list-size-sm-padding-vertical-item` | `9px` | | `--c-list-size-sm-padding-horizontal-item` | `var(--c-spacing-8)` | | `--c-list-size-md-padding-vertical-header` | `var(--c-spacing-6)` | | `--c-list-size-md-padding-horizontal-header` | `var(--c-spacing-8)` | | `--c-list-size-md-padding-vertical-item` | `13px` | | `--c-list-size-md-padding-horizontal-item` | `var(--c-spacing-8)` | | `--c-list-size-lg-padding-vertical-header` | `var(--c-spacing-7)` | | `--c-list-size-lg-padding-horizontal-header` | `var(--c-spacing-8)` | | `--c-list-size-lg-padding-vertical-item` | `17px` | | `--c-list-size-lg-padding-horizontal-item` | `var(--c-spacing-8)` | | `--c-list-item-prefix-margin-right` | `var(--c-spacing-8)` | | `--c-list-item-suffix-margin-left` | `var(--c-spacing-8)` | | `--c-list-size-sm-padding-vertical-footer` | `var(--c-list-size-sm-padding-vertical-item)` | | `--c-list-size-sm-padding-horizontal-footer` | `var(--c-list-size-sm-padding-horizontal-item)` | | `--c-list-size-md-padding-vertical-footer` | `var(--c-list-size-md-padding-vertical-item)` | | `--c-list-size-md-padding-horizontal-footer` | `var(--c-list-size-md-padding-horizontal-item)` | | `--c-list-size-lg-padding-vertical-footer` | `var(--c-list-size-lg-padding-vertical-item)` | | `--c-list-size-lg-padding-horizontal-footer` | `var(--c-list-size-lg-padding-horizontal-item)` | --- Document: llms/en-US/components/loading.md # Loading Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `tip="加载中"`. Example source: src/loading/__demos__/basic.vue ```vue ``` ## Appearance and states ### Loading shape, size and color #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | Loading-indicator size; numbers are px | Loading shape, size and color | | `type` | Loading animation type | Loading shape, size and color | | `color` | Indicator and hint-text color | Loading shape, size and color | Compare the shape, size and color of loading indicators. Container masks and directives remain separate. Example source: src/loading/__demos__/appearance-comparison.vue ```vue ``` ## Layout and arrangement ### Wrap #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `tip` | Prompt copy | Wrap | | `loading` | Whether loading; effective only when wrapping content | Wrap | Preview configuration: `tip="LOADING"`, `:loading="loading"`, `title="介绍"`, `description="Cedar 是一个基于 Vue 3 的企业级桌面端组件库。"`. Example source: src/loading/__demos__/wrap.vue ```vue ``` ## Content and presentation ### Directive Preview configuration: `title="介绍"`, `description="v-c-loading 会在当前容器内渲染 Loading 遮罩,不会改变内容结构。"`. Example source: src/loading/__demos__/directive.vue ```vue ``` ## API ### `` Props | Prop | Description | Type | Default | | --------- | -------------------------------------- | --------------------------------------------- | -------- | | type | Loading animation type | `circle \| wave \| cube \| rect \| disappear` | `circle` | | size | Loading-indicator size; numbers are px | `xs \| sm \| md \| lg \| xl \| number` | `md` | | radius | Radius for `circle` indicators | `string \| number` | - | | color | Indicator and hint-text color | `string` | - | | loading | Whether loading; effective only when wrapping content | `boolean` | `false` | | tip | Prompt copy | `string` | - | | hide-icon | Whether to hide the loading indicator | `boolean` | `false` | `v-c-loading` accepts boolean shorthand or `{ loading, tip, type, size, radius, color, hideIcon, fullscreen, background }`. The object's `loading` field controls state; other props match `Loading`. #### Registration `v-c-loading` renders Cedar's built-in `Loading` component. The `c-` prefix avoids collisions with other libraries’ directives. Register it in any of the following ways. ```ts // 1. Full installation: registers Loading and v-c-loading automatically import CedarVue from "@cedar-design/ui"; app.use(CedarVue); ``` ```ts // 2. Install Loading on demand: registers the component and directive import { Loading } from "@cedar-design/ui"; app.use(Loading); ``` ```ts // 3. Register only the directive manually import { vLoading } from "@cedar-design/ui"; app.directive("c-loading", vLoading); ``` With `CedarResolver()`, `unplugin-vue-components` resolves template `v-c-loading` automatically. `directives: false` disables directive resolution. ### `` Slots | Slot | Description | | ------- | ---------------------- | | default | Content covered by the loading mask | | tip | Custom hint content | | icon | Custom loading indicator | The `icon` slot replaces every built-in `type` animation. Without it, the ConfigProvider `loading` slot takes precedence over built-in animations. `hide-icon=true` hides all indicators while allowing tip content to remain visible. ## Type definitions The component exports the following types: ```ts import type { LoadingProps } from "@cedar-design/ui"; ``` The loading-directive mask prevents default click behavior and propagation. Clicking it does not activate Card or ordinary parent click handlers. Normal clicking resumes after loading. It does not disable keyboard access to underlying controls; set those controls’ `disabled` props to block all interaction. ### Overlay styles | Variable | Description | | --- | --- | | `--c-loading-overlay-background` | Directive overlay background; the background option overrides this value. | Content-overlay class: `.c-loading__content-overlay`. Each directive update replaces the complete configuration; omitted options and boolean `true` use defaults. Changing `fullscreen` while loading moves the overlay between the host and its owner document body. Host children stay in place. Multiple fullscreen instances share a counted scroll lock: closing a local instance does not unlock fullscreen instances, and the final fullscreen instance preserves an existing external lock class. --- Document: llms/en-US/components/map.md # Map Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `map-type="amaps"`. Example source: src/map/__demos__/basic.vue ```vue ``` ## Content and presentation ### Auth Example source: src/map/__demos__/auth.vue ```vue ``` ## Data and options ### Google #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `map-type` | Map type | Google | | `is-international` | Whether this is a Google map | Google | Preview configuration: `map-type="google"`, `is-international`, `map-type="amaps"`. Example source: src/map/__demos__/google.vue ```vue ``` Example source: src/map/__demos__/use-vmodel.vue ```vue ``` ## API ### Map Props | Prop | Description | Type | Default | | ----------------------- | -------------------------------------------- | -------------------------------------------- | ---------------- | | model-value(**v-model**) | Initial map value representing the selected location | `Object` | - | | default-value | Default map center | `{ [key in valueKeyAlias[keys]]: any }` | - | | driver | Return value of `Fetch.genDriiver` | `Driver` | `-` | | fetch | Return value of `Fetch.genFetch` | `CoreService` | `-` | | geocoder-url | Geocoder endpoint URL | `string` | `-` | | geocoder-handler | Processes geocoding-service responses | `(longitude: number, latitude: number)=>{})` | - | | base-path | Base URL for map data | `String` | `'/pe/powerpro'` | | is-international | Whether this is a Google map | `Boolean` | - | | show-name | Whether to show the floating location name | `boolean` | `false` | | show-locate-me-button | Whether to show the current-location button | `boolean` | `false` | | show-edit-address-button | Whether to show the floating change-location button | `boolean` | `false` | | show-map-tips | Whether to show tips above the map | `boolean` | `false` | | map-type | Map type | `'qqmaps'\|'bmapGL'\|'amaps'` | `'amaps'` | | enable-gis-search | Whether to enable GIS search; `fetch` is required when enabled | `boolean` | `false` | | value-key-scope | String array of values displayed on the map | `Array` | `valueKeyScope` | | value-key-alias | Mapping from map keys to values | `Object` | `valueKeyAlias` | ### MapSelect Props | map-style | Styles applied directly to the map; can set map height | `object` | `{ height: '300px'}` | ### Map Events | Event | Description | Arguments | | --------------- | -------------------------- | ------------------------- | | change | Emitted when the address changes | `(value: ModelValueType)` | | init | Emitted after map initialization | `(value: ModelValueType)` | | loading:address | Emitted while resolving the selected location's address | `-` | | loaded:address | Emitted after resolving the selected location's address | `-` | ## Type definitions ### valueKeyAlias ```ts { longitude: 'longitude', latitude: 'latitude', address: 'address', name: 'name', adcode: 'adcode', city: 'city', countryCode: 'countryCode', country: 'country', } ``` ### valueKeyScope ```ts ;['longitude', 'latitude', 'address', 'name', 'adcode', 'city', 'country', 'countryCode'] ``` ### ModelValueType ModelValueType keys depend on valueKeyAlias ```ts interface ModelValueType { adcode?: string city?: string country?: string countryCode?: string address?: string latitude?: number longitude?: number name?: string } ``` The component exports the following types ```ts import type { MapProps } from '@cedar-design/ui' ``` --- Document: llms/en-US/components/mention.md # Mention Text input with mention suggestions supplied by the application. ## Basic examples ### Basic usage Example source: src/mention/__demos__/basic.vue ```vue ``` ## Customization and slots ### Prefix #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ------------------------------------- | ---------------- | | `data` | Data for automatic completion | Prefix | | `prefix` | Keywords that trigger auto-completion | Prefix | - `data`: Data for automatic completion - `prefix`: Keywords that trigger auto-completion Example source: src/mention/__demos__/prefix.vue ```vue ``` ## Lifecycle and edge cases ### Mirror Lifecycle Example source: src/mention/__demos__/mirror-lifecycle.vue ```vue ``` ## Loading and waiting ### Controlled loading | Prop | Description | Type | Default | | --- | --- | --- | --- | | `loading` | Explicit business loading state | `boolean` | `false` | Set loading explicitly to display feedback. Ordinary event return values do not drive loading. Before hooks retain their documented pending behavior. Example source: src/mention/__demos__/loading.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### `` Props | Parameter | Description | Type | Default | Version | | ------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | :---------: | :------ | | model-value **(v-model)** | Bound value | `string` | `-` | | | default-value | Default value (uncontrolled state) | `string` | `''` | | | data | Data for automatic completion | `(string \| number \| SelectOptionData \| SelectOptionGroup)[]` / `(query, { signal }) => Array / Promise` | `undefined` | | | prefix | Keywords that trigger auto-completion | `string \| string[]` | `'@'` | | | split | Before and after the selected item separator | `string` | `' '` | | | type | default input or textarea | `'input' \| 'textarea'` | `'input'` | | | disabled | Whether disabled | `boolean` | `false` | | | clearable | Whether to allow the input to be cleared | `boolean` | `false` | 2.23.0 | ### `` Events | Event | Description | Arguments | Version | | ------ | --------------------------------------------------------- | ------------------------------------------------------------- | :------ | | change | Emitted when the value changes | value: `string` | | | search | Emitted during dynamic search; prefix was added in 2.47.0 | value: `string`
prefix: `string` | | | select | Emitted when a dropdown option is selected | value: `string \| number \| Record \| undefined` | | | clear | Emitted when the user clicks the clear button | - | 2.23.0 | | focus | Emitted when the text input gains focus | ev: `FocusEvent` | 2.42.0 | | blur | Emitted when the text input loses focus | ev: `FocusEvent` | 2.42.0 | ### `` Methods | Method | Description | Arguments | Returns | Version | | ------ | --------------- | --------- | ------- | :------ | | focus | Focus the input | - | - | 2.24.0 | | blur | Blur the input | - | - | 2.24.0 | ### `` Slots | Slot | Description | Arguments | Version | | ------ | :------------: | ------------------ | :------ | | option | Option content | data: `OptionInfo` | 2.13.0 | ### Type definitions The component exports the following types ```ts import type { MentionInstance } from "@cedar-design/ui"; ``` Mention reuses Input/Textarea typography and spacing; its measurement mirror copies computed native input styles. Override the corresponding input variables. Ineffective mention-font-size, mention-line-height and mention-padding-* variables are removed. ### Form field presentation and confirmation Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. Text and person-ID models remain strings; use an empty string or a business-defined string sentinel. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. `data` accepts an array or (query, { signal }) => array/Promise. The component manages loading, cancellation and stale-result isolation; failures emit load-error. Single/multiple groups initialize with an empty query; searchable fields reload when queries change. Tree root loading is independent of existing load-more child loading. Both input and textarea show manual loading and the current explicit data-loader wait. Loading feedback does not implicitly disable editing; search notification return Promises do not start tasks. Old data requests cannot clear the current request indicator, and load-error retains its original error payload. --- Document: llms/en-US/components/menu.md # Menu Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `options`: Supplies the available options. Example source: src/menu/__demos__/basic.vue ```vue ``` ## Appearance and states ### Disabled - `disabled`: Prevents user interaction. Example source: src/menu/__demos__/disabled.vue ```vue ``` ## Options and hierarchy ### Groups, submenus and option content #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `options` | Command tree | Groups, submenus and option content, Active Rendering | | `hide-on-select` | Close the popup after activating a command | Active Rendering | | `submenu-trigger` | How every submenu level expands | Active Rendering | Compare flat groups, nested menus and option content. Expand or select options to inspect their hierarchy. Example source: src/menu/__demos__/structure-comparison.vue ```vue ``` ### Active Rendering - `options`: Supplies the available options. Example source: src/menu/__demos__/active-rendering.vue ```vue ``` ## Triggers and positioning ### Context Menu #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `trigger` | Root menu trigger | Context Menu, Trigger | | `options` | Command tree | Context Menu, Positioning | | `align-point` | Align to the pointer position at activation; stays in place until the next context menu activation | Context Menu | | `placement` | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | Placement | | `strategy` | Positioning strategy inherited by every submenu | Positioning | | `submenu-trigger` | How every submenu level expands | Positioning | - `options`: Supplies the available options. Example source: src/menu/__demos__/context-menu.vue ```vue ``` ### Trigger Preview configuration: `trigger="click"`, `label="Option 1"`, `label="Option 2"`, `trigger="hover"`. Example source: src/menu/__demos__/trigger.vue ```vue ``` ### Placement - `placement`: Chooses the position relative to the trigger. Example source: src/menu/__demos__/placement.vue ```vue ``` ### Positioning - `options`: Supplies the available options. Example source: src/menu/__demos__/positioning.vue ```vue ``` ### Popup Height Preview configuration: `:popup-max-height="120"`, `:label="item"`, `:popup-max-height="false"`. Example source: src/menu/__demos__/popup-height.vue ```vue ``` ## State and content customization ### Selection - `options`: Supplies the available options. Example source: src/menu/__demos__/selection.vue ```vue ``` ### Controlled Preview configuration: `v-model:open="open"`, `label="Option 1"`, `label="Option 2"`. Example source: src/menu/__demos__/controlled.vue ```vue ``` ### Footer Example source: src/menu/__demos__/footer.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Submenus and horizontal parent/child navigation follow the current reading direction. Vertical and boundary navigation keeps item order and skips disabled items. Portals inherit their source direction; switching direction preserves selection. ## API ### Value and default value Use ordinary `v-model`. `modelValue` is the selected option value; `defaultValue` initializes uncontrolled state once, and later changes do not reset it. Explicit binding takes precedence. Initialization emits no `update:modelValue`. ### `` Props | Parameter | Description | Type | Default | | --- | --- | --- | :---: | | options | Command tree | `MenuOptionData[]` | `[]` | | field-names | `label/value/children/disabled` field mapping | `MenuFieldNames` | `-` | | model-value **(v-model)** | Current active value for controlled highlighting | `MenuValue` | `-` | | open **(v-model)** | Whether the popup is visible | `boolean` | `-` | | default-open | Uncontrolled default visibility | `boolean` | `false` | | trigger | Root menu trigger | `'hover' \| 'click' \| 'focus' \| 'contextMenu'` | `'click'` | | submenu-trigger | How every submenu level expands | `'hover' \| 'click'` | `'hover'` | | placement | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | `MenuPlacement` | `'bottom'` | | `strategy` | Positioning strategy inherited by every submenu | `'absolute' \| 'fixed'` | `'absolute'` | | popup-container | Popup mount container | `string \| HTMLElement \| false` | `-` | | popup-max-height | Default limit, pixel height, or unlimited | `boolean \| number` | `true` | | hide-on-select | Close the popup after activating a command | `boolean` | `true` | | auto-fit-popup-width | Match popup width to the trigger | `boolean` | `false` | | disabled | Disable the menu | `boolean` | `false` | | align-point | Align to the pointer position at activation; stays in place until the next context menu activation | `boolean` | `false` | ### `MenuOptionData` | Field | Description | Type | | --- | --- | --- | | type | Plain command, group or divider | `'item' \| 'group' \| 'divider'` | | label | Main content | `VNodeChild \| (context) => VNodeChild` | | icon | Leading icon | `VNodeChild \| (context) => VNodeChild` | | extra | Trailing content such as a shortcut | `VNodeChild \| (context) => VNodeChild` | | value | Value passed to events on activation | `any` | | children | Child commands; a plain option with children becomes a submenu | `MenuOptionData[]` | | disabled | Disable this item and its descendants | `boolean` | | show | Whether to render | `boolean` | | ripple | Whether to show the click ripple | `boolean` | | props | HTML attributes forwarded to the row element | `HTMLAttributes` | The render context is `{ option, active, level }`. `type: 'group'` is visual only and does not add a level; `type: 'divider'` is neither focusable nor activatable. ### Events | Event | Description | Arguments | | --- | --- | --- | | update:model-value | Active value update request | `value: MenuValue` | | open-change | Visibility update request | `open: boolean` | | select | A menu item was activated | `value, option, event` | ### Slots | Slot | Description | Arguments | | --- | --- | --- | | default | Trigger element | - | | content | Hand-written content, pairs with `MenuOption` | - | | footer | Footer | - | | option-label | Render every option's main content | `{ option, active, level }` | | option-icon | Render every option's icon | `{ option, active, level }` | | option-extra | Render every option's trailing content | `{ option, active, level }` | ### `` Retained for SplitButton and a few handwritten `content` cases. Props are `label`, `value`, `disabled`, `ripple` and `highlight`. The `label` render function and `default`/`icon`/`suffix` slots receive `{ option, active, level }`. Clicking emits `click`. `highlight` controls visual emphasis without committing selection. Groups/submenus are described only through `options`; `MenuGroup` and `MenuSubmenu` are no longer exported. ### Instance methods and keyboard The instance exposes `open()`, `close()`, `resize()` and `setReference(reference?)`. Root menus support Up/Down, Home/End and Enter. Right enters submenus; Left/Escape returns. Each Escape closes only the topmost layer and restores focus. Classes, CSS variables and internal DOM markers consistently use `c-menu-*`, `--c-menu-*` and `data-menu-*`. ### State and duration variables Disabled overrides selection, pointer hover and keyboard focus. Selected hover uses a separate role, inheriting the selected background by default; override it for additional feedback. Both platforms paint selected backgrounds directly on options. | Token | Default | | --- | --- | | `--c-menu-option-bg-selected-hover` | `var(--c-menu-option-bg-selected)` | ### Data identity and trigger switching Reorderable items should provide stable unique values; internal Vue keys derive from business values. Numeric `0`, string `'0'` and boolean `false` remain distinct. Groups, separators and display items without values retain identity through their original option objects; no public key alias is added. Clicking another sibling trigger that is already hover-open closes the previous menu. Clicking inside a submenu does not incorrectly close its parent. ### Placement semantics and configuration MenuPlacement uses the twelve-value TriggerPlacement domain. Both prop and type describe the preferred popup side relative to its trigger. The old MenuPosition export has been removed. --- Document: llms/en-US/components/message.md # Message Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/message/__demos__/basic.vue ```vue ``` ## Appearance and states ### Type #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Semantic status | Appearance Lab | | `position` | Region of the message itself in the viewport: top/center/bottom, default top. Not positioned relative to a trigger | Appearance Lab | | `closable` | Show the close button | Appearance Lab | | `duration` | Auto-close duration in ms; `0` disables automatic closing | Appearance Lab | | `variant` | Visual emphasis | Appearance Lab | Example source: src/message/__demos__/type.vue ```vue ``` ### Variant Example source: src/message/__demos__/variant.vue ```vue ``` ### Appearance Lab - `status`: Selects the semantic state. Example source: src/message/__demos__/appearance-lab.vue ```vue ``` ## Layout and arrangement ### Location Example source: src/message/__demos__/location.vue ```vue ``` ## Content and presentation ### Time #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Semantic status | Component | | `position` | Region of the message itself in the viewport: top/center/bottom, default top. Not positioned relative to a trigger | Component | | `closable` | Show the close button | Component | | `duration` | Auto-close duration in ms; `0` disables automatic closing | Component | Example source: src/message/__demos__/time.vue ```vue ``` ### Update Example source: src/message/__demos__/update.vue ```vue ``` ### Pause On Hover Example source: src/message/__demos__/pause-on-hover.vue ```vue ``` ### Component - `status`: Selects the semantic state. Example source: src/message/__demos__/component.vue ```vue ``` ## Customization and slots ### Custom Icon Example source: src/message/__demos__/custom-icon.vue ```vue ``` ## Interaction and control ### Closable Example source: src/message/__demos__/closable.vue ```vue ``` ### Loading Example source: src/message/__demos__/loading.vue ```vue ``` Example source: src/message/__demos__/multiple.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Content, icon and close gaps follow reading direction. Direction changes preserve message type, timing and close semantics. Imperative calls use explicit or document direction. ## API ### Props / MessageOptions | Prop | Description | Type | Default | | --------------------- | -------------------------------------- | ------------------------------------------------------------ | --------------- | | open / `v-model:open` | Controlled visibility | `boolean` | `false` | | id | Unique queue identifier; the same id updates the existing instance | `string \| number` | Automatically generated | | status | Semantic status | `default \| info \| success \| warning \| danger \| loading` | `default` | | variant | Visual emphasis | `neutral \| tonal \| solid` | `neutral` | | position | Region of the message itself in the viewport: top/center/bottom, default top. Not positioned relative to a trigger | `top \| center \| bottom` | `top` | | content | Content | `MessageContent` | - | | icon | Custom icon | `MessageContent` | - | | action | Action-area content | `MessageContent` | - | | duration | Auto-close duration in ms; `0` disables automatic closing | `number` | `3000` | | showIcon | Whether to show the status icon | `boolean` | `true` | | closable | Show the close button | `boolean` | `false` | | pauseOnHover | Pause while hovered | `boolean` | `false` | | resetOnUpdate | Whether same-id updates reset the complete duration | `boolean` | `false` | | closeButtonAriaLabel | Close button label | `string` | `Close message` | | popupContainer | Mount container; function-call queues are isolated by container and position | `string \| HTMLElement \| false` | `body` | Function options additionally accept `onOpen / onOpened / onClose / onClosed`. Close callbacks receive the current `id`. ### Events `update:open`, `open`, `opened`, `close`, and `closed`, emitted once per visibility cycle. ### Methods | Method | Description | | ------------------------------------------------- | ------------------------ | | `Message(options \| string)` | Open a default message | | `Message.info/success/warning/error/loading(...)` | Open a message with the corresponding status | | `Message.clear(position?)` | Clear all messages or a specified position | | `Message.setDefaultOptions(options)` | Set defaults for subsequent calls | | `Message.resetDefaultOptions()` | Restore defaults | Returns `{ close() }`. Repeated `close()` calls do not duplicate closing lifecycle events. ### Slots `default`、`icon`、`action`。 ## Public CSS variables Visual variant is independent of status. neutral uses a neutral popup and status icon; tonal uses a low-emphasis status background with dark content; solid uses a high-emphasis fill and matching foreground. Cedar/Maple both default to neutral; explicit solid/tonal have matching visual semantics. default/loading solid retains a dark background, with the loading icon indicating progress. Both export MessageVariant; function calls, setDefaultOptions and same-id updates support variant. Colors use `--c-message-{variant}-{status}-{bg|content-color|icon-color|border-color|close-color}`. bg sets the panel background; content-color sets body/action text unless separately styled; icon-color sets status icons; border-color sets borders; close-color sets close controls. With a custom background, verify all three foregrounds. Geometry retains platform density rather than forcing equal defaults. Variables must affect actual Teleport-container ancestors. | Variable | Default | | --- | --- | | `--c-message-neutral-default-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-default-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-default-icon-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-default-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-default-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-neutral-info-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-info-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-info-icon-color` | `var(--c-sys-color-content-info)` | | `--c-message-neutral-info-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-info-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-neutral-success-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-success-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-success-icon-color` | `var(--c-sys-color-content-success)` | | `--c-message-neutral-success-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-success-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-neutral-warning-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-warning-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-warning-icon-color` | `var(--c-sys-color-content-warning)` | | `--c-message-neutral-warning-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-warning-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-neutral-danger-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-danger-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-danger-icon-color` | `var(--c-sys-color-content-danger)` | | `--c-message-neutral-danger-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-danger-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-neutral-loading-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-message-neutral-loading-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-neutral-loading-icon-color` | `var(--c-sys-color-content-brand)` | | `--c-message-neutral-loading-border-color` | `var(--c-sys-color-border-default)` | | `--c-message-neutral-loading-close-color` | `var(--c-sys-color-content-secondary)` | | `--c-message-tonal-default-bg` | `var(--c-sys-color-surface-muted)` | | `--c-message-tonal-default-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-default-icon-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-default-border-color` | `transparent` | | `--c-message-tonal-default-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-info-bg` | `rgba(var(--c-blue-6), 0.12)` | | `--c-message-tonal-info-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-info-icon-color` | `var(--c-sys-color-content-info)` | | `--c-message-tonal-info-border-color` | `transparent` | | `--c-message-tonal-info-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-success-bg` | `var(--c-color-success-light-1)` | | `--c-message-tonal-success-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-success-icon-color` | `var(--c-sys-color-content-success)` | | `--c-message-tonal-success-border-color` | `transparent` | | `--c-message-tonal-success-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-warning-bg` | `var(--c-color-warning-light-1)` | | `--c-message-tonal-warning-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-warning-icon-color` | `var(--c-sys-color-content-warning)` | | `--c-message-tonal-warning-border-color` | `transparent` | | `--c-message-tonal-warning-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-danger-bg` | `var(--c-color-danger-light-1)` | | `--c-message-tonal-danger-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-danger-icon-color` | `var(--c-sys-color-content-danger)` | | `--c-message-tonal-danger-border-color` | `transparent` | | `--c-message-tonal-danger-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-loading-bg` | `var(--c-color-primary-light-1)` | | `--c-message-tonal-loading-content-color` | `var(--c-sys-color-content-primary)` | | `--c-message-tonal-loading-icon-color` | `var(--c-sys-color-content-brand)` | | `--c-message-tonal-loading-border-color` | `transparent` | | `--c-message-tonal-loading-close-color` | `var(--c-sys-color-content-primary)` | | `--c-message-solid-default-bg` | `#333` | | `--c-message-solid-default-content-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-solid-default-icon-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-solid-default-border-color` | `transparent` | | `--c-message-solid-default-close-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-solid-info-bg` | `var(--c-sys-color-status-info)` | | `--c-message-solid-info-content-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-info-icon-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-info-border-color` | `transparent` | | `--c-message-solid-info-close-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-success-bg` | `var(--c-sys-color-status-success)` | | `--c-message-solid-success-content-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-success-icon-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-success-border-color` | `transparent` | | `--c-message-solid-success-close-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-warning-bg` | `var(--c-sys-color-status-warning)` | | `--c-message-solid-warning-content-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-warning-icon-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-warning-border-color` | `transparent` | | `--c-message-solid-warning-close-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-danger-bg` | `var(--c-sys-color-status-danger)` | | `--c-message-solid-danger-content-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-danger-icon-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-danger-border-color` | `transparent` | | `--c-message-solid-danger-close-color` | `var(--c-sys-color-content-on-bright)` | | `--c-message-solid-loading-bg` | `#333` | | `--c-message-solid-loading-content-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-solid-loading-icon-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-solid-loading-border-color` | `transparent` | | `--c-message-solid-loading-close-color` | `var(--c-sys-color-content-on-dark)` | | `--c-message-wrapper-margin-top` | `var(--c-spacing-12)` | | `--c-message-wrapper-margin-bottom` | `var(--c-spacing-12)` | | `--c-message-wrapper-padding-horizontal` | `var(--c-spacing-5)` | | `--c-message-z-index` | `var(--c-z-index-message)` | | `--c-message-padding-top` | `var(--c-spacing-5)` | | `--c-message-padding-bottom` | `var(--c-spacing-5)` | | `--c-message-padding-left` | `var(--c-spacing-7)` | | `--c-message-padding-right` | `var(--c-spacing-7)` | | `--c-message-margin-bottom` | `var(--c-spacing-7)` | | `--c-message-border-radius` | `var(--c-border-radius-sm)` | | `--c-message-icon-font-size` | `20px` | | `--c-message-content-font-size` | `var(--c-font-size-body-3)` | | `--c-message-icon-margin-right` | `var(--c-spacing-4)` | | `--c-message-box-shadow` | `var(--c-shadow2-down)` | | `--c-message-border-width` | `1px` | | `--c-message-border-style` | `solid` | | `--c-message-close-icon-font-size` | `12px` | | `--c-message-close-btn-margin-left` | `var(--c-spacing-4)` | | `--c-message-close-icon-hover-size` | `20px` | | `--c-message-close-icon-hover-opacity` | `0.08` | | `--c-message-transition-duration` | `var(--c-transition-duration-1)` | | `--c-message-transition-duration-icon` | `var(--c-transition-duration-4)` | | `--c-message-transition-timing-function` | `var( --c-transition-timing-function-linear )` | | `--c-message-transition-timing-function-icon` | `var( --c-transition-timing-function-overshoot )` | A throwing close/closed notification cannot retain the closed item or its empty manager host. Resources are released independently of notification callbacks. --- Document: llms/en-US/components/nav-menu.md # Nav Menu Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `options`: Supplies the available options. Example source: src/nav-menu/__demos__/basic.vue ```vue ``` Example source: src/nav-menu/__demos__/horizontal-sub-menu.vue ```vue ``` ## Appearance and layout ### Size #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `options` | Navigation tree | Size | | `size` | Size | Size | | `mode` | Navigation orientation | Size | - `options`: Supplies the available options. - `size`: Controls the component size. Example source: src/nav-menu/__demos__/size.vue ```vue ``` ## Hierarchy and responsive layout ### Sub Menu #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `options` | Navigation tree | Sub Menu | | `accordion` | Expand only one branch per level | Sub Menu | | `default-value` | Initial uncontrolled selected value | Sub Menu | | `collapsed` | Collapsed state; supports v-model:collapsed | Sub Menu | | `mode` | Navigation orientation | Sub Menu | - `options`: Supplies the available options. Example source: src/nav-menu/__demos__/sub-menu.vue ```vue ``` Example source: src/nav-menu/__demos__/collapsed.vue ```vue ``` Example source: src/nav-menu/__demos__/breakpoint.vue ```vue ``` ## Entries and panels ### Items Horizontal #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `mode` | Navigation orientation | Items Horizontal | | `active-item` | Controlled named NavMenu.Item activation; supports v-model:active-item | Items Horizontal | Preview configuration: `mode="horizontal"`, `label="分类"`, `:options="categories"`, `label="地区"`. Example source: src/nav-menu/__demos__/items-horizontal.vue ```vue ``` Example source: src/nav-menu/__demos__/items-vertical.vue ```vue ``` Example source: src/nav-menu/__demos__/entry-state.vue ```vue ``` Example source: src/nav-menu/__demos__/item-label.vue ```vue ``` Example source: src/nav-menu/__demos__/item-label-independent.vue ```vue ``` ## Data and state control ### Controlled #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `options` | Navigation tree | Controlled | | `model-value` | Current selected key; supports v-model. null means no selection | Controlled | | `expanded-keys` | Controlled expanded branches | Controlled | | `field-names` | Field mapping for key/label/children/disabled | Controlled | | `disabled` | Globally disable selection/user expansion | Controlled | | `default-value` | Initial uncontrolled selected value | Controlled | - `options`: Supplies the available options. - `disabled`: Prevents user interaction. Example source: src/nav-menu/__demos__/controlled.vue ```vue ``` Example source: src/nav-menu/__demos__/item-controlled.vue ```vue ``` Example source: src/nav-menu/__demos__/panel-state.vue ```vue ``` Example source: src/nav-menu/__demos__/field-names.vue ```vue ``` Example source: src/nav-menu/__demos__/custom-content.vue ```vue ``` ## NavMenu API | Prop | Description | Type | Default | | --- | --- | --- | --- | | options | Navigation tree | NavMenuOption[] | [] | | model-value | Current selected key; supports v-model. null means no selection | string / number / null | undefined | | default-value | Initial uncontrolled selected value | string / number / null | null | | active-item | Controlled named NavMenu.Item activation; supports v-model:active-item | string / number / null | undefined | | default-active-item | Initial uncontrolled named NavMenu.Item activation | string / number / null | null | | expanded-keys | Controlled expanded branches | (string / number)[] | undefined | | default-expanded-keys | Initial uncontrolled expanded branches | (string / number)[] | [] | | default-expand-all | Initially expand every branch | boolean | false | | auto-expand-selected | Expand selected-item ancestors in vertical noncollapsed mode; controlled mode requests updates | boolean | true | | accordion | Expand only one branch per level | boolean | false | | mode | Navigation orientation | vertical / horizontal | vertical | | collapsed | Collapsed state; supports v-model:collapsed | boolean | undefined | | default-collapsed | Initial uncontrolled collapsed state | boolean | false | | theme | Code Theme | light / dark | Inherit Sider, otherwise light | | size | Size | xs / sm / md / lg / xl | md | | disabled | Globally disable selection/user expansion | boolean | false | | field-names | Field mapping for key/label/children/disabled | NavMenuFieldNames | Same-name fields by default | | responsive | Enable horizontal overflow collection | boolean | true | | indent | Indent per level in px | number | 24 | | root-indent | Root indent in px | number | 12 | | collapsed-width | Collapsed width in px | number | 56 | | icon-size | Icon size in px | number | 20 | | popup-container | Popup mount container; false renders locally | Matching Trigger type | Inherits Trigger definition | | popup-class | Additional popup class | string / array / object | — | | overflow-label | Overflow-entry label | string | More | | node-props | Node DOM attributes/events; internal selection, disabled and keyboard semantics remain | (context) => Record | — | Controlled props follow supplied values; update events are requests only. `default-*` initializes once, not on later changes. Selection and expansion are independent. `showOption` does not select. ### NavMenuOption ```ts interface NavMenuOption { key?: string | number type?: 'item' | 'group' | 'divider' label?: VNodeChild | ((context: NavMenuRenderContext) => VNodeChild) icon?: VNodeChild | ((context: NavMenuRenderContext) => VNodeChild) extra?: VNodeChild | ((context: NavMenuRenderContext) => VNodeChild) children?: NavMenuOption[] disabled?: boolean show?: boolean props?: HTMLAttributes } ``` Ordinary options require unique stable keys, using mapped keys when fieldNames is supplied. Numeric 0 is valid. Groups/dividers may omit keys, though explicit keys are recommended for dynamic reordering. Duplicate keys/missing ordinary-item keys throw to prevent ambiguous selection paths. show=false hides nodes/subtrees. Disabled branches propagate downward. Ordinary branches expand; leaves select. ### Events | Event | Arguments | | --- | --- | | update:model-value | key / null | | update:active-item | name / null | | update:expanded-keys | keys | | update:collapsed | collapsed | | select | key, original option, original Event | ### Slots The default slot contains independent `CNavMenuItem` entries. When present, horizontal menus scroll rather than using `responsive` overflow collection. label/icon/extra render functions, same-name slots and nodeProps receive `{ option, active, expanded, level }`. `active` means this node itself matches modelValue; ancestor-path emphasis is internal. `expanded` describes branch expansion; level starts at 0. ### Cross-platform contract Both libraries create panel content on first open and retain it when closed or switched, including local drafts and expanded branches. With `unmount-on-close`, content is destroyed after the closing transition and recreated on the next open; the Item's own selected value remains intact. Applications own draft submission, resets and filter application. Root `close()` requests closing Item panels and restores entry focus without changing selected values, active-item or desktop tree expanded-keys. Controlled open values remain authoritative when closure is rejected. Entries with neither options nor a content slot never open; asynchronous options follow the current open state when they arrive. KeepAlive suspension hides panels and requests closure; controlled state remains authoritative on activation. Item values, open state, events, slot contexts and `select/close/setOpen` methods share the same contract. Both roots expose `close/resize/setActiveItem`. Names must be unique within the menu; changing a name releases the previous one. Batched swaps and insertions validate the final rendered names. Vertical options expand enabled ancestors of the selected value on initialization and value/options updates. Users can still collapse branches manually. | Capability | Cedar | Maple | | --- | --- | --- | | Root menu | options tree or Item entries; vertical by default | Item filter bar only; horizontal by default | | popup-layout | dropdown (default) / full-width / full-height / full | full-width (default) / full | | Panel origin | Individual entry bottom | Entire filter bar bottom; standalone Item uses its own bottom | | Trigger and placement | trigger / placement | Click to open downward | | Backdrop and scrolling | Non-modal; background scroll remains available | Root overlay / overlay-closable / lock-scroll / esc-to-close / z-index | | Theme | theme override | Global theme; no theme prop | | Tree-only methods | showOption / scrollTo / setCollapsed | — | Each library exports `NavMenuPopupLayout` with its supported values. Maple's `NavMenuMode` is horizontal only; `options-mode` supports both orientations. The default entry slot replaces the entry's inner content. Maple renders it inside a native button: use non-interactive text/icons and place forms and action buttons in the content slot. ### Methods | Method | Description | | --- | --- | | close() | Request closing Item panels and restore focus without changing tree expansion | | showOption(key?) | Expand ancestors of the specified item, defaulting to current selection; does not select | | scrollTo(key?) | Expand then scroll to an item; controlled expansion requires parent acceptance | | resize() | Manually remeasure horizontal overflow | | setCollapsed(value) | Update uncontrolled collapse or request a controlled update | | setActiveItem(value) | Update uncontrolled named-Item activation or request a controlled update | ### Arrow direction Horizontal dropdowns point down when closed/up when open. Vertical inline branches point right/down. Right-opening submenus point right/left. Independent Item arrows follow placement and reverse when open. Arrows follow actual open state, not unaccepted controlled proposals. ### Keyboard Vertical Up/Down and horizontal Left/Right move focus; Home/End reach first/last. Right expands vertical branches, Down opens horizontal branches, Left returns to parents. Escape closes the current popup and restores reference focus. Enter/Space activates nodes. Disabled nodes are skipped; inputs retain native keys. If narrowing moves a focused item into overflow, focus moves to the overflow entry. ## NavMenu.Item API Titles follow matching selected options by default. `label` slots take highest precedence: use `` for fixed titles or bind a separate reactive variable for manual titles. `update-label` is removed. `v-model` stores panel selection. Slot `active` indicates business entry state: named entries in a root menu compare root activeItem with name; independent entries match their main value against ordinary options, including 0/empty string. Unknown values/groups/dividers do not activate independent entries. `highlight` overrides emphasis only: true forces it, false removes it, omission follows `active`. It changes neither `active` nor value. Opening a panel does not activate the entry. `CNavMenuItem` (also `NavMenu.Item`) is an independent top-level entry outside root navigation-tree `modelValue`. Without `name`, each Item highlights from its own value, allowing simultaneous category/region filters. With unique names, root `activeItem/defaultActiveItem` maintains one highlighted entry. Both modes allow only one open Item panel without clearing other panels’ values. Ordinary root navigation uses `options + v-model`. Entries define their own `options` or replace panels through `content`. default customizes the entry; `label`/`icon` customize parts; `option-label`/`option-icon`/`option-extra` customize `options`. Horizontal menus with default slots scroll rather than collecting entries into overflow, avoiding cloned form content. Pure `options` menus retain automatic overflow collection. New Item does not support legacy child collection. Item panels within one NavMenu are mutually exclusive. Clicking another entry requests closing the previous one; controlled open requires parent acceptance. | Item prop | Description | Default | | --- | --- | --- | | name | Stable unique entry identifier; root activeItem makes named entries mutually exclusive. highlight separately overrides appearance | — | | label | Entry title when unselected or selection does not match options; supports VNode/render functions | — | | options / fieldNames | Same options/field mappings as NavMenu | `[]` | | model-value / default-value | Independent controlled/initial value; string, number or null | `undefined` / `null` | | highlight | Visual emphasis override without changing active/selection; defaults to active | — | | hide-on-select | Close the panel after select | `true` | | unmount-on-close | Destroy panel content after the closing transition; retain it by default | false | | open / default-open | Controlled / initial panel state | `undefined` / `false` | | disabled | Disable the entry, also respecting parent menu disabled | `undefined` | | trigger | Trigger mode | `click` | | placement | Ordinary dropdown placement; full-height right/left placements align to the corresponding entry edge | `bottom-start` | | popup-layout | `dropdown`: standard `dropdown` / `full-width`: `full` width below the trigger / `full-height`: `full` height on the right / `full`: fills the available width and height below the trigger | `dropdown` | | popup-style | Panel CSS; may override full-height width/direction/dimensions | — | | popup-container / popup-class | Trigger container and popup class | Follow parent menu | | options-mode | Horizontal/vertical default options-panel layout | `vertical` | Entry/`content` slots receive `{ modelValue, selectedOption, active, open, select, close }`. select(key,event?) emits `update:modelValue` and select(key,option,event). Custom panels may select outside options, making option undefined and independent active false; use highlight if emphasis is needed. `close()` closes/restores entry focus. Controlled values affect titles/active only after acceptance. Entry-slot active is entry state, while label-render active compares its context option with the Item value. `hideOnSelect` is independent of acceptance; set false for manual confirmation. Item also emits `update:open`/entry `click` and exposes `select`/`close`/`setOpen`. Full-width/full-height popups are nonmodal without scroll locks/focus traps. They default to body; custom containers must avoid ancestor transforms changing the fixed-position reference. ## Migrating from older versions Legacy child collection and state aliases are removed. New `NavMenu.Item` is an independent top-level entry with different usage. | Previous usage | Current usage | | --- | --- | | Legacy Item/SubMenu/ItemGroup components | Use options/children/type=group for navigation trees; new NavMenu.Item for custom top-level entries | | selectedKeys/defaultSelectedKeys arrays | modelValue/defaultValue single key | | openKeys/defaultOpenKeys | expandedKeys/defaultExpandedKeys | | menu-item-click | select(key, option, event) | | pop/popButton mode | vertical + collapsed; horizontal remains horizontal | | Child title/icon slots | Root scoped label/icon/extra slots or option VNodes | | Built-in collapse button/breakpoint | External buttons control collapsed; containers handle responsive layout | | Unrestricted triggerProps/tooltipProps forwarding | Explicit popupContainer/popupClass props | All library demos, exports, global types and resolver entries are migrated. Styles use BEM `c-nav-menu__*` / `c-nav-menu--*`; old selectors and unused tokens are removed. ## Design reference The workspace Naive UI 2.44.1 Menu informed option trees, ancestor paths and content rendering. No Naive UI/TreeMate runtime dependency is introduced. Local Trigger provides popups; public APIs follow Cedar names. ## Style variables | Variable | Default | | --- | --- | | --c-nav-menu-font-size | `var(~'--c-font-size-body-3')` | | --c-nav-menu-border-radius | `var(~'--c-border-radius-sm')` | | --c-nav-menu-light-bg | `var(~'--c-color-bg-2')` | | --c-nav-menu-light-item-bg-hover | `var(~'--c-color-fill-2')` | | --c-nav-menu-light-item-bg-selected | `var(~'--c-color-fill-2')` | | --c-nav-menu-light-item-text-color | `var(~'--c-color-text-2')` | | --c-nav-menu-light-item-text-color-selected | `rgb(var(~'--c-primary-6'))` | | --c-nav-menu-light-item-text-color-disabled | `var(~'--c-color-text-4')` | | --c-nav-menu-dark-bg | `var(~'--c-color-menu-dark-bg')` | | --c-nav-menu-dark-item-bg-hover | `var(~'--c-color-menu-dark-hover')` | | --c-nav-menu-dark-item-bg-selected | `var(~'--c-color-menu-dark-hover')` | | --c-nav-menu-dark-item-text-color | `var(~'--c-color-text-4')` | | --c-nav-menu-dark-item-text-color-selected | `var(~'--c-color-white')` | | --c-nav-menu-dark-item-text-color-disabled | `var(~'--c-color-text-2')` | | --c-nav-menu-row-height | `40px` | | --c-nav-menu-row-height-xs | `28px` | | --c-nav-menu-row-height-sm | `32px` | | --c-nav-menu-row-height-lg | `48px` | | --c-nav-menu-row-height-xl | `56px` | | --c-nav-menu-content-gap | `8px` | | --c-nav-menu-content-padding | `12px` | | --c-nav-menu-icon-size | `20px` | | --c-nav-menu-arrow-size | `12px` | | --c-nav-menu-focus-width | `2px` | | --c-nav-menu-focus-offset | `-2px` | | --c-nav-menu-divider-width | `1px` | | --c-nav-menu-divider-color | `var(--c-color-border-2)` | | --c-nav-menu-popup-min-width | `180px` | | --c-nav-menu-popup-max-height | `320px` | | --c-nav-menu-popup-shadow | `0 6px 24px rgb(0 0 0 / 12%)` | | --c-nav-menu-motion-duration | `150ms` | | --c-nav-menu-panel-width | `min(400px, 100vw)` | `popup-layout="full"` starts at the bottom edge of the trigger, spans the viewport width and fills the remaining viewport height below it. On Maple, the same layout starts below the entire filter bar. Mobile defaults to full-width; desktop defaults to dropdown. ## Reading direction and keyboard interaction NavMenu inherits the nearest native `dir` and reacts to changes. Horizontal navigation follows reading direction; vertical up/down navigation stays unchanged. Data-menu branches mirror expand/parent keys and prefer the inline-end side for nested popups. Popups retain the source direction. Explicit Item placement remains physical; changing direction does not select an item or clear filters. --- Document: llms/en-US/components/notification.md # Notification Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/notification/__demos__/basic.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Explicit left/right notification corners remain physical. Icons, content, close actions and footers follow reading direction. Imperative calls use explicit or document direction rather than borrowing another app context. ## API clear immediately releases entries and IDs. Re-adding the same ID, even in the same update cycle, creates an independent internal instance and a fresh complete display timer. Ordinary active-ID updates remain in place. Internal keys are not public API. clear still does not add business onClose calls. Reduced-motion component styles disable opacity, left/right enter, appear and leave transitions and initial displacement without a global tiny-duration fallback. Static layout/colors and business display deadlines remain unchanged. Real OS/browser matrices require separate validation. duration (default 3000ms; 0 stays open) is a business display timer, not CSS animation duration. close notifies once per mounted instance and immediately cancels timers. Updates/repeated closing during leave do not reschedule auto-close. reset-on-update restarts only active, unclosed instances. KeepAlive deactivation cancels timing; reactivation restarts the full configured duration. Unmounting/stale callbacks emit no delayed close. TransitionGroup unmounts after actual leave completion, independently of duration. Six transition-* tokens control opacity/left/right enter/leave without changing auto-close deadlines. Normal override checks are not real OS reduced-motion validation. ### `Notification` global methods `Notification` global methods can be used in three ways: 1. Call `this.$notification` 2. In Composition API, call `getCurrentInstance().appContext.config.globalProperties.$notification` 3. Import `Notification` and call its methods directly Import-based calls cannot obtain the current Vue Context. AppContext injections such as i18n or route must be supplied manually in the call, or by configuring a global AppContext for the component. ```ts import { createApp } from 'vue' import { Notification } from '@cedar-design/ui' const app = createApp(App) Notification._context = app._context ``` ### NotificationMethod | Parameter | Description | Type | Default | | ------- | ---------------------- | ------------------------------------------------------------------------------------------------ | :----: | | info | Show an information notification | `( config: string \| NotificationConfig, appContext?: AppContext ) => NotificationReturn` | `-` | | success | Show a success notification | `( config: string \| NotificationConfig, appContext?: AppContext ) => NotificationReturn` | `-` | | warning | Show a warning notification | `( config: string \| NotificationConfig, appContext?: AppContext ) => NotificationReturn` | `-` | | error | Show an error notification | `( config: string \| NotificationConfig, appContext?: AppContext ) => NotificationReturn` | `-` | | remove | Clear the notification with the specified `id` | `(id: string) => void` | `-` | | clear | Clear all notifications | `(position?: NotificationPosition) => void` | `-` | ### NotificationConfig | Parameter | Description | Type | Default | Version | | ---------------- | --------------------------- | ---------------------------------------------------- | :-----: | :----- | | content | Content | `RenderContent` | `-` | | | title | Title | `RenderContent` | `-` | | | icon | Icon | `RenderFunction` | `-` | | | id | Unique id | `string` | `-` | | | style | Style | `CSSProperties` | `-` | | | class | Class name | `ClassName` | `-` | | | position | Physical corner of the notification itself in the viewport, default top-right. Corner values use vertical-first kebab-case spelling | `'top-left'\|'top-right'\|'bottom-left'\|'bottom-right'` | `top-right` | | | showIcon | Whether to show the icon | `boolean` | `true` | | | closable | Whether closable | `boolean` | `false` | | | duration | Display duration in `ms` | `number` | `3000` | | | footer | Footer content | `RenderFunction` | `-` | 2.25.0 | | closeIcon | Close-button icon | `RenderFunction` | `-` | | | closeIconElement | Close-button element | `RenderFunction` | `-` | | | onClose | Close callback | `(id: number \| string) => void` | `-` | | ### NotificationReturn | Parameter | Description | Type | Default | | ------ | ------------------ | ------------ | :----: | | close | Close the current notification | `() => void` | `-` | ### Type definitions The component exports the following types ```ts import type { NotificationInstance, NotificationConfig, NotificationReturn } from '@cedar-design/ui' ``` ## Public CSS variables Panels use surface-overlay; body/title use content-primary; close buttons use content-secondary; borders use border-default. Status icons use readable status content colors: info no longer uses brand fills, and loading uses content-brand. Colors are grouped by status. Custom backgrounds require checking content/icon/close contrast. Plain-text actions/footers inherit panel content color; applications own independently styled slots. wrapper-* controls list position/spacing; padding-*/margin-* control panel layout; icon-*/title-*/content-* control typography; close-* controls close buttons; border-*/box-shadow control borders/shadows; transition-* controls motion; z-index controls stacking. Existing geometry/motion defaults remain. The table lists actual declarations, not a claim that every historical geometry variable has verified consumers. | Variable | Default | | --- | --- | | `--c-notification-wrapper-margin-top` | `var(--c-spacing-8)` | | `--c-notification-wrapper-margin-bottom` | `var(--c-spacing-8)` | | `--c-notification-wrapper-margin-left` | `var(--c-spacing-8)` | | `--c-notification-wrapper-margin-right` | `var(--c-spacing-8)` | | `--c-notification-z-index` | `var(--c-z-index-notification)` | | `--c-notification-border-radius` | `var(--c-border-radius-md)` | | `--c-notification-margin-bottom` | `var(--c-spacing-8)` | | `--c-notification-width` | `300px` | | `--c-notification-padding-top` | `var(--c-spacing-8)` | | `--c-notification-padding-bottom` | `var(--c-spacing-8)` | | `--c-notification-padding-left` | `var(--c-spacing-8)` | | `--c-notification-padding-right` | `var(--c-spacing-8)` | | `--c-notification-icon-font-size` | `24px` | | `--c-notification-title-font-size` | `var(--c-font-size-title-1)` | | `--c-notification-title-font-weight` | `var(--c-font-weight-500)` | | `--c-notification-content-font-size` | `var(--c-font-size-body-3)` | | `--c-notification-icon-margin-right` | `var(--c-spacing-7)` | | `--c-notification-title-margin-bottom` | `var(--c-spacing-2)` | | `--c-notification-footer-margin-top` | `var(--c-spacing-7)` | | `--c-notification-box-shadow` | `0 4px 12px rgba(0, 0, 0, 0.15)` | | `--c-notification-border-width` | `1px` | | `--c-notification-border-style` | `solid` | | `--c-notification-close-icon-color` | `var(--c-sys-color-content-secondary)` | | `--c-notification-close-icon-font-size` | `12px` | | `--c-notification-close-icon-top` | `var(--c-spacing-6)` | | `--c-notification-close-icon-right` | `var(--c-spacing-6)` | | `--c-notification-close-icon-hover-size` | `20px` | | `--c-notification-normal-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-notification-normal-icon-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-normal-title-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-normal-content-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-normal-border-color` | `var(--c-sys-color-border-default)` | | `--c-notification-info-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-notification-info-icon-color` | `var(--c-sys-color-content-info)` | | `--c-notification-info-title-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-info-content-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-info-border-color` | `var(--c-sys-color-border-default)` | | `--c-notification-success-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-notification-success-icon-color` | `var(--c-sys-color-content-success)` | | `--c-notification-success-title-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-success-content-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-success-border-color` | `var(--c-sys-color-border-default)` | | `--c-notification-warning-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-notification-warning-icon-color` | `var(--c-sys-color-content-warning)` | | `--c-notification-warning-title-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-warning-content-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-warning-border-color` | `var(--c-sys-color-border-default)` | | `--c-notification-error-bg` | `var(--c-sys-color-surface-overlay)` | | `--c-notification-error-icon-color` | `var(--c-sys-color-content-danger)` | | `--c-notification-error-title-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-error-content-color` | `var(--c-sys-color-content-primary)` | | `--c-notification-error-border-color` | `var(--c-sys-color-border-default)` | | `--c-notification-transition-duration` | `var(--c-transition-duration-2)` | | `--c-notification-transition-duration-enter` | `var(--c-transition-duration-4)` | | `--c-notification-transition-duration-leave` | `var(--c-transition-duration-3)` | | `--c-notification-transition-timing-function` | `var(--c-transition-timing-function-linear)` | | `--c-notification-transition-timing-function-enter` | `var(--c-transition-timing-function-overshoot)` | | `--c-notification-transition-timing-function-leave` | `var(--c-transition-timing-function-standard)` | After Teleport, theme variables follow actual DOM ancestors. Variables inside content do not propagate upward to service-created containers. A throwing close/closed notification cannot retain the closed item or its empty manager host. Resources are released independently of notification callbacks. --- Document: llms/en-US/components/overflow-list.md # Overflow List Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `auto-label-width`, `:min="0"`, `:max="20"`, `:max="800"`. Example source: src/overflow-list/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### From - `from`: Overflow From Example source: src/overflow-list/__demos__/from.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ------ | ------------------ | ------------------ | :-----: | | min | Minimum number of elements to display | `number` | `0` | | margin | Item Margin | `number` | `8` | | from | Overflow From | `'start' \| 'end'` | `'end'` | ### `` Events | Event | Description | Arguments | | ------ | ------------------ | --------------- | | change | Emitted when the overflow count changes | value: `number` | ### `` Slots | Slot | Description | Arguments | | -------- | :------: | ---------------- | | overflow | Collapsed elements | number: `number` | ### Type definitions The component exports the following types ```ts import type { BadgeInstance } from '@cedar-design/ui' ``` --- Document: llms/en-US/components/overlay.md # Overlay Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `v-model:open="open"`. Example source: src/overlay/__demos__/basic.vue ```vue ``` ## API ### Props | Arguments | Description | Type | Default | | ------------------ | -------------------------------------------- | -------------------------------- | -------- | | `v-model:open` | Visible state | `boolean` | `false` | | `default-open` | Whether to display by default in uncontrolled mode | `boolean` | `false` | | `overlay-closable` | Whether clicking the backdrop closes the Overlay | `boolean` | `true` | | `lock-scroll` | Lock scrolling on the host | `boolean` | `true` | | `unmount-on-close` | Whether to unmount slot content after closing | `boolean` | `true` | | `esc-to-close` | Whether Escape closes the overlay | `boolean` | `true` | | `popup-container` | Teleport target; `false` renders in place | `string \| HTMLElement \| false` | `'body'` | | `z-index` | Custom z-index | `number` | `-` | ### Events | Event | Description | Arguments | | ------------- | ------------ | --------------- | | `update:open` | Open state changed | `boolean` | | `open` | Opening starts | `-` | | `opened` | Opening transition completes | `-` | | `close` | Closing starts | `-` | | `closed` | Closing transition completes | `-` | | `click` | Click on the background area | `MouseEvent` | | `key-escape` | Escape was pressed | `KeyboardEvent` | ### Slots | Slot | Description | | --------- | ---------------- | | `default` | Content above the background layer | ## Public CSS variables These are actual :root defaults. Prefer component variables for business customization; internal positioning variables are not public API. | Variable | Default | Meaning and use case | | --- | --- | --- | | `--c-overlay-background-color` | `var(--c-sys-color-scrim)` | Scrim background only; does not change foreground-content opacity | | `--c-overlay-animation-duration` | `var(--c-sys-motion-duration-slow)` | Enter/leave duration; reduced motion may override it | | `--c-overlay-content-z-index` | `var(--c-sys-layer-raised)` | Local stacking level of content above the scrim | ### Reduced motion Built-in CSS transitions follow `prefers-reduced-motion: reduce`. Removing transitions does not change final visibility, selected/expanded state or event semantics. Applications control custom animations inside slots. --- Document: llms/en-US/components/page-header.md # Page Header Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `show-back`: Whether to show the back button - `title`: Main title - `subtitle`: Subtitle Example source: src/page-header/__demos__/basic.vue ```vue ``` ## Content and presentation ### Breadcrumbs and transparent surfaces #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Main title | Breadcrumbs and transparent surfaces, Content | | `subtitle` | Subtitle | Breadcrumbs and transparent surfaces, Content | | `show-back` | Whether to show back | Content | Compare breadcrumb navigation and title hierarchy on transparent surfaces. Example source: src/page-header/__demos__/surface-comparison.vue ```vue ``` ### Content - `show-back`: Whether to show the back button - `title`: Main title - `subtitle`: Subtitle Example source: src/page-header/__demos__/content.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. The back action sits at reading start and its default icon points right in RTL. Titles and extras follow reading order. Custom back slots are not automatically mirrored. ## API ### PageHeader Props | Prop | Description | Type | Default | | -------- | ---------------- | --------- | ------- | | show-back | Whether to show back | `boolean` | `false` | | title | Main title | `string` | `-` | | subtitle | Subtitle | `string` | `-` | | extra | Extra content on the right | `string` | `-` | ### PageHeader Events | Event | Description | Arguments | | ------ | ------------------ | -------------- | | back | Emitted when the back button is clicked | event: `Event` | ### PageHeader Slots | Slot | Description | Arguments | | -------- | -------------- | ---- | | header | Content above the page header | - | | back | Custom back icon | - | | avatar | Avatar | - | | title | Main title | - | | subtitle | Subtitle | - | | extra | Additional right-side content | - | | default | Main page-header content | - | | footer | Footer content | - | ## Type definitions ```ts import type { PageHeaderProps } from '@cedar-design/ui' ``` ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. The back control is a native button with keyboard activation and back(MouseEvent). Cedar classes change from c-page-header-xxx to c-page-header__xxx. Icons remain locally supplied. ### Back-interaction variables `--c-page-header-back-hover-size` (30px) sets the feedback-circle size without moving title layout. `--c-page-header-back-hover-bg` (`var(--c-sys-color-state-hover)`) sets its background. Hover applies only to hover-capable fine pointers; all input modes retain keyboard focus-visible feedback. --- Document: llms/en-US/components/pagination.md # Pagination Pagination with a shared API and container-responsive layout. ## Basic examples ### Basic and two-way binding Example source: src/pagination/__demos__/basic.vue ```vue ``` ## Appearance and states ### Five sizes and elevation #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `total` | Total item count; required | Five sizes and elevation, Disabled and hide on single page | | `show-page-size` | Show page size selector | Five sizes and elevation, Disabled and hide on single page | | `show-jumper` | Show separate jumper in full mode; simple mode includes input | Five sizes and elevation, Disabled and hide on single page | | `size` | Size of all controls | Five sizes and elevation | | `elevation` | Page button shadow; true uses level 2 | Five sizes and elevation | | `disabled` | Disable all interactions | Disabled and hide on single page | Example source: src/pagination/__demos__/size.vue ```vue ``` ### Disabled and hide on single page Example source: src/pagination/__demos__/disabled.vue ```vue ``` ## Pagination modes and information ### Simple mode #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `total` | Total item count; required | Simple mode, Page window and ellipsis, Totals, page sizes and jumpers | | `show-total` | Show total | Simple mode, Totals, page sizes and jumpers | | `show-page-size` | Show page size selector | Simple mode, Totals, page sizes and jumpers | | `responsive` | Automatically use simple mode by container width | Page window and ellipsis, Totals, page sizes and jumpers | | `simple` | Explicit simple mode | Simple mode | | `default-value` | Initial uncontrolled page | Page window and ellipsis | Example source: src/pagination/__demos__/simple.vue ```vue ``` ### Page window and ellipsis Example source: src/pagination/__demos__/more-page-size.vue ```vue ``` ### Totals, page sizes and jumpers Compare total labels, page-size selection and page jumpers. Change the available controls and observe their output. Example source: src/pagination/__demos__/auxiliary-controls-comparison.vue ```vue ``` ## Page size, navigation and buttons ### Custom page slots and styles #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `total` | Total item count; required | Custom page slots and styles | | `default-value` | Initial uncontrolled page | Custom page slots and styles | | `buffer-size` | Pages on either side of current page | Custom page slots and styles | | `responsive` | Automatically use simple mode by container width | Custom page slots and styles | | `page-item-style` | Base numeric page style | Custom page slots and styles | | `active-page-item-style` | Additional active numeric page style | Custom page slots and styles | Example source: src/pagination/__demos__/custom-page-button.vue ```vue ``` ## Responsive layout and data changes ### Container width and compact layout #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `total` | Total item count; required | Container width and compact layout, Data changes and auto adjustment, Full feature controls | | `show-total` | Show total | Container width and compact layout, Data changes and auto adjustment, Full feature controls | | `show-page-size` | Show page size selector | Container width and compact layout, Data changes and auto adjustment, Full feature controls | | `show-jumper` | Show separate jumper in full mode; simple mode includes input | Container width and compact layout, Full feature controls | | `responsive` | Automatically use simple mode by container width | Container width and compact layout | | `auto-adjust` | Preserve first record on size change; clamp after total shrinks | Data changes and auto adjustment | Example source: src/pagination/__demos__/responsive.vue ```vue ``` ### Data changes and auto adjustment Example source: src/pagination/__demos__/auto-adjust.vue ```vue ``` ### Full feature controls Example source: src/pagination/__demos__/all.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Page numbers and previous/next semantics remain unchanged. Default navigation icons follow reading direction; page input, disabled boundaries and selection are preserved. Custom icon slots own their direction. ## API Use ordinary `v-model`: `modelValue` is the current page, starting at 1; pageSize independently controls items per page. `defaultValue` initializes uncontrolled state once without later resets or initialization `update:modelValue`. When `modelValue` is supplied, the parent value controls the display. ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | total | Total item count; required | `number` | `—` | | model-value | Current page; v-model | `number` | `—` | | default-value | Initial uncontrolled page | `number` | `1` | | page-size | Page size; v-model:page-size | `number` | `—` | | default-page-size | Initial uncontrolled page size | `number` | `10` | | disabled | Disable all interactions | `boolean` | `false` | | hide-on-single-page | Hide with at most one page | `boolean` | `false` | | simple | Explicit simple mode | `boolean` | `false` | | show-total | Show total | `boolean` | `false` | | show-more | Append forward jump in full mode | `boolean` | `false` | | show-jumper | Show separate jumper in full mode; simple mode includes input | `boolean` | `false` | | show-page-size | Show page size selector | `boolean` | `false` | | page-size-options | Positive integer size options | `number[]` | `[10, 20, 30, 40, 50]` | | page-size-props | Optional restricted configuration for the page-size Select. Placement defaults to bottom-start and reaches Trigger through Select.triggerProps for automatic positioning; cannot override pagination values, options or size | `PaginationPageSizeProps` | `—` | | size | Size of all controls | `'xs' / 'sm' / 'md' / 'lg' / 'xl'` | `'md'` | | page-item-style | Base numeric page style | `CSSProperties` | `—` | | active-page-item-style | Additional active numeric page style | `CSSProperties` | `—` | | base-size | Base threshold for ellipsis in full mode | `number` | `6` | | buffer-size | Pages on either side of current page | `number` | `2` | | elevation | Page button shadow; true uses level 2 | `boolean / number` | `false` | | responsive | Automatically use simple mode by container width | `boolean` | `true` | | compact-breakpoint | Maximum container width for compact mode, in px | `number` | `480` | | auto-adjust | Preserve first record on size change; clamp after total shrinks | `boolean` | `true` | ### Events | Event | Description | Arguments | | --- | --- | --- | | update:model-value | Request current page update | `number` | | change | Committed page change; paired with update:modelValue | `number` | | update:page-size | Request page size update | `number` | | page-size-change | Committed size change; paired with update:page-size | `number` | ### Slots | Slot | Description | Scope | | --- | --- | --- | | total | Total | `{ total: number }` | | page-item | Numeric page | `{ page: number }` | | page-item-step | Previous / next | `{ type: 'previous' / 'next' }` | | page-item-ellipsis | Ellipsis jump | `—` | | jumper-prepend | Separate jumper prefix | `—` | | jumper-append | Separate jumper suffix | `—` | ### Methods | Method | Description | | --- | --- | ## Behavior Containers at or below `compact-breakpoint` automatically use compact mode, consistently in desktop sidebars and mobile. Totals/page-size selectors remain; auxiliary controls wrap. Previous/next sizes follow size without forced narrow-screen enlargement (formerly 36px). `responsive=false` retains full page numbers; extremely narrow page lists scroll internally without widening the page. The compact current-page input also serves as the jumper, so no duplicate jumper appears. `page-item`, `page-item-ellipsis`, `jumper-prepend` and `jumper-append` render only in their full-mode controls. Page buttons support Tab/Enter/Space, with `aria-current=page` on the current page. The jumper requests a numeric keyboard and submits on Enter/blur. Empty, nonnumeric or fractional values do not navigate; out-of-range integers clamp to valid pages. Disabled blocks all commits. `auto-adjust` tries to preserve the previous page's first item when page size changes, clamps to the last page after total reductions and returns to page 1 for zero items. Controlled mode proposes updates only; the parent decides the display. An explicit parent modelValue in the same update batch takes precedence. Both full and compact jumper inputs show the current page. Navigation, external modelValue changes and page-size adjustments update them together. Invalid input restores the current page number. ### PaginationPageSizeProps The page-size selector fits its selected text and arrow with only item spacing between them, updating on option/language changes. `--c-pagination-select-width` overrides its width. Popup menus size independently from option content. Both platforms support `disabled?: boolean`, `placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'`, `popupContainer?: string | HTMLElement | false`, `class?: string` and `style?: CSSProperties`. Outer disabled takes precedence. Default placement is bottom-start. This configuration no longer forwards arbitrary SelectProps/MenuProps. page-size, page-size-options and size control the pagination value, options and dimensions. ## Type definitions ```ts import type { PaginationProps, PaginationInstance, PaginationPageSizeProps } from '@cedar-design/ui' ``` ## Style variables | Token | Default | | --- | --- | | `--c-pagination-text-color` | `var(--c-color-text-1)` | | `--c-pagination-font-size` | `var(--c-sys-font-size-md)` | | `--c-pagination-gap` | `var(--c-sys-space-5)` | | `--c-pagination-item-gap` | `var(--c-sys-space-2)` | | `--c-pagination-focus-space` | `3px` | | `--c-pagination-size-xs` | `24px` | | `--c-pagination-size-sm` | `28px` | | `--c-pagination-size-md` | `36px` | | `--c-pagination-size-lg` | `44px` | | `--c-pagination-size-xl` | `52px` | | `--c-pagination-item-padding` | `var(--c-sys-space-4)` | | `--c-pagination-item-border-radius` | `var(--c-sys-radius-md)` | | `--c-pagination-icon-size` | `16px` | | `--c-pagination-input-width` | `32px` | | `--c-pagination-select-width` | `max-content` | | `--c-pagination-touch-size` | `44px` | | `--c-pagination-focus-width` | `2px` | | `--c-pagination-focus-offset` | `1px` | | `--c-pagination-focus-color` | `var(--c-color-primary)` | | `--c-pagination-item-background` | `transparent` | | `--c-pagination-hover-background` | `var(--c-color-fill-1)` | | `--c-pagination-active-background` | `var(--c-color-primary-light-1)` | | `--c-pagination-active-color` | `var(--c-color-primary)` | | `--c-pagination-disabled-color` | `var(--c-color-text-4)` | | `--c-pagination-disabled-background` | `var(--c-color-fill-1)` | ### Placement semantics and configuration No placement configuration is required for normal use: bottom-start is preferred and the underlying Trigger automatically flips/constrains the popup. pageSizeProps.placement is only a restricted override for the page-size Select: Pagination → Select.triggerProps.placement → Trigger. It does not position the pagination itself. --- Document: llms/en-US/components/palette.md # Style Palette Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Colors Example source: src/style/palette/__demos__/colors.vue ```vue ``` --- Document: llms/en-US/components/paper.md # Paper Paper is a low-level surface with background, radius, optional border and elevation. It has no variant, status, structural slots or default padding. Use Card for structured content. Paper does not manage popup positioning, focus or button semantics. ## Basic examples ### Examples Example source: src/paper/__demos__/basic.vue ```vue ``` ## Interaction and control ### Live properties #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `bordered` | Show a border independently of elevation | Live properties | | `round` | 50% radius; a circle only with equal width and height | Live properties | | `radius` | Explicit radius, taking priority over round | Live properties | | `elevation` | false disables; true uses level 2; numeric levels 0–24 | Live properties | | `width` | Width | Live properties | | `height` | Surface height | Live properties | Border and shadow are independent. An explicit radius overrides round; removing it restores round. The inner native button provides keyboard semantics, and its click bubbles to Paper to update parent-owned feedback. Example source: src/paper/__demos__/live-properties.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | bordered | Show a border independently of elevation | boolean | false | | elevation | false disables; true uses level 2; numeric levels 0–24 | boolean / number | false | | ripple | Opt-in ripple; does not add button semantics | boolean | false | | radius | Explicit radius, taking priority over round | number / string | — | | width | Width | number / string | — | | height | Surface height | number / string | — | | round | 50% radius; a circle only with equal width and height | boolean | false | | inline | Use inline-flex | boolean | false | Numbers and numeric strings for radius/width/height use px. Other strings pass through as CSS lengths, such as 1rem, 50% and calc(100% - 8px). Classes, native attributes and styles fall through to the root. ### Events | Event | Description | Arguments | | --- | --- | --- | | click | Triggered when the paper is clicked | MouseEvent | ### Slots | Slot | Description | | --- | --- | | default | Paper content | ### Style variables | Variable | Default | | --- | --- | | --c-paper-background | `var(--c-sys-color-surface-default)` | | --c-paper-border-radius | `4px` | | --c-paper-border-width | `1px` | | --c-paper-border-color | `var(--c-sys-color-border-default)` | | --c-paper-transition-duration | `var(--c-sys-motion-duration-slow)` | Built-in themes can override backgrounds/radii. bordered=false reserves no border space; enabled borders use border-box and count within fixed dimensions. Background, border and shadow are independent. ### Types ```ts import type { PaperProps, PaperInstance } from '@cedar-design/ui' ``` ## Independent source copies Each platform maintains its own component body, props, styles, tokens and contract tests, adapting prefixes/local imports without a cross-library core or shared instances/state. Maple migration: the default background becomes the theme surface, and the default pointer cursor is removed. The inline class becomes mp-paper--inline. Existing dimensions, radii, elevation and ripple APIs remain. --- Document: llms/en-US/components/people-select.md # PeopleSelect `options` accepts an array or a loader. Each component owns loading, cancellation and stale-result isolation. `fallback-option` synchronously reads independent reactive display data; update that data after a business request to refresh the label and avatar. Avatars come from `avatar`. Optional phone/chat buttons provide consistent presentation while all actions remain application functions. ## Global defaults and local overrides ```ts import { PeopleSelect, type PeopleSelectProps } from "@cedar-design/ui"; PeopleSelect.setPropsDefaults({ options: (query, { signal }) => peopleService.search(query, signal), fallbackOption: (id) => personCache.value[id] ?? { value: id, label: id }, showPhone: true, showChat: true, call: (person) => businessPhone.call(person.mobile), chat: (person) => businessChat.open(person.value), } satisfies PeopleSelectProps); ``` ```vue ``` Local props override global defaults. Arrays, including [], replace a global loader. Phone/chat buttons appear only in read mode and are hidden by default. Without an action function, without a selected person, or when disabled, the action cannot run. Returned Promises drive button loading; rejection emits action-error(error, call|chat). The UI never opens tel: links or imports a chat SDK. Configure setPropsDefaults once before mounting. It changes the component definition, not an app/tenant-isolated context. For SSR or dynamic tenant defaults, use an application wrapper and props. ## Custom actions ```vue ``` Priority: actions slot → render-actions → built-in phone/chat buttons. Actions do not open the field editor or change its model. ## Basic examples ### Complete example Example source: src/people-select/__demos__/en-US/injected-services.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. | Prop | Description | Default | | ----------------------- | ------------------------------------------------------------ | ------- | | v-model / default-value | String ID; null explicitly clears the model | — / '' | | options | Array or (query, { signal }) => array/Promise | — | | fallback-option | boolean / (id) => PeopleSelectOption | true | | show-avatar | Render avatar | true | | show-phone / show-chat | Read-mode phone/chat buttons | false | | call / chat | Application (person) => void/Promise | — | | render-actions | ({ person, disabled }) => VNodeChild | — | | is-label / read-pretty | Read mode; uses reactive fallback without loading candidates | false | | disabled / readonly | Inherit form state when omitted | — | | empty-value | Clear result; accepts null or a factory returning null | '' | Person data is `{ value: string, label: string, avatar?: string, mobile?: string, disabled?: boolean }`. Optionally pass signal to fetch to cancel stale requests. It is not an HTTP parameter and cannot roll back server operations. Even if signal is ignored, the component isolates stale results. Function results skip secondary local filtering by default; filter-option configures only local matching. Events: update:model-value, change, clear, search, load-error(error, options), action-error(error, call|chat). Methods: refresh(), focus(), blur(). No separate request prop, external useAsyncData or special provider key is needed. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. `fallback-option` is independent of options, returns no Promise and sends no requests. Display prefers a current option, then fallback; false disables display of unmatched values. ### Receiving cancellation signals in business requests The component creates an AbortController per operation and passes signal to the loader. Business code must forward it through request layers. fetch supports AbortSignal natively; Axios 0.22+ supports signal; ofetch/Ky forward or merge it into fetch. Other wrappers must adapt abort events to their own cancellation methods. Client cancellation cannot undo completed server operations. ```ts async function loadPeople(query, { signal }) { const response = await fetch(`/api/people?q=${encodeURIComponent(query)}`, { signal, }); if (!response.ok) throw new Error("People request failed"); return response.json(); } // Axios: preserve signal through your service wrapper. async function loadWithAxios(query, { signal }) { const { data } = await axios.get("/api/people", { params: { q: query }, signal, }); return data; } // Other fetch wrappers: const loadWithOfetch = (query, { signal }) => ofetch("/api/people", { query: { q: query }, signal }); const loadWithKy = (query, { signal }) => ky.get("/api/people", { searchParams: { q: query }, signal }).json(); ``` [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) · [Axios cancellation](https://axios-http.com/docs/cancellation) · [ofetch](https://github.com/unjs/ofetch) · [Ky](https://github.com/sindresorhus/ky#cancellation) --- Document: llms/en-US/components/popconfirm.md # Popconfirm A confirmation popup with before-confirm and before-cancel hooks. ## Basic examples ### Basic Example source: src/popconfirm/__demos__/basic.vue ```vue ``` ## Appearance and states ### Type #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Content | Type | | `type` | Confirmation status type | Type | Example source: src/popconfirm/__demos__/type.vue ```vue ``` ### Api Review ## Layout and arrangement ### Placement #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Content | Placement | | `placement` | Preferred popup side relative to the trigger, default top. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | Placement | Example source: src/popconfirm/__demos__/placement.vue ```vue ``` ## Content and presentation ### Guard Protocol Example source: src/popconfirm/__demos__/en-US/guard-protocol.vue ```vue ``` ### `` Props | Name | Description | Type | Default | | --------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | :------: | | content | Content | `string` | `-` | | placement | Preferred popup side relative to the trigger, default top. Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | `'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | `'top'` | | open **(v-model)** | Controlled confirmation popup visibility | `boolean` | `-` | | default-open | Initial uncontrolled popup visibility | `boolean` | `false` | | type | Confirmation status type | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | | confirm-button-text | Confirm button text | `string` | `-` | | cancel-text | Cancel button text | `string` | `-` | | confirm-button-loading | Confirm button loading state | `boolean` | `false` | | confirm-button-props | Confirm button props | `ButtonProps` | `-` | | cancel-button-props | Cancel button props | `ButtonProps` | `-` | | content-class | Popup content class | `ClassName` | `-` | | content-style | Popup content style | `CSSProperties` | `-` | | arrow-class | Arrow class | `ClassName` | `-` | | arrow-style | Arrow style | `CSSProperties` | `-` | | popup-container | Portal container | `string \| HTMLElement \| false` | `-` | | `before-confirm` | Return a boolean/Promise or call done; the first completion wins | `PopconfirmBeforeConfirm` | — | | `before-cancel` | Return a boolean/Promise or call done; the first completion wins | `PopconfirmBeforeConfirm` | — | ### `` Events | Event | Description | Arguments | | -------------------- | ------------------------------ | ------------------ | | open-change | Popup visibility changes | open: `boolean` | | confirm | Accepted confirm action | - | | cancel | Accepted cancel action | - | ### `` Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | icon | Icon | - | | content | Content | - | Promise and done share a single completion state: false/done(false) rejects; true/done() allows; a resolved Promise<void> allows. The first completion wins. Errors emit guard-error; cancellation/unmount invalidates late completion. Synchronous void retains the callback protocol and waits for done on these close/confirm guards. Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. ## Customization and slots ### Custom #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `content` | Content | Custom | | `confirm-button-text` | Confirm button text | Custom | | `cancel-text` | Cancel button text | Custom | Example source: src/popconfirm/__demos__/custom.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Content and actions use logical alignment. Confirm/cancel actions follow reading order, and switching direction triggers neither action. Explicit popup placement retains its documented physical or logical meaning. ## API ### `` Props | Parameter | Description | Type | Default | | --------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | :------: | | content | Content | `string` | `-` | | placement | Preferred popup side relative to the trigger, default top. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | `'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | `'top'` | | open **(v-model)** | Controlled confirmation popup visibility | `boolean` | `-` | | default-open | Initial uncontrolled popup visibility | `boolean` | `false` | | type | Confirmation status type | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | | confirm-button-text | Confirm button text | `string` | `-` | | cancel-text | Cancel button text | `string` | `-` | | confirm-button-loading | Confirm button loading state | `boolean` | `false` | | confirm-button-props | Confirm button props | `ButtonProps` | `-` | | cancel-button-props | Cancel button props | `ButtonProps` | `-` | | content-class | Popup content class | `ClassName` | `-` | | content-style | Popup content style | `CSSProperties` | `-` | | arrow-class | Arrow class | `ClassName` | `-` | | arrow-style | Arrow style | `CSSProperties` | `-` | | popup-container | Portal container | `string \| HTMLElement \| false` | `-` | | `before-confirm` | Return a boolean/Promise or call done; the first completion wins | `PopconfirmBeforeConfirm` | — | | `before-cancel` | Return a boolean/Promise or call done; the first completion wins | `PopconfirmBeforeConfirm` | — | ### `` Events | Event | Description | Arguments | | -------------------- | ------------------------------ | ------------------ | | open-change | Popup visibility changes | open: `boolean` | | confirm | Accepted confirm action | - | | cancel | Accepted cancel action | - | ### `` Slots | Slot | Description | Arguments | | ------- | :--: | ---- | | icon | Icon | - | | content | Content | - | ### Type definitions The component exports the following types ```ts import type { PopconfirmInstance } from '@cedar-design/ui' ``` ### Placement semantics and configuration placement directly uses TriggerPlacement / triggerPlacements. Legacy TriggerPosition / TRIGGER_POSITIONS aliases have been removed; placement values are unchanged. ### Before-hook waiting feedback Before-hook waits show visible feedback and aria-busy. Rejected or failed operations recover; duplicate submissions do not start another copy. Notification event Promises never drive loading. --- Document: llms/en-US/components/popover.md # Popover Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `title="设备状态"`. Example source: src/popover/__demos__/basic.vue ```vue ``` ## Interaction and control ### Interactive Preview configuration: `v-model:open="open"`, `title="快速备注"`, `placeholder="关闭后再次打开,草稿仍会保留"`. Example source: src/popover/__demos__/interactive.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"` and supports runtime and nested overrides. Content defaults to reading start and portals inherit their source direction. Logical start/end alignment follows direction, while explicit left/right placement remains physical. ## API Popover inherits Trigger positioning, containers, controlled state, close policies and public methods. | Prop | Description | Type | Default | | --- | --- | --- | --- | | title | Title | `string` | — | | content | Body | `string` | — | | trigger | Interaction | `TriggerEvent \| TriggerEvent[]` | `click` | | placement | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | `TriggerPlacement` | `bottom` | | show-arrow | Show the arrow | `boolean` | `true` | | popup-offset | Main-axis distance | `number` | `10` | | unmount-on-close | Unmount content after closing; interaction drafts are retained by default | `boolean` | `false` | | close-on-click-reference | Close when the trigger is clicked again | `boolean` | `true` | Events: `update:open`, `open-change`, `open`, `opened`, `close`, `closed`, `click-outside`. Slots: `default`, `title`, `content`. Slots override same-name `content` props. Panels have consistent content/title/body layers. Triggers are associated through `aria-controls`/`aria-expanded`; external references and SVG are also supported. ## Shared-source contract Cedar and Maple independently maintain the same component body, props, appearance mapping and structural styles. Use Trigger directly for unstyled positioning. Popover has no `defaultStyle`, `popoverClass` or `elevation`; customize appearance through component tokens, `content-class` or `content-style`. ## Public CSS variables These are actual :root defaults. Prefer component variables for business customization; internal positioning variables are not public API. | Variable | Default | Meaning and use case | | --- | --- | --- | | `--c-popover-background` | `var(--c-sys-color-surface-overlay)` | Content and arrow background | | `--c-popover-text-color` | `var(--c-sys-color-content-secondary)` | Body foreground | | `--c-popover-border-color` | `var(--c-sys-color-border-default)` | Content and arrow border color | | `--c-popover-border-width` | `1px` | Content and arrow border width | | `--c-popover-border-radius` | `var(--c-sys-radius-md)` | Content border radius | | `--c-popover-box-shadow` | `var(--c-shadow2-down)` | Content shadow; retains platform differences | | `--c-popover-arrow-z-index` | `1` | Arrow stacking within the current popup | | `--c-popover-padding-horizontal` | `var(--c-sys-space-7)` | Horizontal content padding | | `--c-popover-padding-vertical` | `var(--c-sys-space-6)` | Vertical content padding | | `--c-popover-font-size` | `var(--c-sys-font-size-md)` | Content font size | | `--c-popover-line-height` | `var(--c-line-height)` | Content line height | | `--c-popover-title-text-color` | `var(--c-sys-color-content-primary)` | Title foreground | | `--c-popover-title-font-size` | `var(--c-sys-font-size-lg)` | Title font size | | `--c-popover-title-font-weight` | `var(--c-sys-font-weight-medium)` | Title font weight | | `--c-popover-title-content-gap` | `var(--c-sys-space-2)` | Title-to-body gap | | `--c-popover-animation-duration` | `var(--c-sys-motion-duration-standard)` | Enter/leave duration; reduced motion may override it | Maple dark mode retains a 2px radius and platform-specific shadows. Content and arrows share background/border variables, independent of Trigger style-loading order. With Teleport, variables must be in the actual popup scope, for example through `popup-style`. Trigger-button variables do not automatically inherit into popups. --- Document: llms/en-US/components/progress-group.md # Progress Group Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `max`: Sets the upper bound. Example source: src/progress-group/__demos__/basic.vue ```vue ``` ## Appearance and states ### Progress group sizes and colors #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `items` | Segment data | Progress group sizes and colors | | `size` | Track size | Progress group sizes and colors | | `color` | Default color for segments without their own color | Progress group sizes and colors | | `show-text` | Show the summed percentage | Progress group sizes and colors | Compare segment sizes and color overrides separately from orientation, circular layouts, overflow and keyboard interaction. Example source: src/progress-group/__demos__/appearance-comparison.vue ```vue ``` ## Layout and arrangement ### Orientation #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `items` | Segment data | Orientation | | `show-text` | Show the summed percentage | Orientation | | `orientation` | Horizontal/vertical orientation of the linear progress track, default horizontal; only used for mode=line | Orientation | | `size` | Track size | Orientation | - `size`: Controls the component size. Example source: src/progress-group/__demos__/orientation.vue ```vue ``` ## Content and presentation ### Circle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `mode` | Display mode | Circle | | `items` | Segment data | Circle | | `show-text` | Show the summed percentage | Circle | | `circle-size` | Diameter in circle mode | Circle | | `stroke-width` | Track width in circle mode | Circle | Preview configuration: `mode="circle"`, `:items="items"`, `show-text`, `:circle-size="168"`. Example source: src/progress-group/__demos__/circle.vue ```vue ``` ## Interaction and control ### Overflow Keyboard #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `items` | Segment data | Overflow Keyboard | | `max` | Total used to calculate segment proportions | Overflow Keyboard | | `tooltip` | Whether to show segment hover/focus hints | Overflow Keyboard | | `show-text` | Show the summed percentage | Overflow Keyboard | | `aria-label` | Accessible group name | Overflow Keyboard | | `mode` | Display mode | Overflow Keyboard | - `max`: Sets the upper bound. Example source: src/progress-group/__demos__/overflow-keyboard.vue ```vue ``` Example source: src/progress-group/__demos__/slots.vue ```vue ``` ## Reading direction Horizontal segments, highlights and tooltips share a logical start. Vertical progress stays top to bottom; circular angles and data order are preserved. ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | aria-label | Accessible group name | `string` | — | | items | Segment data | `ProgressGroupItem[]` | `[]` | | mode | Display mode | `'line' \| 'circle'` | `'line'` | | max | Total used to calculate segment proportions | `number` | `100` | | show-text | Show the summed percentage | `boolean` | `false` | | size | Track size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | | color | Default color for segments without their own color | `string` | `content-brand` | | circle-size | Diameter in circle mode | `number \| string` | `120` | | stroke-width | Track width in circle mode | `number` | `8` | | tooltip | Whether to show segment hover/focus hints | `boolean` | `true` | | orientation | Horizontal/vertical orientation of the linear progress track, default horizontal; only used for mode=line | `'horizontal' \| 'vertical'` | `'horizontal'` | ### Item | Prop | Description | Type | | --- | --- | --- | | label | Legend label | `string` | | value | Segment value | `number` | | color | Segment color | `string` | | icon | Legend icon component | `Component` | | slot | Custom slot-name prefix | `string` | | tip | Custom hint text | `string` | ### Slots | Name | Slot arguments | | --- | --- | | text | `{ percent, value, max }` | | tooltip | `{ item, index, percent }` | | item / item-leading / item-label / item-trailing | `{ item, index, percent }` | ### Style variables | Variable | Default | | --- | --- | | `--c-progress-group-gap` | `var(--c-sys-space-3)` | | `--c-progress-group-item-gap` | `var(--c-sys-space-2)` | | `--c-progress-group-dot-size` | `var(--c-sys-space-4)` | | `--c-progress-group-radius` | `9999px` | | `--c-progress-group-track-color` | `var(--c-sys-color-state-hover)` | | `--c-progress-group-text-color` | `var(--c-sys-color-content-primary)` | | `--c-progress-group-muted-color` | `var(--c-sys-color-content-secondary)` | | `--c-progress-group-font-size` | `var(--c-sys-font-size-sm)` | | `--c-progress-group-tooltip-bg` | `var(--c-sys-color-surface-tooltip)` | | `--c-progress-group-tooltip-color` | `var(--c-sys-color-content-on-dark)` | Graphic markers default to system content-brand. Color precedence: item.color → component color → default. Check custom-color contrast; geometry tokens retain platform differences. ### Geometry and motion variables Built-in effects respect `prefers-reduced-motion: reduce`. Track thickness applies to both horizontal and vertical layouts; circle geometry remains prop-driven. | Token | Default | | --- | --- | | `--c-progress-group-transition-duration` | `var(--c-sys-motion-duration-standard)` | | `--c-progress-group-tooltip-duration` | `var(--c-sys-motion-duration-fast)` | | `--c-progress-group-tooltip-max-width` | `240px` | | `--c-progress-group-tooltip-padding` | `5px var(--c-sys-space-4)` | | `--c-progress-group-tooltip-radius` | `var(--c-sys-radius-md)` | | `--c-progress-group-tooltip-font-size` | `var(--c-sys-font-size-xs)` | | `--c-progress-group-tooltip-line-height` | `1.4` | | `--c-progress-group-tooltip-offset` | `var(--c-sys-space-4)` | | `--c-progress-group-text-font-weight` | `var(--c-sys-font-weight-medium)` | | `--c-progress-group-size-xs-thickness` | `2px` | | `--c-progress-group-size-sm-thickness` | `4px` | | `--c-progress-group-size-md-thickness` | `8px` | | `--c-progress-group-size-lg-thickness` | `12px` | | `--c-progress-group-size-xl-thickness` | `16px` | --- Document: llms/en-US/components/progress.md # Progress Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:percent="20"`, `:percent="30"`. Example source: src/progress/__demos__/basic.vue ```vue ``` ## Appearance and states ### Progress sizes and states #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | xs/sm/md/lg/xl or CSS length; line thickness / circle diameter | Progress sizes and states | | `percent` | Decimal 0–100; numeric strings supported; invalid values become zero, out-of-range values clamp | Progress sizes and states | | `mode` | Line or circle | Progress sizes and states | | `stroke-width` | Overrides thickness, numbers in px | Progress sizes and states | | `status` | default/primary/secondary/tertiary/info/success/warning/danger; default becomes success at 100 unless indeterminate | Progress sizes and states | Compare sizes and semantic states independently of circular, stepped and indeterminate models. Example source: src/progress/__demos__/appearance-comparison.vue ```vue ``` ## Content and presentation ### Circle #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `percent` | Decimal 0–100; numeric strings supported; invalid values become zero, out-of-range values clamp | Circle, Step, Loop | | `mode` | Line or circle | Circle, Loop, Advanced | | `status` | default/primary/secondary/tertiary/info/success/warning/danger; default becomes success at 100 unless indeterminate | Circle, Step | | `steps` | Line segments, floored and clamped to 0–1000; ignored when indeterminate | Step | | `size` | xs/sm/md/lg/xl or CSS length; line thickness / circle diameter | Step | | `indeterminate` | Unknown progress; omits aria-valuenow | Loop | - `status`: Selects the semantic state. Example source: src/progress/__demos__/circle.vue ```vue ``` ### Step - `status`: Selects the semantic state. - `size`: Controls the component size. Example source: src/progress/__demos__/step.vue ```vue ``` ### Loop Preview configuration: `indeterminate`, `aria-label="Loading"`, `mode="circle"`, `:percent="60"`. Example source: src/progress/__demos__/loop.vue ```vue ``` ### Advanced - `color`: Overrides the color. Example source: src/progress/__demos__/advanced.vue ```vue ``` ## Reading direction Linear progress grows from reading start and activity motion follows reading direction. Values and circular angles remain unchanged, and reduced-motion settings still apply. ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | mode | Line or circle | `line \| circle` | `line` | | percent | Decimal 0–100; numeric strings supported; invalid values become zero, out-of-range values clamp | `number \| string` | `0` | | size | xs/sm/md/lg/xl or CSS length; line thickness / circle diameter | `ProgressSize` | `md` | | stroke-width | Overrides thickness, numbers in px | `number \| string` | Follows size | | steps | Line segments, floored and clamped to 0–1000; ignored when indeterminate | `number` | `0` | | status | default/primary/secondary/tertiary/info/success/warning/danger; default becomes success at 100 unless indeterminate | `ProgressStatus` | `default` | | color | Solid or gradient stops; overrides status | `string \| Record` | — | | track-color | Background track color | `string` | — | | buffer-color | Remaining line track decoration, not a second progress value | `ProgressColor` | — | | track | Show track and buffer decoration | `boolean` | `true` | | show-text | Show text; xs circle hides text | `boolean` | `true` | | text-class | Text container class | `string` | — | | rotate | Clockwise angle from twelve o'clock | `number` | `0` | | animation | Determinate continuous line shimmer | `boolean` | `false` | | indeterminate | Unknown progress; omits aria-valuenow | `boolean` | `false` | ### Size semantics | size | xs | sm | md | lg | xl | | --- | --- | --- | --- | --- | --- | | Linear thickness / default circular stroke in px | 2 | 3 | 4 | 6 | 8 | | Circular diameter in px | 16 | 48 | 64 | 80 | 96 | `size=12` / `size="12"` means 12px; `size="2rem"`, `"50%"` and `"calc(100% - 2px)"` retain CSS lengths. Custom linear size controls thickness; custom circular size controls diameter. stroke-width always takes precedence for thickness. Invalid/nonpositive lengths fall back to md. Percentage circular diameters require a definite parent width. All five presets are implemented; xs circular progress hides text. Cedar inherits omitted size from ConfigProvider; Maple defaults to md. ### Slots | Slot | Arguments | Description | | --- | --- | --- | | text | `{ percent: number }` | Takes precedence over default | | default | `{ percent: number }` | Custom display text | Indeterminate progress shows an ellipsis by default; use the text slot for business text. The component does not mutate values or emit updates. Provide `aria-label` for the business task. All built-in animations respect reduced-motion settings. ### Type definitions Exports `ProgressProps`, `ProgressInstance`, `ProgressSize`, `ProgressMode`, `ProgressStatus`, `ProgressColor` and runtime `progressProps`. ## Style variables | Variable | Default | | --- | --- | | `--c-progress-font-size` | `var(--c-sys-font-size-sm)` | | `--c-progress-text-color` | `var(--c-sys-color-content-secondary)` | | `--c-progress-track-color` | `var(--c-sys-color-state-hover)` | | `--c-progress-default-color` | `var(--c-sys-color-content-brand)` | | `--c-progress-primary-color` | `var(--c-sys-color-content-brand)` | | `--c-progress-secondary-color` | `var(--c-sys-color-content-secondary)` | | `--c-progress-tertiary-color` | `var(--c-sys-color-content-tertiary)` | | `--c-progress-info-color` | `var(--c-sys-color-content-info)` | | `--c-progress-success-color` | `var(--c-sys-color-content-success)` | | `--c-progress-warning-color` | `var(--c-sys-color-content-warning)` | | `--c-progress-danger-color` | `var(--c-sys-color-content-danger)` | | `--c-progress-line-border-radius` | `9999px` | | `--c-progress-text-gap` | `var(--c-sys-space-4)` | | `--c-progress-steps-gap` | `var(--c-sys-space-2)` | | `--c-progress-transition-duration` | `var(--c-sys-motion-duration-standard)` | | `--c-progress-animation-duration` | `1.5s` | Determinate circular success/danger states show completion/failure icons, including xs. The text slot overrides these; ARIA numeric values remain. --- Document: llms/en-US/components/radio.md # Radio Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Reading direction Radio groups inherit source dir. Horizontal keys follow visible direction in RTL and skip disabled options; vertical keys and Home/End keep logical order. Radio and button variants retain one Tab entry. Changing direction does not change the selected value. ## Basic examples ### Basic usage - `disabled`: Prevents user interaction. Example source: src/radio/__demos__/basic.vue ```vue ``` ## Groups and layout ### Radio group declarations #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------------------- | ------------------------------------------------------ | | `value` | Option `value` | Radio group declarations, Group Direction, Button Type | | `disabled` | Disabled state; inherits from the form/group when omitted | Radio group declarations, Grid Layout | Compare child and options declarations, then select items to inspect the group model. Example source: src/radio/__demos__/group-declaration-comparison.vue ```vue ``` ### Group Direction Preview configuration: `orientation="vertical"`, `value="A"`, `value="B"`, `value="C"`. Example source: src/radio/__demos__/group-direction.vue ```vue ``` ### Button Type Preview configuration: `variant="button"`, `value="Beijing"`, `value="Shanghai"`, `value="Guangzhou"`. Example source: src/radio/__demos__/button-type.vue ```vue ``` ### Grid Layout - `disabled`: Prevents user interaction. Example source: src/radio/__demos__/grid-layout.vue ```vue ``` ### Group State Preview configuration: `:default-value="'a'"`, `:options="options"`, `:readonly="readonly"`, `:model-value="''"`. Example source: src/radio/__demos__/group-state.vue ```vue ``` ### Button Sizes Preview configuration: `variant="button"`, `:size="size"`, `default-value="week"`, `:options="options"`. Example source: src/radio/__demos__/button-sizes.vue ```vue ``` ## Options and value model ### Control Value #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | --------------------------------------------------------- | ------------------------- | | `default-value` | Initial uncontrolled value | Control Value, Controlled | | `value` | Option `value` | Control Value | | `readonly` | Readonly state; inherits from the form/group when omitted | Control Value | | `disabled` | Disabled state; inherits from the form/group when omitted | Control Value | - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/radio/__demos__/control-value.vue ```vue ``` ### Option Data Preview configuration: `:options="options"`, `:field-names="fields"`, `orientation="vertical"`, `:options="renderOptions"`. Example source: src/radio/__demos__/option-data.vue ```vue ``` ### Controlled Preview configuration: `:model-value="true"`, `:model-value="checked2"`, `:default-value="true"`. Example source: src/radio/__demos__/controlled.vue ```vue ``` ## Interaction and keyboard ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------------------- | ---------------- | | `value` | Option `value` | State Lab | | `disabled` | Disabled state; inherits from the form/group when omitted | State Lab | | `readonly` | Readonly state; inherits from the form/group when omitted | State Lab | | `error` | Error state; inherits from the form/group when omitted | State Lab | Preview configuration: `value="design"`. Example source: src/radio/__demos__/state-lab.vue ```vue ``` ### Keyboard Navigation Preview configuration: `:options="options"`, `aria-label="通知方式"`. Example source: src/radio/__demos__/keyboard-navigation.vue ```vue ``` ## Control and content customization ### Native Control #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | --------------------------------------------------------- | ---------------------------- | | `value` | Option `value` | Native Control, Custom Radio | | `readonly` | Readonly state; inherits from the form/group when omitted | Native Control | - `readonly`: Displays the current value without allowing edits. Example source: src/radio/__demos__/native-control.vue ```vue ``` ### Custom Radio Preview configuration: `default-value="1"`, `value="1"`, `:model-value="checked"`, `checkable`. Example source: src/radio/__demos__/custom-radio.vue ```vue ``` ## Async options ### Async Options Preview configuration: `edit-mode="direct"`, `:options="options"`. Example source: src/radio/__demos__/async-options.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. `ChoiceValue = string | number | boolean`;`CheckboxModel = boolean | ChoiceValue[]`;`RadioModel = ChoiceValue | null`。 ### Radio Props | Prop | Description | Type | Default | | --------------------- | --------------------------------------------------------- | ------------------------- | --------- | | model-value (v-model) | Controlled value | ChoiceValue \| null | undefined | | default-value | Initial uncontrolled value | ChoiceValue \| null | null | | value | Option `value` | `string\|number\|boolean` | `true` | | variant | Radio variant | `'radio'\|'button'` | `'radio'` | | disabled | Disabled state; inherits from the form/group when omitted | boolean | undefined | | readonly | Readonly state; inherits from the form/group when omitted | boolean | undefined | | error | Error state; inherits from the form/group when omitted | boolean | undefined | ### Radio Events | Event | Description | Arguments | | ------------------ | -------------------- | --------------------------------- | | update:model-value | Proposes a new value | value: ChoiceValue | | change | Value change | value: ChoiceValue, event?: Event | | focus | Focus | event: FocusEvent | | blur | Blur | event: FocusEvent | ### Radio Methods | Method | Arguments | Returns | | ------ | ---------------------- | ------- | | select | - | void | | focus | options?: FocusOptions | void | | blur | - | void | ### Radio Slots | Slot | Description | Arguments | | ----- | -------------------- | ---------------------------------------- | | radio | Custom radio control | `checked:boolean`
`disabled:boolean` | ### RadioGroup Props | Prop | Description | Type | Default | | --------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -------------- | | model-value (v-model) | Controlled value | RadioModel | undefined | | default-value | Initial uncontrolled value | RadioModel | null | | variant | Radio-group variant | `'radio'\|'button'` | `'radio'` | | size | Radio-group size | `'xs'\|'sm'\|'md'\|'lg'\|'xl'` | `-` | | options | Options; replaces default slot when supplied | Array> / `(query, { signal }) => Array / Promise` | `undefined` | | orientation | Horizontal/vertical arrangement of radio-group options, default horizontal; not text reading direction | `'horizontal'\|'vertical'` | `'horizontal'` | | disabled | Disabled state; inherits from the form/group when omitted | boolean | undefined | | readonly | Readonly state; inherits from the form/group when omitted | boolean | undefined | | error | Error state; inherits from the form/group when omitted | boolean | undefined | | field-names | Option field mapping | ChoiceFieldNames | undefined | | aria-label | Accessible group name | string | '' | ### RadioGroup Events | Event | Description | Arguments | | ------------------ | ------------------------------------ | ---------------------------------------------- | | update:model-value | Proposes a new value | value: string \| number \| boolean | | change | Value change; notified once by Group | value: string \| number \| boolean, ev?: Event | ### RadioGroup Slots | Slot | Description | Arguments | | ----- | -------------------- | ---------------------------------------- | | radio | Custom radio control | `checked:boolean`
`disabled:boolean` | | label | Radio label content | `data: RadioOption, checked: boolean` | ### RadioOption | Field | Description | Type | | -------- | ------------------------ | ----------------------------------------------------------------- | | value | Option identity | ChoiceValue | | label | Label or render function | VNodeChild \| (data: RadioOption, checked: boolean) => VNodeChild | | disabled | Disable interaction | boolean | | readonly | Read-only interaction | boolean | ## Type definitions The component exports the following types ```ts import type { RadioProps } from "@cedar-design/ui"; ``` ### ChoiceFieldNames `{ label?: string; value?: string; disabled?: string; readonly?: string; indeterminate?: string }` Exported types:`RadioOption`、`ChoiceFieldNames`。 ### Native attributes and appearance | Component | Prop | Description | Type | Default | | ------------------ | ------------------------------- | ----------------------------------------------------------------- | ------------------- | --------- | | Radio / RadioGroup | name | Native field name; child overrides group | string | undefined | | Radio | aria-label | Native control accessible name | string | undefined | | Radio | input-attrs | Native input attributes | InputHTMLAttributes | undefined | | Radio | checked-color / unchecked-color | Instance checked/unchecked colors; error/disabled take precedence | string | undefined | | Radio | icon-size | Icon dimension; numbers are px, strings are CSS lengths | number \| string | undefined | | Radio | ripple | Touch ripple feedback | boolean | true | ### Icons and default slot checked-icon and unchecked-icon are supported on both platforms. default and radio slots receive { checked, disabled }. click emits the original MouseEvent once. Disabled emits no click; readonly may emit click without changing the value. ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. The `options` prop accepts an array or `(query, { signal }) => array/Promise`. The component manages loading, cancellation and stale-result isolation; failures emit load-error. Single/multiple groups initialize with an empty-string query, searchable fields reload when the query changes, and root loading for tree fields remains independent of existing load-more child loading. --- Document: llms/en-US/components/rate.md # Rate Keyboard and pointer rating selection. ## Basic examples ### Basic usage Example source: src/rate/__demos__/basic.vue ```vue ``` ## Appearance and states ### Readonly #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | -------------------------------------------------------------- | ---------------- | | `default-value` | Initial uncontrolled value; subsequent changes do not reset it | Readonly | | `readonly` | Focusable but not editable; inherits Form when omitted | Readonly | | `color` | Active color or increasing per-icon threshold color map | Color | - `readonly`: Displays the current value without allowing edits. Example source: src/rate/__demos__/readonly.vue ```vue ``` ### Color - `color`: Overrides the color. Example source: src/rate/__demos__/color.vue ```vue ``` ## Content and presentation ### Sizes And Symbols #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ----------------------------------------------------------------- | -------------------------------------------------- | | `default-value` | Initial uncontrolled value; subsequent changes do not reset it | Sizes And Symbols, Half, Rating count and clearing | | `allow-half` | Enable half-point steps | Sizes And Symbols, Half | | `grading` | Fixed five-face rating; overrides slots and icon props | Sizes And Symbols, Grading | | `size` | Icon dimension: number/numeric string in px, otherwise CSS length | Sizes And Symbols | | `aria-label` | Accessible business label | Sizes And Symbols | | `gap` | Icon spacing: number/numeric string in px, otherwise CSS length | Sizes And Symbols | - `size`: Controls the component size. Example source: src/rate/__demos__/sizes-and-symbols.vue ```vue ``` ### Half Example source: src/rate/__demos__/half.vue ```vue ``` ### Rating count and clearing Compare rating totals and clearing the current selection, separately from half steps, keyboards and controlled values. Example source: src/rate/__demos__/value-rules-comparison.vue ```vue ``` ### Grading Example source: src/rate/__demos__/grading.vue ```vue ``` ## Customization and slots ### Character Example source: src/rate/__demos__/character.vue ```vue ``` ## Interaction and control ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ------------------------------------------------------------------------ | ------------------- | | `disabled` | Disable interaction; inherits Form when omitted | State Lab, Keyboard | | `readonly` | Focusable but not editable; inherits Form when omitted | State Lab, Keyboard | | `allow-half` | Enable half-point steps | Keyboard | | `clearable` | Click the current score again to clear; keyboard boundaries do not clear | Keyboard | | `aria-label` | Accessible business label | Keyboard | | `default-value` | Initial uncontrolled value; subsequent changes do not reset it | Keyboard | Example source: src/rate/__demos__/state-lab.vue ```vue ``` ### Keyboard - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/rate/__demos__/keyboard.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Prop | Description | Type | Default | | -------------- | ------------------------------------------------------------------------ | -------------------------------- | ------------- | | model-value | Controlled value, including zero; external updates emit no events | number | undefined | | default-value | Initial uncontrolled value; subsequent changes do not reset it | number | 0 | | count | Positive finite number, rounded down; invalid values fall back to 5 | number \| string | 5 | | allow-half | Enable half-point steps | boolean | false | | clearable | Click the current score again to clear; keyboard boundaries do not clear | boolean | false | | grading | Fixed five-face rating; overrides slots and icon props | boolean | false | | disabled | Disable interaction; inherits Form when omitted | boolean | undefined | | readonly | Focusable but not editable; inherits Form when omitted | boolean | undefined | | aria-label | Accessible business label | string | undefined | | size | Icon dimension: number/numeric string in px, otherwise CSS length | number \| string | Style default | | gap | Icon spacing: number/numeric string in px, otherwise CSS length | number \| string | Style default | | color | Active color or increasing per-icon threshold color map | string \| Record | undefined | | empty-color | Inactive color | string | undefined | | disabled-color | Disabled color, overriding active/inactive colors | string | undefined | | icon | Checked icon | string \| Component | Filled star | | half-icon | Half icon | string \| Component | Half star | | empty-icon | Unchecked icon | string \| Component | Empty star | | ripple | Click ripple | boolean | true | size/gap do not accept xs/sm/md/lg/xl presets. Omitted, invalid or nonpositive values retain style defaults. CSS var/calc/min/max/clamp lengths are supported. Ratings normalize to 0–count in steps of 1 or 0.5. Nonfinite ratings display 0 without rewriting the external value. ### Events | Event | Arguments | Description | | ------------------ | ------------- | ------------------------------------------------------------- | | update:model-value | value: number | User produces a new value | | change | value: number | Confirmed new value; no duplicate for equal values | | hover-change | value: number | Hover preview; resets to zero on leave/blur/disabled/readonly | ### Slots | Slot | Arguments | Description | | --------- | ------------------------ | ------------------------------------------------------------- | | character | { index, value, active } | index starts at 0; value starts at 1. Replaces rating symbols | Precedence: grading > character > icon/half-icon/empty-icon > default icon. String icons require global registration; component values do not. ### Methods focus() focuses the rating; blur() removes focus. Readonly remains focusable, while disabled leaves the Tab sequence. Arrow keys adjust, Home clears and End selects the maximum. Keyboard events from interactive children and Alt/Ctrl/Meta combinations are not intercepted. Touch and mouse share half-selection/clearing rules. ### Type definitions Exports RateProps, RateColor, RateIcon, RateInstance, RateExpose, RateEmits and RateCharacterSlotProps. ### Style variables | Token | Default | | ------------------------------------- | ---------------------------------------------- | | `--c-rate-disabled-color` | `var(--c-sys-color-content-disabled)` | | `--c-rate-error-color` | `var(--c-sys-color-content-danger)` | | `--c-rate-active-scale` | `1.2` | | `--c-rate-focus-color` | `var(--c-sys-color-content-brand)` | | `--c-rate-focus-width` | `2px` | | `--c-rate-focus-offset` | `2px` | | `--c-rate-size` | `var(--c-font-size-title-3)` | | `--c-rate-gap` | `var(--c-spacing-4)` | | `--c-rate-min-height` | `var(--c-size-md)` | | `--c-rate-action-padding` | `0px` | | `--c-rate-empty-color` | `var(--c-color-fill-3)` | | `--c-rate-active-color` | `rgb(var(--c-gold-6))` | | `--c-rate-transition-duration` | `var(--c-transition-duration-2)` | | `--c-rate-scale-duration` | `var(--c-transition-duration-4)` | | `--c-rate-transition-timing-function` | `var(--c-transition-timing-function-standard)` | Public token suffixes/meanings match across platforms. Cedar retains gold stars and compact spacing; Maple retains primary-color stars and touch padding. Defaults are recorded in the theme contract. Sources are maintained independently without a shared runtime. `transition-duration` controls hover/color transitions, `scale-duration` controls selection animation, and `transition-timing-function` controls easing. Reduced motion disables these animations. `size` and `gap` props override the corresponding tokens for a single instance. ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. --- Document: llms/en-US/components/resize-box.md # Resize Box Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `directions`: Can be stretched side, there are up, down, left and right can be used Example source: src/resize-box/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Layout Preview configuration: `:resize-directions="['right']"`. Example source: src/resize-box/__demos__/layout.vue ```vue ``` ## Interaction and control ### Controlled - `directions`: Can be stretched side, there are up, down, left and right can be used - `width`: Width - `height`: Height Example source: src/resize-box/__demos__/controlled.vue ```vue ``` ### Custom Triggers - `directions`: Can be stretched side, there are up, down, left and right can be used Example source: src/resize-box/__demos__/custom-triggers.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | -------------------- | ------------------------------------------ | -------------------------------------------- | :---------: | | width **(v-model)** | Width | `number` | `-` | | height **(v-model)** | Surface height | `number` | `-` | | component | The html tag of the telescopic box | `string` | `'div'` | | directions | Edges with enabled resize handles, right only by default. Any combination of top/right/bottom/left; describes neither pointer movement nor popup placement | `('left' \| 'right' \| 'top' \| 'bottom')[]` | `['right']` | ### `` Events | Event | Description | Arguments | | ------------ | -------------- | -------------------------------------------------------------- | | moving-start | Emitted when dragging starts | ev: `MouseEvent` | | moving | Emitted during dragging | size: `{ width: number; height: number; }`
ev: `MouseEvent` | | moving-end | Emitted when dragging ends | ev: `MouseEvent` | ### `` Slots | Slot | Description | Arguments | | ------------------- | :----------: | --------------------------------------------------- | | resize-trigger | Resize-handle content | direction: `'left' \| 'right' \| 'top' \| 'bottom'` | | resize-trigger-icon | Resize-handle icon | direction: `'left' \| 'right' \| 'top' \| 'bottom'` | ### Type definitions The component exports the following types ```ts import type { ResizeBoxInstance } from '@cedar-design/ui' ``` ### Placement semantics and configuration directions means edges with enabled resize handles; the existing name is retained. Only the right edge is enabled by default; multiple edges can be combined. It is neither an orientation axis nor popup placement. Edges is a more direct name for a new design, but this update does not rename the API. ## Reading direction and interaction ResizeBox directions name physical edges: left/right/top/bottom retain their sides in RTL. Handles support the corresponding axis arrow keys, mouse and touch pointers; Shift increases the step from 10px to 50px. Dimensions clamp at zero. Direction changes, edge removal and teardown cancel active gestures and release cursor ownership. --- Document: llms/en-US/components/result.md # Result Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `status`: Selects the semantic state. Example source: src/result/__demos__/basic.vue ```vue ``` ## Content and presentation ### Success, warning and failure #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Result-page status | Success, warning and failure, HTTP result states, All | | `title` | Title content | Success, warning and failure, All | | `subtitle` | Subtitle content | HTTP result states | Compare how semantic states affect the icon, title and actions. HTTP statuses and custom artwork remain separate. Example source: src/result/__demos__/status-comparison.vue ```vue ``` ### HTTP result states Compare permission, missing-resource and server-error content, with recovery actions appropriate to each case. Example source: src/result/__demos__/http-status-comparison.vue ```vue ``` ### All - `status`: Selects the semantic state. Example source: src/result/__demos__/all.vue ```vue ``` ## Customization and slots ### Custom #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Title content | Custom | | `subtitle` | Subtitle content | Custom | Preview configuration: `title="This is title content"`, `subtitle="This is subtitle content"`. Example source: src/result/__demos__/custom.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | -------- | ---------------- | -------------------------------------------------------------------------------- | :------: | | status | Result-page status | `'info' \| 'success' \| 'warning' \| 'danger' \| 'question' \| 'empty' \| '403' \| '404' \| '500'` | `'info'` | | title | Title content | `string` | `-` | | subtitle | Subtitle content | `string` | `-` | | image-size | Status graphic size; numbers are px | `string \| number` | `-` | | animation | Whether status-graphic animation is enabled | `boolean` | `true` | ### `` Slots | Slot | Description | Arguments | Version | | -------- | :------: | ---- | :---- | | icon | Custom status graphic | `{ size?: string }` | | | title | Title | - | | | subtitle | Subtitle | - | | | extra | Actions | - | 2.8.0 | | default | Default slot | - | 2.8.0 | ### Type definitions The component exports the following types ```ts import type { ResultInstance } from '@cedar-design/ui' ``` --- Document: llms/en-US/components/ripple.md # Ripple Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/ripple/__demos__/basic.vue ```vue ``` ## Options | Options | Description | Type | Default | | --- | --- | --- | --- | | color | Ripple color | `string` | `currentColor` | | disabled | Prevent ripples and cancel pending animation | `boolean` | `false` | Use `v-ripple="{ color, disabled }"`. Unmount cancels animations/timers and removes listeners; each element maintains independent keyboard state. ## Styles For direct directive registration, import `@cedar-design/ui/ripple/style`. Runtime imports no CSS, supporting SSR package imports. Variables use `--c-ripple-*` and are declared in `style/token.less`. Theme defaults may differ from mobile while motion/consumption protocols stay aligned. | Variable | Default | Responsibility | | --- | --- | --- | | --c-ripple-color | currentColor | Ripple background; color option takes precedence | | --c-ripple-cubic-bezier | cubic-bezier(0.68, 0.01, 0.62, 0.6) | Transform expansion easing | | --c-ripple-expand-duration | 200ms | Transform expansion duration | | --c-ripple-fade-duration | 140ms | Linear opacity appear/fade duration | Variables belong on the actual directive host and inherit into ripples. Defaults currently match across platforms. 250ms is the minimum postcreation display/postfade removal wait, not visual duration or the entire lifecycle. Runtime reads computed transition duration/delay. Fade waits until the later of creation+250ms or activation+expansion duration; removal waits max(250ms, fade duration). Long overrides are not truncated. 0ms/unstyled retain cleanup floors. Reduced motion hides decoration. Expansion samples on creation/activation, fade on fade start; arbitrary midphase CSS changes/animations are not guaranteed. Repeated release queues once. Disabling/unmounting cleans owned timers/direct ripples without deleting nested instances. Document listeners bind/remove against mount-time ownerDocument, without automatic cross-document rebinding. Only host Enter/Space and matching keyup/blur participate. The directive does not supply button semantics, accessible names or business clicking to plain divs. Real touch/OS preferences need separate validation. --- Document: llms/en-US/components/row.md # Row 24-column Flex layout. Row manages gutters and alignment; Col manages spans, offsets, ordering and breakpoints. Use Grid for CSS Grid collapse and suffix items. > **Choosing a layout** > > - Grid + GridItem: Use for form columns and card grids with consistent column widths, spans, responsive column counts, or collapsed rows and suffix items. > - Row + Col: Use for 24-column Flex layouts that need horizontal/vertical alignment, wrapping control, fixed and flexible widths together, or responsive ordering. Row controls the row; Col controls width, offset and order. > - Space: Use for simple groups of buttons, tags or text that only need spacing, direction and alignment. Use native Flex for more flexible width allocation. ## Basic examples ### 24-column layout Example source: src/row/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Two-axis and responsive gutters #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `gutter` | Gutter: number, responsive object or [horizontal, vertical] | Two-axis and responsive gutters, Horizontal and vertical alignment, Wrapping and plain container mode | | `justify` | Horizontal alignment | Horizontal and vertical alignment, Layout Lab | | `align` | Vertical alignment | Horizontal and vertical alignment, Layout Lab | | `wrap` | Wrap columns | Wrapping and plain container mode | | `div` | Use Row and Col as plain divs without layout styles | Wrapping and plain container mode | Example source: src/row/__demos__/gutter.vue ```vue ``` ### Horizontal and vertical alignment Example source: src/row/__demos__/alignment.vue ```vue ``` ### Wrapping and plain container mode Example source: src/row/__demos__/wrap.vue ```vue ``` ### Nested rows and isolated gutters Example source: src/row/__demos__/nested.vue ```vue ``` ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | gutter | Gutter: number, responsive object or [horizontal, vertical] | `RowGutter` | `0` | | justify | Horizontal alignment | `start / center / end / space-around / space-between` | `start` | | align | Vertical alignment | `start / center / end / stretch` | `start` | | wrap | Wrap columns | `boolean` | `true` | | div | Use Row and Col as plain divs without layout styles | `boolean` | `false` | ### Events | Event | Description | | --- | --- | | click | Native MouseEvent, emitted once per click | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | The wrap example toggles wrapping and plain `div` mode independently. Plain mode removes Row layout styles and child Col spacing; gutter controls distinguish horizontal spacing from vertical spacing. Row uses Flex, not CSS Grid. ### Layout Lab Example source: src/row/__demos__/layout-lab.vue ```vue ``` ## API ### Props | Prop | Description | Type | Default | | --- | --- | --- | --- | | gutter | Gutter: number, responsive object or [horizontal, vertical] | `RowGutter` | `0` | | justify | Horizontal alignment | `start / center / end / space-around / space-between` | `start` | | align | Vertical alignment | `start / center / end / stretch` | `start` | | wrap | Wrap columns | `boolean` | `true` | | div | Use Row and Col as plain divs without layout styles | `boolean` | `false` | ### Events | Event | Description | | --- | --- | | click | Native MouseEvent, emitted once per click | ### Slots | Slot | Description | | --- | --- | | default | Layout content | ### Methods | Method | Description | | --- | --- | Wrapping examples compare wrapped and ordinary `div` modes. Ordinary mode removes Row layout and child Col spacing. Gap examples distinguish horizontal/vertical spacing. Row uses Flex, not CSS Grid. ## Responsiveness and accessibility Breakpoints use the browser viewport: xs is the base; sm ≥576, md ≥768, lg ≥992, xl ≥1200 and xxl ≥1600px. Configured values resolve downward from the largest matching breakpoint. SSR starts with xs and responds to the viewport after mounting. Grid collapsing and dynamic ordering are calculated after mounting. These layout containers add no keyboard shortcuts; callers supply content semantics and focusable elements. There are no public methods or dedicated theme tokens. ## Imports Grid contains only Grid.Item. Row and Col are independent components with their own source, styles, navigation, documentation and demos. Grid.Row/Grid.Col, Row/Col re-exports from Grid and GridRowInstance/GridColInstance are removed. Import them from the library root or separate row/col entries. Installing Grid no longer registers Row/Col automatically. --- Document: llms/en-US/components/scheduler.md # Scheduler Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Reading direction Scheduler inherits `dir` from the page, a local container, or ConfigProvider. Use the documentation navigation switch to change LTR/RTL at runtime. Month/week/resource columns and horizontal time follow inline start; vertical time continues downwards. Switching direction preserves dates, event data, selection and the horizontal reading offset, and cancels active drag or resize gestures. Hourly resource timelines support moving events and resizing both start and end, respecting `snapDuration`, readonly state, milestones and event `resizable`. Zoom preserves the date at the center of the visible time area. Resource labels stick to inline start; virtual rows and their heading scroll together. Default overlap layouts use inline start. A custom `eventLayout` return value keeps the physical meaning of `left`; callers control that geometry. RTL does not reverse dates, time zones, dependencies or source resource order. ## Basic examples ### Basic usage Preview configuration: `default-date="2026-09-09"`. Example source: src/scheduler/__demos__/basic.vue ```vue ``` ## Views and layout ### Layout Groups #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-date` | Initial navigation date | Layout Groups, Without Resources, Resource Week | | `default-mode` | Default uncontrolled view | Layout Groups, Timeline, Hidden Days | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Resource Week, Timeline, Now Indicator | | `start-hour` | Time-grid start hour, 0–23 | Layout Groups, Now Indicator, Stacked Events | | `end-hour` | Time-grid end hour; greater than start and at most 24 | Layout Groups, Now Indicator, Stacked Events | | `modes` | Views available for switching | Without Resources, Hidden Days, Now Indicator | Preview configuration: `:default-date="today"`, `default-mode="day"`, `:event-layout="custom ? layout : 'stack'"`, `:show-sidebar="false"`. Example source: src/scheduler/__demos__/layout-groups.vue ```vue ``` ### Without Resources Preview configuration: `:modes="['day', 'week', 'month', 'agenda']"`, `default-date="2026-09-09"`. Example source: src/scheduler/__demos__/without-resources.vue ```vue ``` ### Resource Week Preview configuration: `default-date="2026-09-09"`, `:resources="resources"`. Example source: src/scheduler/__demos__/resource-week.vue ```vue ``` ### Timeline Preview configuration: `default-date="2026-09-09"`, `default-mode="resource-timeline"`, `:resources="resources"`. Example source: src/scheduler/__demos__/timeline.vue ```vue ``` ### Hidden Days Preview configuration: `default-date="2026-09-18"`, `default-mode="month"`, `:modes="['week', 'month', 'agenda']"`, `:hidden-days="hidden"`. Example source: src/scheduler/__demos__/hidden-days.vue ```vue ``` ### Now Indicator Preview configuration: `v-model:date="date"`, `:show-now-indicator="enabled"`, `default-mode="resource-day"`, `:modes="['day', 'week', 'resource-day']"`. Example source: src/scheduler/__demos__/now-indicator.vue ```vue ``` ### Timeline Groups Preview configuration: `v-model:scale="scale"`, `v-model:expanded-keys="expanded"`, `default-date="2026-09-09"`, `default-mode="resource-timeline"`. Example source: src/scheduler/__demos__/timeline-groups.vue ```vue ``` ### Stacked Events - `readonly`: Displays the current value without allowing edits. Example source: src/scheduler/__demos__/stacked-events.vue ```vue ``` ## Resources and assignments ### Resources #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-date` | Initial navigation date | Resources, Resource Cross Groups, Resource Dimensions | | `default-mode` | Default uncontrolled view | Resources, Resource Cross Groups, Resource Dimensions | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Resources, Resource Cross Groups, Resource Dimensions | | `resource-dimensions` | Dimension definitions: `{ id, label }[]` | Resource Cross Groups, Resource Dimensions, Independent Assignments | | `resource-filters` | Combined resource-dimension filters; supports v-model:resource-filters | Resource Cross Groups, Resource Dimensions, Virtual Resources | | `show-assignment-details` | Edit resource occupancy and roles | Independent Assignments, Assignment Load | Preview configuration: `default-date="2026-09-09"`, `default-mode="resource-day"`, `:resources="resources"`, `:start-hour="8"`. Example source: src/scheduler/__demos__/resources.vue ```vue ``` ### Resource Cross Groups Preview configuration: `data-cross-groups-demo`, `v-model:resource-filters="filters"`, `:resource-group-dimensions="groupDimensions"`, `default-date="2026-09-22"`. Example source: src/scheduler/__demos__/resource-cross-groups.vue ```vue ``` ### Resource Dimensions Preview configuration: `data-dimensions-demo`, `v-model:resource-filters="filters"`, `v-model:resource-dimension="axis"`, `default-date="2026-09-22"`. Example source: src/scheduler/__demos__/resource-dimensions.vue ```vue ``` ### Independent Assignments Preview configuration: `:resources="resources"`, `:resource-dimensions="dimensions"`, `:resource-group-dimensions="['station', 'person']"`, `default-date="2026-09-22"`. Example source: src/scheduler/__demos__/independent-assignments.vue ```vue ``` ### Assignment Load Preview configuration: `default-date="2026-09-22"`, `default-mode="resource-timeline"`, `default-scale="hour"`, `:resources="resources"`. Example source: src/scheduler/__demos__/assignment-load.vue ```vue ``` ### Virtual Resources Preview configuration: `data-virtual-resources-demo`, `v-model:resource-filters="filters"`, `:resources="resources"`, `:resource-dimensions="dimensions"`. Example source: src/scheduler/__demos__/virtual-resources.vue ```vue ``` ## Working hours and capacity ### Recurring and date-specific working hours #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-date` | Initial navigation date | Recurring and date-specific working hours, Maintenance, Resource Capacity | | `default-mode` | Default uncontrolled view | Recurring and date-specific working hours, Maintenance, Resource Capacity | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Recurring and date-specific working hours, Maintenance, Resource Capacity | | `resource-label` | Resource field name, such as equipment or meeting room | Recurring and date-specific working hours, Maintenance | | `allow-overlap` | Allow overlapping times for the same resource | Recurring and date-specific working hours | Compare recurring hours with date-specific overrides. Attempt creation or editing inside and outside available periods to inspect full-duration validation. Example source: src/scheduler/__demos__/working-hours-comparison.vue ```vue ``` ### Maintenance Preview configuration: `default-date="2026-09-09"`, `default-mode="resource-timeline"`, `default-scale="hour"`, `resource-label="设备"`. Example source: src/scheduler/__demos__/maintenance.vue ```vue ``` ### Resource Capacity Preview configuration: `:status="span.exceeded ? 'danger' : 'success'"`, `default-date="2026-09-15"`, `default-mode="resource-timeline"`, `default-scale="hour"`. Example source: src/scheduler/__demos__/resource-capacity.vue ```vue ``` ## Recurrence and calendars ### Recurring Events #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-mode` | Default uncontrolled view | Recurring Events, Calendar Recurrence, Business Calendar | | `default-date` | Initial navigation date | Recurring Events, Business Calendar, Recurrence Following | | `model-value` | Schedule data; supports v-model and becomes controlled when provided | Calendar Recurrence, Recurrence Following, Zoned Recurrence | | `readonly` | Viewing/navigation allowed, editing blocked | Calendar Recurrence, Recurrence Following, Zoned Recurrence | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Recurring Events | | `date` | Navigation date; supports v-model:date | Calendar Recurrence | Preview configuration: `:options="frequencies"`, `aria-label="重复频率"`, `:min="1"`, `:max="12"`. Example source: src/scheduler/__demos__/recurring-events.vue ```vue ``` ### Calendar Recurrence - `readonly`: Displays the current value without allowing edits. Example source: src/scheduler/__demos__/calendar-recurrence.vue ```vue ``` ### Business Calendar Preview configuration: `default-date="2026-02-26"`, `default-mode="week"`, `:working-hours="hours"`, `:disabled-ranges="blocked"`. Example source: src/scheduler/__demos__/business-calendar.vue ```vue ``` ### Recurrence Following - `readonly`: Displays the current value without allowing edits. Example source: src/scheduler/__demos__/recurrence-following.vue ```vue ``` ### Zoned Recurrence - `readonly`: Displays the current value without allowing edits. Example source: src/scheduler/__demos__/zoned-recurrence.vue ```vue ``` ## Editing and interaction ### Drag Feedback #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-date` | Initial navigation date | Drag Feedback, Duplicate Events, Custom Cards | | `default-mode` | Default uncontrolled view | Drag Feedback, Duplicate Events, Custom Event | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Drag Feedback, Duplicate Events, Custom Cards | | `before-change` | Return false to cancel; supports asynchronous interception and save APIs | Custom Event, Custom Editor, External Editor | | `resource-label` | Resource field name, such as equipment or meeting room | Drag Feedback | | `start-hour` | Time-grid start hour, 0–23 | Drag Feedback | - `step`: Controls the allowed increment. Example source: src/scheduler/__demos__/drag-feedback.vue ```vue ``` ### Duplicate Events Preview configuration: `default-date="2026-09-16"`, `default-mode="week"`, `:resources="resources"`, `:before-transaction="persist"`. Example source: src/scheduler/__demos__/duplicate-events.vue ```vue ``` ### Event Dialog Example source: src/scheduler/__demos__/event-dialog.vue ```vue ``` ### Event Popover Example source: src/scheduler/__demos__/event-popover.vue ```vue ``` ### Custom Cards Preview configuration: `default-date="2026-09-09"`, `:resources="resources"`. Example source: src/scheduler/__demos__/custom-cards.vue ```vue ``` ### Custom Event Preview configuration: `default-date="2026-09-09"`, `default-mode="week"`, `:resources="resources"`. Example source: src/scheduler/__demos__/custom-event.vue ```vue ``` ### Custom Editor Preview configuration: `default-date="2026-09-09"`, `default-mode="day"`, `:before-change="beforeChange"`, `:model="event"`. Example source: src/scheduler/__demos__/custom-editor.vue ```vue ``` ### External Editor Preview configuration: `:editable="false"`, `default-date="2026-09-09"`, `default-mode="day"`, `:before-change="beforeChange"`. Example source: src/scheduler/__demos__/external-editor.vue ```vue ``` ### Batch History Preview configuration: `v-model:selected-keys="selected"`, `default-date="2026-09-09"`, `default-mode="resource-timeline"`, `:resources="resources"`. Example source: src/scheduler/__demos__/batch-history.vue ```vue ``` ### Atomic Swap Preview configuration: `default-date="2026-09-09"`, `default-mode="resource-day"`, `:resources="[{ id: 'room', label: '会议室 A' }]"`, `:allow-overlap="false"`. Example source: src/scheduler/__demos__/atomic-swap.vue ```vue ``` ### Interaction Completion Preview configuration: `v-model:mode="mode"`, `default-date="2026-09-22"`, `:slot-duration="60"`, `:snap-duration="15"`. Example source: src/scheduler/__demos__/interaction-completion.vue ```vue ``` ### Advanced Planning Preview configuration: `default-date="2026-09-22"`, `default-mode="resource-timeline"`, `default-scale="hour"`, `:resources="resources"`. Example source: src/scheduler/__demos__/advanced-planning.vue ```vue ``` ## Async loading and saving ### Async Resources #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `default-mode` | Default uncontrolled view | Async Resources, Remote Events, Async Change | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Async Resources, Async Change | | `before-change` | Return false to cancel; supports asynchronous interception and save APIs | Async Resources, Async Change | | `default-date` | Initial navigation date | Async Resources, Async Change | | `resource-label` | Resource field name, such as equipment or meeting room | Async Resources | | `request-resources` | Query resource candidates by keyword and cursor | Async Resources | Preview configuration: `options`, `:resources="visibleResources"`, `:resource-label="kind === 'device' ? '设备' : '人员'"`, `:request-resources="requestResources"`. Example source: src/scheduler/__demos__/async-resources.vue ```vue ``` ### Remote Events - `readonly`: Displays the current value without allowing edits. Example source: src/scheduler/__demos__/remote-events.vue ```vue ``` ### Async Change Preview configuration: `:model-value="events"`, `default-date="2026-09-09"`, `default-mode="resource-day"`, `:resources="resources"`. Example source: src/scheduler/__demos__/async-change.vue ```vue ``` ## Workflows and integration ### Equipment #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `resources` | Currently visible resource rows/columns and local options; a complete directory is unnecessary | Equipment, Task Calendar Details, Task Calendar Workbench | | `default-mode` | Default uncontrolled view | Equipment, Calendar Integration, Task Calendar Details | | `default-date` | Initial navigation date | Equipment, Calendar Integration, Task Calendar Details | | `editable` | Enable the built-in editor; false delegates through editor-request | Task Calendar Details, Task Calendar Workbench | | `start-hour` | Time-grid start hour, 0–23 | Task Calendar Details, Task Calendar Workbench | | `end-hour` | Time-grid end hour; greater than start and at most 24 | Task Calendar Details, Task Calendar Workbench | Preview configuration: `:resources="devices"`, `resource-label="设备"`, `default-mode="resource-day"`, `default-date="2026-09-09"`. Example source: src/scheduler/__demos__/equipment.vue ```vue ``` ### Calendar Integration Preview configuration: `placeholder="ICS 文本"`, `:rows="4"`, `default-date="2026-09-22"`, `default-mode="week"`. Example source: src/scheduler/__demos__/calendar-integration.vue ```vue ``` ### Task Calendar Details Preview configuration: `:editable="false"`, `:resources="resources"`, `default-date="2026-09-09"`, `default-mode="resource-day"`. Example source: src/scheduler/__demos__/task-calendar-details.vue ```vue ``` ### Task Calendar Workbench - `step`: Controls the allowed increment. - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/scheduler/__demos__/task-calendar-workbench.vue ```vue ``` ## API ### `` Props | Prop | Description | Type | Default | | -------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------ | | model-value | Schedule data; supports v-model and becomes controlled when provided | SchedulerEvent[] | — | | preview-event | Unsaved new-event placeholders; visual only | SchedulerEvent | — | | default-value | Initial uncontrolled data | SchedulerEvent[] | [] | | mode | Current view; supports v-model:mode | SchedulerMode | — | | default-mode | Default uncontrolled view | SchedulerMode | week | | date | Navigation date; supports v-model:date | Date / string / number | — | | default-date | Initial navigation date | Date / string / number | Current date | | resource-dimensions | Dimension definitions: `{ id, label }[]` | SchedulerResourceDimension[] | [] | | resource-filters | Combined resource-dimension filters; supports v-model:resource-filters | SchedulerResourceFilters | — | | default-resource-filters | Initial uncontrolled filters | SchedulerResourceFilters | {} | | resource-dimension | Resource row/column dimension; an empty string shows all | string | — | | default-resource-dimension | Initial uncontrolled display dimension | string | '' | | resources | Currently visible resource rows/columns and local options; a complete directory is unnecessary | SchedulerResource[] | [] | | resource-label | Resource field name, such as equipment or meeting room | string | Localized resource label | | request-resources | Query resource candidates by keyword and cursor | SchedulerRequestResources | — | | resolve-resources | Batch-resolve resource names by ID | SchedulerResolveResources | — | | modes | Views available for switching | SchedulerMode[] | All six views | | first-day-of-week | Week start: 0 Sunday to 6 Saturday | number | 1 | | start-hour | Time-grid start hour, 0–23 | number | 8 | | end-hour | Time-grid end hour; greater than start and at most 24 | number | 20 | | initial-scroll-minute | Minute of day initially scrolled into view; subsequent renders retain user scroll position | number | — | | step | Grid/snap interval in minutes; a positive integer dividing 60 | number | 30 | | slot-duration | Grid interval in minutes; positive integer | number | step | | snap-duration | Pointer snap interval in minutes; positive integer | number | step | | default-duration | Default duration for click-to-create, in positive integer minutes | number | step | | drag-to-create | Drag-select empty slots in day/week/resource-day views | boolean | false | | month-event-limit | Maximum directly displayed events per month-view day; extra events use Popover | number | 3 | | overlap-event-limit | Maximum directly displayed events per overlapping time-grid group; extra events use Popover | number | — | | zoom / default-zoom | Timeline zoom, 0.5–4 | number | 1 | | show-date-header | Tiered timeline date headers | boolean | true | | show-assignment-details | Edit resource occupancy and roles | boolean | false | | show-resource-load | Resource peak load, capacity and utilization within the range | boolean | false | | rule-policy | allow/warn/block policies for capacity/unavailable/conflict | SchedulerRulePolicy | {}(block) | | dependencies | Task dependencies | SchedulerDependency[] | [] | | event-layout | Time-grid layout: stack / columns / geometry callback. Week defaults to stack; others to columns | SchedulerEventLayout | Depends on the view | | readonly | Viewing/navigation allowed, editing blocked | boolean | false | | disabled | Disable interaction | boolean | false | | hidden-days | Hide specified weekdays in week/month/agenda, 0–6; cannot hide every day | number[] | [] | | show-now-indicator | Show the current local-time line in day/week/resource-day views | boolean | false | | show-sidebar | Show filters and the unscheduled list | boolean | true | | allow-overlap | Allow overlapping times for the same resource | boolean | true | | editable | Enable the built-in editor; false delegates through editor-request | boolean | true | | before-change | Return false to cancel; supports asynchronous interception and save APIs | SchedulerBeforeChange / SchedulerBeforeChange[] | — | mode is `day | week | month | agenda | resource-day | resource-timeline`. Agenda/resource-timeline navigate by week. Events outside time-grid hours remain visible in month/agenda/timeline. With controlled model-value, the component proposes data and waits for parent acceptance before changing the UI; it does not move first and roll back after request failure. Input arrays/objects are not mutated. before-change receives detached copies; editing them does not alter the committed proposal. ### `` Events | Event | Description | Arguments | | ------------------------ | ---------------------------------------------------------------- | ------------------------------------ | | update:model-value | Proposes a new main value | SchedulerEvent[] | | update:resourceFilters | Combined resource-filter changes; controlled mode waits for parent acceptance | SchedulerResourceFilters | | update:resourceDimension | Resource row/column display-dimension changes | string | | update:mode | View changes | SchedulerMode | | update:zoom | Timeline zoom changes | number | | rule-warning | Advisory rule issues on an accepted proposal | SchedulerError[] | | update:date | Navigation-date changes | Date | | change | Validation/hooks complete; controlled mode has proposed a validated value | value, SchedulerChangeContext | | change-error | Validation, conflict, save or stale-proposal errors | error, SchedulerChange | | event-click | Activate an event with a copy; stacked events support click/Enter too, while multiselection does not activate | SchedulerEvent | | cell-click | Click an empty time slot | SchedulerCell | | range-change | Initial and actual visible-date-range changes | SchedulerRange | | resource-error | Resource search/display resolution fails without changing schedule data | error, SchedulerResourceErrorContext | | editor-request | Only with editable=false: request external creation or viewing/editing | SchedulerEditorRequest | ### `` Slots | Slot | Arguments | Description | | ----------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | event | { event } | Event-button content | | sidebar | { startDrag, cancelDrag, disabled, unscheduled } | Replace the entire sidebar, e.g. with a resource tree/task pool; hidden when show-sidebar=false | | sidebar-extra | { startDrag, cancelDrag, disabled } | Content above the default sidebar; startDrag(template: SchedulerEventTemplate, event: DragEvent). Hidden when show-sidebar=false | | resource-header | { resource?, resources?, date } | Resource or date header | | toolbar | { date, mode, navigate, create } | Replace the toolbar; navigate(-1/1) changes range, create() follows toolbar creation | | column-background | { date, resource? } | Background for day/week/resource-day columns without intercepting pointers; useful for soft warnings/heatmaps | | toolbar-extra | { date, mode } | Toolbar extension | | editor | SchedulerEditorSlotProps | Custom drawer content: action, event, error, errorMessage, save, remove, close, readonly, pending | | empty | — | Empty state | ### Instance methods | Method | Description | | ---------------------------------- | -------------------------------------------------------------- | | `change(change): Promise` | Execute create/update/remove/move/resize with all validation/hooks | | duplicateEvent(id: string) | Open a separately copied draft or request custom creation; returns boolean without automatically saving | | goToDate(date: Date) | Navigate to a date; respects controlled models | ## Type definitions ```ts import type { SchedulerProps, SchedulerInstance, SchedulerMode, SchedulerEvent, SchedulerResource, SchedulerChange, SchedulerChangeContext, SchedulerBeforeChange, SchedulerEventTemplate, SchedulerRequestResources, SchedulerResolveResources, SchedulerResourcePage, SchedulerResourceQuery, SchedulerResourceErrorContext, SchedulerEditorRequest, SchedulerEditorAction, SchedulerEditorSlotProps, } from "@cedar-design/ui"; interface SchedulerEvent { id: string; title: string; start?: Date | string | number; end?: Date | string | number; allDay?: boolean; resourceIds?: string[]; resourceDetails?: Record; milestone?: boolean; layoutGroupId?: string; description?: string; color?: string; accentColor?: string; backgroundColor?: string; backgroundPattern?: "solid" | "diagonal-stripes" | "dots" | "crosshatch"; metadata?: Record; readonly?: boolean; resizable?: boolean; // false disables time-grid resizing while preserving moving/viewing } type SchedulerEventTemplate = Pick< SchedulerEvent, | "title" | "description" | "color" | "accentColor" | "backgroundColor" | "backgroundPattern" | "metadata" | "resourceIds" > & { duration?: number; // positive minutes; defaults to default-duration or step }; interface SchedulerResource { id: string; dimensionId?: string; label: string; color?: string; disabled?: boolean; capacity?: number; // nonnegative safe integer; omission leaves concurrent event counts unlimited } interface SchedulerResourceQuery { dimensionId?: string; query: string; cursor?: string; signal: AbortSignal; } interface SchedulerResourcePage { items: SchedulerResource[]; nextCursor?: string; } type SchedulerRequestResources = ( query: SchedulerResourceQuery, ) => SchedulerResourcePage | Promise; type SchedulerResolveResources = ( ids: string[], context: { signal: AbortSignal }, ) => SchedulerResource[] | Promise; type SchedulerResourceErrorContext = | { type: "search"; query: string; cursor?: string } | { type: "resolve"; ids: string[] }; type SchedulerEditorAction = "create" | "edit"; type SchedulerEditorRequest = { event: SchedulerEvent; readonly: boolean } & ( | { action: "create"; source: "toolbar" | "cell" | "drop" } | { action: "edit"; source: "event" } ); interface SchedulerEditorSlotProps { action: SchedulerEditorAction; event: SchedulerEvent; error?: SchedulerError; errorMessage?: string; readonly: boolean; pending: boolean; save: (event?: SchedulerEvent) => void; remove: () => void; close: () => void; } ``` Every event id must be unique. Omitting both start/end means unscheduled; otherwise end must follow start, except timed milestones requiring start=end. All intervals are `[start, end)`, so adjacent intervals do not conflict. allDay uses `YYYY-MM-DD` strings with an exclusive end, e.g. September 9–10 for a one-day event. Display currently uses the runtime's local zone; timed events should use ISO instants. Arbitrary IANA display zones are not promised. Cross-zone RRULE, ICS and version synchronization come from separate adapters; business code must connect real external accounts. Configure virtual resource rows with virtual-list-props. See examples for local undo and range-based remote loading. Pointer drag supports moving/resizing; Escape cancels. Keyboard/touch users can also schedule/assign through the editor. Disabled resource options prevent new assignments/drops while existing associations may remain or be removed. ## Independent core `src/scheduler/core` imports no Vue, DOM or external calendar library. It can be tested independently and later extracted as scheduler-core. The published pure-core subentry avoids importing component runtime: ```ts import { applySchedulerChange, getSchedulerConflicts, layoutSchedulerEvents, } from "@cedar-design/ui/scheduler/core"; ``` Other date/timeline utilities are exported from this entry too. The core computes and applies immutable changes; it does not handle networking, authorization or database transactions. ### Style variables All variables are defined in `style/token.less` and support light/dark theme overrides. | Variable | Default | | -------------------------------- | ------------------------------ | | --c-scheduler-background | var(--c-color-bg-2) | | --c-scheduler-color | var(--c-color-text-1) | | --c-scheduler-border-color | var(--c-color-border) | | --c-scheduler-sidebar-width | 220px | | --c-scheduler-slot-height | 36px | | --c-scheduler-column-min-width | 120px | | --c-scheduler-max-height | 720px | | --c-scheduler-event-color | rgb(var(--c-primary-6)) | | --c-scheduler-event-accent-color | var(--c-scheduler-event-color) | | --c-scheduler-event-background | var(--c-color-primary-light-1) | | --c-scheduler-lane-height | 38px | | --c-scheduler-ghost-opacity | 0.75 | | --c-scheduler-preview-opacity | 0.85 | | --c-scheduler-preview-duration | 100ms | | --c-scheduler-ghost-z-index | 2000 | ### Before-hook waiting feedback Before-hook waits show visible feedback and aria-busy. Rejected or failed operations recover; duplicate submissions do not start another copy. Notification event Promises never drive loading. --- Document: llms/en-US/components/scrollbar.md # Scrollbar Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/scrollbar/__demos__/basic.vue ```vue ``` ## Appearance and states ### Type - `type`: Type Example source: src/scrollbar/__demos__/type.vue ```vue ``` ## Lifecycle and edge cases ### Thumb Lifecycle Example source: src/scrollbar/__demos__/thumb-lifecycle.vue ```vue ``` ### Lifecycle Example source: src/scrollbar/__demos__/lifecycle.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ----------- | ---------- | ----------------------- | :-------: | | type | Type | `'track' \| 'embed'` | `'embed'` | | outer-class | Outer class | `string\|object\|array` | `-` | | outer-style | Outer style | `StyleValue` | `-` | ### `` Events | Event | Description | Arguments | | ------ | ---------- | ---- | | scroll | Emitted on scrolling | - | ### `` Methods | Method | Description | Arguments | Returns | Version | | ---------- | -------- | ---------------------------------------------------------------- | ------ | :----- | | scrollTo | Scroll | options: `number \| {left?: number;top?: number}`
y: `number` | - | | | scrollTop | Vertical scroll | top: `number` | - | 2.40.0 | | scrollLeft | Horizontal scroll | left: `number` | - | 2.40.0 | ### Type definitions The component exports the following types ```ts import type { ScrollbarBoxInstance } from '@cedar-design/ui' ``` --- Document: llms/en-US/components/search.md # Search Search submits keywords and controlled field models. The application handles requests and loading. ## Basic examples ### Basic usage Enter a keyword and press Enter. The first example has one input and one submitted value. Example source: src/search/__demos__/en-US/basic.vue ```vue ``` ## Data and options ### Search button #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------- | ---------------------------------------- | ---------------------------------------------- | | `placeholder` | Placeholder | Search button, With Fields, Controlled history | | `search-button` | Whether to show the shared search button | Search button, With Fields | | `recent-searches` | Controlled search history | With Fields, Controlled history | | `button-text` | Shared search button text | Search button | | `fields` | Search field options | With Fields | | `select-style` | Field selector style | With Fields | Example source: src/search/__demos__/en-US/search-button.vue ```vue ``` ### With Fields Example source: src/search/__demos__/with-fields.vue ```vue ``` ### Controlled history Example source: src/search/__demos__/local-storage.vue ```vue ``` ## Customization and slots ### History presentation and slots #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------- | --------------------------------------------------------------------------------------- | ------------------------------ | | `edit-mode` | Search editing mode: direct searches in place; popup opens the search editor in a popup | History presentation and slots | | `recent-searches` | Controlled search history | History presentation and slots | | `label` | Text to the left of the search input | History presentation and slots | | `placeholder` | Placeholder | History presentation and slots | | `clearable` | Whether the value can be cleared | History presentation and slots | | `show-action` | Whether to show the mobile action | History presentation and slots | Example source: src/search/__demos__/en-US/presentation.vue ```vue ``` ### Functional playground ## Interaction and control ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | -------------------------------------------------- | -------------------------- | | `placeholder` | Placeholder | State Lab, Loading | | `loading` | Loading state; submission is blocked while loading | State Lab, Loading | | `readonly` | Whether readonly | State Lab, Loading | | `search-button` | Whether to show the shared search button | Loading, Controlled Fields | | `disabled` | Whether disabled | State Lab | | `default-value` | Uncontrolled default keyword | Loading | Example source: src/search/__demos__/state-lab.vue ```vue ``` ### Loading - `readonly`: Displays the current value without allowing edits. Example source: src/search/__demos__/loading.vue ```vue ``` ### Controlled Fields Example source: src/search/__demos__/en-US/controlled-fields.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Arguments | Description | Type | Default | | -------------------------- | --------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------- | | `v-model` | Search keyword | _string_ | `-` | | `default-value` | Uncontrolled default keyword | _string_ | `''` | | `v-model:model-field` | Current search field | _string_ | `-` | | `default-field` | Uncontrolled default field | _string_ | `-` | | `v-model:model` | Object updated by field in field-search mode | _Record_ | `-` | | `fields` | Search field options | _SearchField[]_ | `[]` | | `select-style` | Field selector style | _StyleValue_ | `-` | | `recent-searches` | Controlled search history | _string[]_ | `[]` | | `max-search-history-count` | Maximum items in the next history list | _number_ | `5` | | `edit-mode` | Search editing mode: direct searches in place; popup opens the search editor in a popup | `'direct' \| 'popup'` | `'direct'` | | `search-button` | Whether to show the shared search button | _boolean_ | `false` | | `button-text` | Shared search button text | _string_ | `-` | | `button-props` | Shared search button props | _ButtonProps_ | `-` | | `loading` | Loading state; submission is blocked while loading | _boolean_ | `false` | | `clearable` | Whether the value can be cleared | _boolean_ | `false` | | `variant` | Input variant: `filled`, `outline`, or `standard` | _string_ | `outline` | | `size` | Input size inherited from Form / ConfigProvider | `xs / sm / md / lg / xl` | `md` | | `placeholder` | Placeholder | _string_ | `-` | | `disabled` | Whether disabled | _boolean_ | `false` | | `readonly` | Whether readonly | _boolean_ | `false` | | `label` | Text to the left of the search input | _string_ | `-` | | `shape` | Inner field shape: `round` or `square` | _string_ | `square` | | `background` | Outer background color | _string_ | `-` | | `input-background` | Inner field background color | _string_ | `-` | | `show-action` | Whether to show the mobile action | _boolean_ | `false` | | `action-text` | Action button text | `string` | Follows global locale and action-type | | `action-type` | Action type: `cancel` or `search` | _string_ | `cancel` | | `search-icon` | Search icon name | _string_ | `magnify` | | `max-length` | Maximum length | _string \| number_ | `-` | | `enterkeyhint` | Virtual keyboard Enter hint | _string_ | `search` | ### Events | Event | Description | Callback arguments | | ------------------- | -------------------------------------------------------- | ------------------------------------ | | `update:modelValue` | Emitted when the keyword updates | `value: string` | | `update:modelField` | Emitted when the field updates | `field: string` | | `update:model` | Emitted when the field model updates | `model: Record` | | `input` | Emitted during live editing | `value: string, event: Event` | | `change` | Emitted on blur, Enter commit, or field change | `value: string, event: Event` | | `clear` | Emitted when clearing | `event: Event` | | `search` | Emitted by the icon, button, Enter, or history selection | `result: SearchResult, event: Event` | | `focus` | Emitted on focus | `event: FocusEvent` | | `blur` | Emitted on blur | `event: FocusEvent` | | `cancel` | Emitted by the mobile cancel action | `event: Event` | ### Slots | Name | Description | Arguments | | ---------------- | ---------------------------------------------- | ----------- | | `prefix` | Input prefix; replaces the default search icon | `-` | | `suffix` | Input suffix | `-` | | `clear-icon` | Clear icon | `{ clear }` | | `button-default` | Shared search button content | `-` | | `button-icon` | Shared search button icon | `-` | | `label` | Left label | `-` | | `action` | Action content | `-` | ### Methods | Method | Description | Arguments | Returns | | ------- | ----------- | --------- | ------- | | `focus` | Focus | `-` | `-` | | `blur` | Blur | `-` | `-` | ### SearchField | Arguments | Description | Type | | ------------- | --------------------------------------------------- | -------- | | `label` | Field label | _string_ | | `value` | Field value | _string_ | | `placeholder` | Field `placeholder`; overrides Search `placeholder` | _string_ | ### SearchResult | Arguments | Description | Type | | ---------------- | ------------------- | -------------------------------------- | | `modelField` | Search field | _string \| undefined_ | | `modelValue` | Raw search keyword | _string_ | | `model` | Field model object | _Record \| undefined_ | | `recentSearches` | Next search history | _string[]_ | Input event contract: editing emits `input` before `update:modelValue`; committing on blur emits `change` only for a changed value. Clearing emits `clear → input → update:modelValue → change` once, updates the search field model once, and does not submit a search. input fires before model updates. Enter waits for Input submission and controlled-value reconciliation before producing search results. If the parent rejects a trim proposal, search still uses the actual controlled value. Clearing notifies clear → input → update:modelValue → change without automatically searching. ## Controlled-model protocol Value precedence is `modelValue` > `model`[current field] > uncontrolled `defaultValue`. With `model` and a current field, missing/null values display an empty string. Keep simultaneously bound models consistent in the parent. `modelField` overrides `defaultField` and the first field. Internal logic never forcibly overrides controlled values. `model` is not mutated in place. Every logical update emits a new `update:model` object, clearing other declared fields while retaining undeclared properties. Use `v-model:model` or explicitly accept proposals. Switching fields produces one `update:modelField → update:modelValue → update:model → change` sequence. Parents can reject proposals. Enter/button/history searches wait one update cycle, then read the actually accepted field, keyword and `model`. History is neither filtered by current input nor persisted internally. New history returned by `search` is trimmed, emptied entries removed, deduplicated and limited to the configured maximum. Empty keywords are not added. Nonfinite/negative limits are treated as 0. Clearing does not `search`; cancel proposes an empty string and emits cancel/change without searching. Editing emits `input → update:modelValue`; changed commits emit `change`. Clear emits `clear → input → update:modelValue → change` once. Disabled, readonly and loading block search, cancel, history and field actions. Form / FormItem / InputGroup state is inherited. Deactivation or unmount cancels pending asynchronous search. ### Platform boundaries The controller, public API and history content are independently copied. Both default to `presentation=inline`; Cedar defaults to `shape=square` and Maple to `shape=round`. Fullscreen history uses local Drawer / Popup instances. Desktop InputGroup and mobile search-bar layout/touch spacing remain independent. Input supports `xs/sm/md/lg/xl`; outer bar density is configured by Search tokens rather than scaled by size. ### Public types `SearchPresentation`、`SearchProps`, `SearchEmits`, `SearchSlots`, `SearchExpose`, `SearchField`, `SearchResult`. ### Forwarded Input props Explicit Input props include `modelModifiers`, `type`, `ariaLabel`, `placeholder`, `maxLength`, `readonly`, `disabled`, `autofocus`, `enterkeyhint`, `textColor`, `focusColor`, `blurColor`, `size`, `variant`, `clearable`, `inputAttrs` and `error`. `inputAttrs` carries native name/autocomplete/ARIA attributes to both outer and fullscreen Input; `error` overrides inherited `error` state. Search actions, popup cancellation and dialog labels follow the global locale. Programmatic cancel, field and history selection notify Form change once; native edits retain the Input event pipeline. ## Configuring the cleared value `empty-value` / `emptyValue` sets the model value produced by clearing. It accepts a value in the component model type or a zero-argument factory. Omission preserves the existing default; use `() => undefined` to distinguish omission from returning undefined. Arrays are shallow-copied on every clear; selected items that cannot be cleared remain. It does not redefine emptiness, alter Form reset defaults or treat 0/false as universally empty. Text and person-ID models remain strings; use an empty string or a business-defined string sentinel. --- Document: llms/en-US/components/segmented.md # Segmented Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `options`: Options Example source: src/segmented/__demos__/basic.vue ```vue ``` ## Appearance and states ### Segment sizes and disabled states #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `size` | Size | Segment sizes and disabled states | | `options` | Action list | Segment sizes and disabled states | | `disabled` | Disable interaction | Segment sizes and disabled states | | `default-value` | Uncontrolled default value | Segment sizes and disabled states | Compare density at each size and disabled-option behavior. Example source: src/segmented/__demos__/appearance-state-comparison.vue ```vue ``` ## Layout and arrangement ### Block #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `block` | Fill parent width | Block | | `options` | Action list | Block | - `block`: Fit parent width - `options`: Options Example source: src/segmented/__demos__/block.vue ```vue ``` ## Interaction and control ### Controlled - `model-value`: Binding value - `options`: Options Example source: src/segmented/__demos__/controlled.vue ```vue ``` ## Accessibility - The root uses `role="radiogroup"`; native `radio` options support keyboard changes. - `name` binds a native form field `name`. - Whole-control disabling sets `aria-disabled`. ## API ### Segmented Props | Arguments | Description | Type | Default | | --- | --- | --- | --- | | model-value / v-model | Current value | `string \| number` | — | | default-value | Uncontrolled default value | `string \| number` | — | | options | Action list | `(string \| number \| SegmentedOption)[]` | `[]` | | size | Size | `xs \| sm \| md \| lg \| xl` | `md` | | disabled | Disable interaction | `boolean` | `false` | | block | Fill parent width | `boolean` | `false` | | orientation | Horizontal/vertical arrangement of segmented options, default horizontal; not text reading direction | `horizontal \| vertical` | `horizontal` | | name | Native name | `string` | — | ### SegmentedOption | Field | Description | Type | | --- | --- | --- | | label | Label | `string \| () => VNodeChild` | | value | Value | `string \| number` | | disabled | Disable this item | `boolean` | ### Segmented Events | Event | Description | Arguments | | --- | --- | --- | | change | Value change | `(value, event)` | | update:model-value | v-model | `(value)` | ### Segmented Slots | Slot | Description | Arguments | | --- | --- | --- | | label | Custom option content | `{ data: SegmentedOption }` | --- Document: llms/en-US/components/select.md # Select Single or multiple selection with array options, controlled values and shared field presentation. ## Reading direction Select inherits source `dir`. Standalone fields align to inline start; FormItem content-align still takes precedence when inherited. Explicit left/right alignment remains physical. Tags keep their array order and empty-search Backspace removes the last closable value. Dropdowns and picker panels retain source direction, including in a custom popup-container. ## Async arrays and clearing useAsyncData is a public composable exported by @cedar-design/use. Pass a loader to that composable and bind its data/loading to Select. Options remain arrays. An initialization call is per owner; share a parent result to avoid duplicate loading. empty-value sets the single-selection clear result. Omitted preserves the existing behavior: empty string unless an empty-string option exists, in which case clearing may produce undefined. The event types include undefined. Multiple selection keeps its array semantics and cannot clear disabled selected options. case-sensitive defaults to false. search-fields defaults to ['label']; ['value', 'label'] matches either field. Custom filters retain priority. | Variable | Default | | ------------------------------------- | ----------------------------------- | | `--c-select-popup-option-check-color` | `var(--c-sys-color-action-primary)` | | `--c-select-popup-option-check-size` | `var(--c-sys-font-size-md)` | | `--c-select-popup-option-check-gap` | `var(--c-sys-space-4)` | ## Basic examples ### Basic Example source: src/select/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------- | -------------------------------------------------- | | `options` | Primitive, object or grouped options; one source for every presentation | Appearance configuration comparison, Control Sizes | | `clearable` | Allow clearing; preserve disabled selections | Appearance configuration comparison, Control Sizes | | `size` | Supports all five sizes; inherits group/form settings | Control Sizes | | `variant` | filled, outline, standard; inherits InputGroup | Control Sizes | | `placeholder` | Placeholder | Control Sizes | | `multiple` | Multiple selection; enables search by default | Control Sizes | Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/select/__demos__/appearance-lab.vue ```vue ``` ### Control Sizes Example source: src/field-decorator/__demos__/control-sizes.vue ```vue ``` ## Selection modes and options ### Multiple #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------- | ------------------------------------ | | `placeholder` | Placeholder | Multiple, Same Label, Optgroup | | `multiple` | Multiple selection; enables search by default | Multiple, Same Label, Optgroup | | `clearable` | Allow clearing; preserve disabled selections | Multiple, Same Label, Options Review | | `filterable` | Enable search; optionally retainInputValue | Same Label, Options Review | | `options` | Primitive, object or grouped options; one source for every presentation | Same Label, Group Spacing | | `scrollbar` | Whether to enable virtual scroll bar | Multiple | Example source: src/select/__demos__/multiple.vue ```vue ``` ### Same Label Example source: src/select/__demos__/same-label.vue ```vue ``` ### Optgroup Example source: src/select/__demos__/optgroup.vue ```vue ``` ### Group Spacing Example source: src/select/__demos__/group-spacing.vue ```vue ``` ### Options Review Example source: src/select/__demos__/options-review.vue ```vue ``` ### Allow Create Example source: src/select/__demos__/allow-create.vue ```vue ``` ### Fallback Option Example source: src/select/__demos__/fallback-option.vue ```vue ``` ## Search and filtering ### Filterable #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ---------------- | ----------------------------------------------------------------------- | -------------------------------------------- | | `placeholder` | Placeholder | Filterable, Search Matching, Dropdown Scroll | | `options` | Primitive, object or grouped options; one source for every presentation | Filterable, Search Matching, Virtual List | | `filterable` | Enable search; optionally retainInputValue | Filterable, Search Matching | | `loading` | Loading state; blocks selection and confirmation | Filterable | | `multiple` | Multiple selection; enables search by default | Filterable | | `case-sensitive` | Case-sensitive built-in filtering; custom filters take priority | Search Matching | Example source: src/select/__demos__/filterable.vue ```vue ``` ### Search Matching Example source: src/select/__demos__/search-matching.vue ```vue ``` ### Dropdown Scroll Example source: src/select/__demos__/dropdown-scroll.vue ```vue ``` ### Virtual List Example source: src/select/__demos__/virtual-list.vue ```vue ``` ## Content and dropdown customization ### Tag Props #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ----------------------------------------------------------------------- | --------------------------------------- | | `placeholder` | Placeholder | Tag Props, Custom Header, Custom Footer | | `multiple` | Multiple selection; enables search by default | Tag Props, Custom Header, Slots Review | | `options` | Primitive, object or grouped options; one source for every presentation | Tag Props, Slots Review | | `filterable` | Enable search; optionally retainInputValue | Custom Footer, Slots Review | | `clearable` | Allow clearing; preserve disabled selections | Slots Review | Example source: src/select/__demos__/tag-props.vue ```vue ``` ### Custom Header Example source: src/select/__demos__/custom-header.vue ```vue ``` ### Custom Footer Example source: src/select/__demos__/custom-footer.vue ```vue ``` ### Custom Label Example source: src/select/__demos__/custom-label.vue ```vue ``` ### Slots Review Example source: src/select/__demos__/slots-review.vue ```vue ``` ## Value model and linked fields ### Selection Data Flow #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | `options` | Primitive, object or grouped options; one source for every presentation | Selection Data Flow, Linkage, Empty recognition and clear output | | `clearable` | Allow clearing; preserve disabled selections | Empty recognition and clear output, Interaction state comparison | | `edit-mode` | Field presentation; inherits FormItem/Form when omitted | Selection Data Flow | | `default-active-first-option` | On opening, activate the first enabled candidate if no valid selected option exists. Highlighting does not update modelValue or emit change; an existing valid selection takes priority | Selection Data Flow | | `placeholder` | Placeholder | Selection Data Flow | | `empty-value` | Clear output override; return an array for multiple selection and preserve protected items | Empty recognition and clear output | Example source: src/select/__demos__/selection-data-flow.vue ```vue ``` ### Linkage Example source: src/select/__demos__/linkage.vue ```vue ``` ### Empty recognition and clear output This example keeps an empty string as the valid All option and clears to null. Compare the selected All option with the cleared state in the model output. Deleting the search query does not remove the selected value. The additional fields show multiple selection clearing to [] and a factory explicitly producing undefined, each with its own model output. Example source: src/select/__demos__/en-US/empty-value.vue ```vue ``` ### Interaction state comparison Toggle disabled, read-only and error states, then interact with the same instance. Recovery controls remain outside the target; error appearance alone does not validate data. Example source: src/select/__demos__/state-lab.vue ```vue ``` ## Async data and search ### Loading #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ----------------------------------------------------------------------- | --------------------------------------- | | `loading` | Loading state; blocks selection and confirmation | Loading, Search, Async Devices | | `options` | Primitive, object or grouped options; one source for every presentation | Search, Async Devices, Async Source | | `placeholder` | Placeholder | Loading, Search, Async Devices | | `filterable` | Enable search; optionally retainInputValue | Async Devices, Async Source, Async Data | | `multiple` | Multiple selection; enables search by default | Search, Async Devices | | `filter-option` | false disables local filtering; callback receives query and raw option | Search | Example source: src/select/__demos__/loading.vue ```vue ``` ### Search Example source: src/select/__demos__/search.vue ```vue ``` ### Async Devices Example source: src/select/__demos__/async-devices.vue ```vue ``` ### Async Source Example source: src/select/__demos__/async-source.vue ```vue ``` ### Async Data Example source: src/select/__demos__/en-US/async-data.vue ```vue ``` ## Configuration and lifecycle ### Passthrough Options #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | | `options` | Primitive, object or grouped options; one source for every presentation | Passthrough Options, Scheduler Lifecycle, Copying and editing | | `edit-mode` | Field presentation; inherits FormItem/Form when omitted | Passthrough Options, Copying and editing | | `trigger-props` | Optional dropdown Trigger settings. Placement defaults to bottom-start and automatically adjusts when space is limited. The field owns open state; there is no top-level placement prop | Passthrough Options | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | Copying and editing | | `filterable` | Enable search; optionally retainInputValue | Copying and editing | Example source: src/select/__demos__/passthrough-options.vue ```vue ``` ### Select | Prop | Description | Type | Default | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------- | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value / default-value` | Controlled value / uncontrolled initial value | `Value` | `Single: ''; multiple: []` | | `open / default-open` | Controlled / initial open state | `boolean` | `undefined / false` | | `input-value / default-input-value` | Search text, independent of selected values | `string` | `undefined / ''` | | `multiple` | Multiple selection; enables search by default | `boolean` | `false` | | `size` | Supports all five sizes; inherits group/form settings | `ComponentSize` | `md` | | `variant` | filled, outline, standard; inherits InputGroup | `FormControlVariant` | `filled` | | `disabled / readonly / error` | Inherits form state unless explicitly overridden | `boolean` | `undefined` | | `placeholder` | Placeholder | `string` | `—` | | `hint / line` | Floating hint / standard variant underline | `boolean` | `true` | | `text-color / focus-color / blur-color` | Field colors | `string` | `—` | | `loading` | Loading state; blocks selection and confirmation | `boolean` | `false` | | `show-tags` | Show tags; false displays separated text | `boolean` | `true` | | `separator` | Separator when show-tags=false | `string` | `,` | | `text-align` | Value alignment: left / center / right. Inherits FormItem content-align when omitted; defaults to inline start outside forms. | `'left' \| 'center' \| 'right'` | `-` | | `max-tag-count` | Maximum visible tags; 0 means unlimited | `number` | `0` | | `tag-nowrap` | Keep tags on one line with ellipsis and preserved removal icons; overflow scrolls horizontally; hover, focus or tap truncated text to preview it | `boolean` | `false` | | `popup-container` | Selector, element, element resolver, or false for inline rendering | `PopupContainer` | `—` | | `trigger-props` | Optional dropdown Trigger settings. Placement defaults to bottom-start and automatically adjusts when space is limited. The field owns open state; there is no top-level placement prop | `TriggerProps` | `—` | | `virtual-list-props` | Pass the virtual list attribute, pass in this parameter to turn on virtual scrolling [VirtualListProps](#VirtualListProps) | `VirtualListProps` | `—` | | `search-delay` | Search debounce delay in ms | `number` | `500` | | `format-label` | Format selected labels; use label slot for VNodes | `function` | `—` | | `clearable` | Allow clearing; preserve disabled selections | `boolean` | `true` | | `empty-value` | Clear output override; return an array for multiple selection and preserve protected items | `SelectEmptyValue` | `undefined` | | `options` | Primitive, object or grouped options; one source for every presentation | `SelectOption[]` / `(query, { signal }) => Array / Promise` | `undefined` | | `field-names` | Map value, label, disabled, tagProps, render; object values need a unique ID field | `SelectFieldNames` | `—` | | `filterable` | Enable search; optionally retainInputValue | `boolean or { retainInputValue?: boolean }` | `Single: false / multiple: true` | | case-sensitive | Case-sensitive built-in filtering; custom filters take priority | boolean | false | | `filter-option` | false disables local filtering; callback receives query and raw option | `boolean or (input, option) => boolean` | automatic: arrays on; loader off | | `creatable` | Allow creating missing options | `boolean` | `false` | | `fallback-option` | Display unresolved values or return a complete fallback option | `boolean or (value) => SelectOptionData` | `true` | | `show-extra-options` | Display fallback/created options in the panel | `boolean` | `true` | | `limit` | Selection limit; 0 means unlimited | `number` | `0` | | `auto-fit-popup-width` | Match Menu width to the field | `boolean` | `true` | | `default-active-first-option` | On opening, activate the first enabled candidate if no valid selected option exists. Highlighting does not update modelValue or emit change; an existing valid selection takes priority | `boolean` | `true` | | `unmount-on-close` | Unmount Menu content when closed | `boolean` | `false` | | `scrollbar` | Whether to enable virtual scroll bar | `boolean or ScrollbarProps` | `true` | | `show-header-on-empty / show-footer-on-empty` | Display header/footer in empty state | `boolean` | `false` | | `edit-mode` | Field presentation; inherits FormItem/Form when omitted | `direct / click / dblclick` | `direct` | | `before-commit` | Asynchronous before-commit hook after validation | `(value, context) => void / false / Promise` | — | ### Option Props | Prop | Description | Type | Default | | --------- | ----------------------------------------------------------- | ------------------------------------------------------ | --------- | | value | Option Value | string \| number \| boolean \| Record | undefined | | label | Option group title | string | undefined | | disabled | Whether to disable | boolean | false | | tag-props | Props of the multi-select label corresponding to the option | TagProps | undefined | | index | Explicit option order | number | undefined | ### Option Slots | Slot | Description | Arguments | | ------- | --------------------- | --------------------- | | default | Custom option content | { selected: boolean } | | icon | Option icon | - | | suffix | Option suffix | - | ### Optgroup Props | Prop | Description | Type | Default | | ----- | ------------------ | ------ | --------- | | label | Option group title | string | undefined | ### Optgroup Slots | Slot | Description | Arguments | | ------- | ----------------------------- | --------- | | label | Option group title | - | | default | Option children in this group | - | ### Select Slots | Slot | Description | Arguments | | ------------ | --------------------------------------- | --------------- | | default | Option or Optgroup children | - | | option | Custom option content | { data } | | label | Option group title | { data } | | selected | Replace the whole selected-value region | - | | header | Menu header | - | | footer | Menu footer | - | | trigger | Custom field trigger | - | | prefix | Field prefix | - | | suffix | Field suffix | - | | clear-icon | Custom clear action | { clear } | | arrow-icon | Dropdown arrow | - | | search-icon | Search icon | - | | loading-icon | Loading icon | - | | empty | Empty-state content | - | | read | Read-mode content | { value, text } | ### Select Events | Event | Description | Arguments | | --------------------- | -------------------------------------------------------- | ------------ | | update:model-value | Request a model value update | value | | change | Option | value | | update:open | Request popup visibility | open | | open-change | Popup visibility changes | open | | update:input-value | Request search text update | text | | input-value-change | Search text changes | text | | search | Triggered when the user searches | text | | focus | Focus enters the field | event | | blur | Focus leaves the field | event | | clear | Triggered when the value of the input changes | event | | remove | Triggered when the delete button of the label is clicked | value | | exceed-limit | Selection would exceed the multiple-selection limit | value, event | | dropdown-scroll | Menu scrolls | event | | dropdown-reach-bottom | Menu reaches its bottom | event | ### Select Methods | Method | Description | Arguments | | ------ | ---------------------- | --------- | | focus | Focus the actual field | - | | blur | Blur the actual field | - | ### Scheduler Lifecycle Example source: src/select/__demos__/scheduler-lifecycle.vue ```vue ``` ### Api Review ### Copying and editing With open-trigger-target="icon", use the input area to edit or copy and the suffix button to open. Existing text remains copyable when editing or search is disabled. Example source: src/select/__demos__/open-trigger-target.en-US.vue ```vue ``` ### Shared field loading `loading` displays the shared field indicator. `loading-mode` is `default` (indicator) or `line` (an indeterminate bottom line); it defaults to `default`. Rendering belongs to FieldDecorator. Loading does not implicitly disable editing or change readonly. Set those states separately. ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. Selected rows show a primary-colored right-side checkmark in both single/multiple modes; candidate highlighting alone does not. In click/dblclick editors, checkmarks reflect draft selection, committed to Form only on confirmation. Disabled selected items retain disabled appearance. ### Cleared values and 1.x compatibility `SelectValue` includes `undefined`. By default, single-select clear emits `''`; if the current options contain a `value: ''` option, it emits `undefined` to distinguish clearing from selecting that option. This published behavior is preserved. Both `change` and `update:modelValue` use `SelectValue`. `empty-value` defines clear output; omission preserves the existing fallback. Single selection can use `() => undefined` to explicitly return undefined; multiple selection should return an array matching its model shape. Protected disabled selections take priority and prevent the clear override from running. Controlled mode still requires parent acceptance. Root and component entries export `SelectValue` and `SelectEmptyValue`. ### Select props Use `v-model`, `v-model:open` and `v-model:input-value` for controlled state. Clear values are `''` for single selection and `[]` for multiple selection. Select uses `undefined` when an actual empty-string option exists. | Prop | Description | Type | Default | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | | `open-trigger-target` | Pointer opening target: the whole field or only the suffix icon. Explicit keyboard opening and controlled open remain available. | `'field' \| 'icon'` | `'field'` | | `model-value / default-value` | Controlled value / uncontrolled initial value | `Value` | `Single: ''; multiple: []` | | `open / default-open` | Controlled / initial open state | `boolean` | `undefined / false` | | `input-value / default-input-value` | Search text, independent of selected values | `string` | `undefined / ''` | | `multiple` | Multiple selection; enables search by default | `boolean` | `false` | | `size` | Supports all five sizes; inherits group/form settings | `ComponentSize` | `md` | | `variant` | filled, outline, standard; inherits InputGroup | `FormControlVariant` | `filled` | | `disabled / readonly / error` | Inherits form state unless explicitly overridden | `boolean` | `undefined` | | `placeholder` | Placeholder | `string` | `—` | | `hint / line` | Floating hint / standard variant underline | `boolean` | `true` | | `text-color / focus-color / blur-color` | Field colors | `string` | `—` | | `loading` | Loading state; blocks selection and confirmation | `boolean` | `false` | | `loading-mode` | Loading layout: default indicator or bottom line | `default / line` | `default` | | `show-tags` | Show tags; false displays separated text | `boolean` | `true` | | `separator` | Separator when show-tags=false | `string` | `,` | | `text-align` | Text alignment: left / center / right. Inherits FormItem content-align when unset; standalone fields default to inline start | `'left' \| 'center' \| 'right'` | `-` | | `max-tag-count` | Maximum visible tags; 0 means unlimited | `number` | `0` | | `tag-nowrap` | Keep tags on one line with ellipsis and preserved removal icons; overflow scrolls horizontally; hover, focus or tap truncated text to preview it | `boolean` | `false` | | `popup-container` | Selector, element, element resolver, or false for inline rendering | `PopupContainer` | `—` | | `trigger-props` | Optional dropdown Trigger settings. Placement defaults to bottom-start and automatically adjusts when space is limited. The field owns open state; there is no top-level placement prop | `TriggerProps` | `—` | | `virtual-list-props` | Pass the virtual list attribute, pass in this parameter to turn on virtual scrolling [VirtualListProps](#VirtualListProps) | `VirtualListProps` | `—` | | `search-delay` | Search debounce delay in ms | `number` | `500` | | `format-label` | Format selected labels; use label slot for VNodes | `function` | `—` | | `clearable` | Allow clearing; preserve disabled selections | `boolean` | `true` | | `empty-value` | Clear output override; return an array for multiple selection and preserve protected items | `SelectEmptyValue` | `undefined` | | `options` | Primitive, object or grouped options; one source for every presentation | `SelectOption[]` / `(query, { signal }) => Array / Promise` | `undefined` | | `field-names` | Map value, label, disabled, tagProps, render; object values need a unique ID field | `SelectFieldNames` | `—` | | `filterable` | Enable search; optionally retainInputValue | `boolean or { retainInputValue?: boolean }` | `Single: false; multiple: true` | | case-sensitive | Case-sensitive built-in filtering; custom filters take priority | boolean | false | | `filter-option` | false disables local filtering; callback receives query and raw option | `boolean or (input, option) => boolean` | Automatic: enabled for arrays, disabled for loader functions | | `creatable` | Allow creating missing options | `boolean` | `false` | | `fallback-option` | Display unresolved values or return a complete fallback option | `boolean or (value) => SelectOptionData` | `true` | | `show-extra-options` | Display fallback/created options in the panel | `boolean` | `true` | | `limit` | Selection limit; 0 means unlimited | `number` | `0` | | `auto-fit-popup-width` | Match Menu width to the field | `boolean` | `true` | | `default-active-first-option` | On opening, activate the first enabled candidate if no valid selected option exists. Highlighting does not update modelValue or emit change; an existing valid selection takes priority | `boolean` | `true` | | `unmount-on-close` | Unmount Menu content when closed | `boolean` | `false` | | `scrollbar` | Whether to enable virtual scroll bar | `boolean or ScrollbarProps` | `true` | | `show-header-on-empty / show-footer-on-empty` | Display header/footer in empty state | `boolean` | `false` | | `edit-mode` | Field presentation; inherits FormItem/Form when omitted | `direct / click / dblclick` | `direct` | | `before-commit` | Asynchronous before-commit hook after validation | `(value, context) => void / false / Promise` | — | ### Events and methods - `update:modelValue`, `change(value)`: emitted on commit, not while editing a draft. - `update:open`, `open-change(open)`: request an expanded-state change. - `update:inputValue`, `input-value-change(text)`, `search(text)`: search state. - `focus(event)`, `blur(event)`, `clear(event)`: native field events; only the field owner notifies Form. - Methods: `focus()`, `blur()`. Select also emits `remove(value)`, `exceed-limit(value, event)`, `dropdown-scroll(event)`, and `dropdown-reach-bottom(event)`. ### Slots and option data Use `label({ data })` for custom `selected` labels; `selected` replaces the whole selection area. Also supports `prefix`, `suffix`, `clear-icon({ clear })`, `arrow-icon`, `loading-icon`, `search-icon`, `empty`, and `option({ data })`. Option `label` is searchable plain text. Use `render` or the `option` slot for custom `option` content, and `format-label` or `label` slot for selected content. Values identify selections; labels never do. `disabled` blocks selection/removal, and `tagProps` customizes selected tags. Select additionally supports `header`, `footer`, `trigger`, and default `Option / Optgroup` children. Option props: `value`, `label`, `disabled`, `tagProps`, `index`; its default slot receives `selected`. Group data uses `{ isGroup: true, label, options }`. List and Picker also accept slot options; Picker displays their text labels. Single/multiple options both use popup-option-padding-horizontal. There is no implicit search-highlight DOM; custom option slots style their own highlighted fragments. Unused multi-popup-option-padding-horizontal and popup-option-highlight-* variables are removed. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. ### Option Props | Prop | Description | Type | Default | | --------- | ----------------------------------------------------------- | ------------------------------------------------------ | --------- | | value | Option Value | string \| number \| boolean \| Record | undefined | | label | Option group title | string | undefined | | disabled | Whether to disable | boolean | false | | tag-props | Props of the multi-select label corresponding to the option | TagProps | undefined | | index | Explicit option order | number | undefined | ### Option Slots | Slot | Description | Arguments | | ------- | --------------------- | --------------------- | | default | Custom option content | { selected: boolean } | | icon | Option icon | - | | suffix | Option suffix | - | ### Optgroup Props | Prop | Description | Type | Default | | ----- | ------------------ | ------ | --------- | | label | Option group title | string | undefined | ### Optgroup Slots | Slot | Description | Arguments | | ------- | ------------------------------ | --------- | | label | Option group title | - | | default | Option children inside a group | - | ### Select Slots | Slot | Description | Arguments | | ------------ | --------------------------------------- | --------------- | | default | Option / Optgroup children | - | | option | Custom option content | { data } | | label | Option group title | { data } | | selected | Replace the whole selected-value region | - | | header | Menu header | - | | footer | Menu footer | - | | trigger | Custom field trigger | - | | prefix | Field prefix | - | | suffix | Field suffix | - | | clear-icon | Custom clear action | { clear } | | arrow-icon | Dropdown arrow | - | | search-icon | Search icon | - | | loading-icon | Loading icon | - | | empty | Empty-state content | - | | read | Read-mode content | { value, text } | ### Select Events | Event | Description | Arguments | | --------------------- | -------------------------------------------------------- | ------------ | | update:model-value | Request a model value update | value | | change | Option | value | | update:open | Request popup visibility | open | | open-change | Popup visibility changes | open | | update:input-value | Request search text update | text | | input-value-change | Search text changes | text | | search | Triggered when the user searches | text | | focus | Field gains focus | event | | blur | Field loses focus | event | | clear | Triggered when the value of the input changes | event | | remove | Triggered when the delete button of the label is clicked | value | | exceed-limit | Selection would exceed the multiple-selection limit | value, event | | dropdown-scroll | Menu scrolls | event | | dropdown-reach-bottom | Menu reaches its bottom | event | ### Select Methods | Method | Description | Arguments | | ------ | ---------------------- | --------- | | focus | Focus the actual field | - | | blur | Blur the actual field | - | ### Selected-checkmark style variables | Variable | Default | | ------------------------------------- | ----------------------------------- | | `--c-select-popup-option-check-color` | `var(--c-sys-color-action-primary)` | | `--c-select-popup-option-check-size` | `var(--c-sys-font-size-md)` | | `--c-select-popup-option-check-gap` | `var(--c-sys-space-4)` | ### Public type exports Root and component entries export `SelectEmits`、`SelectSlots`、`SelectExpose` alongside Props and Instance. Emits are event argument tuples derived from the runtime validators; Expose contains focus/blur. ### Built-in search fields `searchFields` / `search-fields` is a readonly `('label' | 'value')[]`, defaulting to `['label']`. Multiple fields use OR matching, case-insensitive by default. `['value', 'label']` searches codes and names; fieldNames maps semantic fields to business fields. An empty array matches no items for a nonempty query. Values are compared as strings; object traversal, object values and pinyin matching require a custom callback. A custom callback takes precedence and decides case handling itself. Remote results use the existing protocol for disabling local filtering. Cascader retains path semantics and checks the configured fields on each path node. ## Loading options through a function prop Pass options(query, { signal }) directly; useAsyncData is unnecessary. options still accepts arrays, and an explicit array, including [], takes precedence. The component manages loading, stale-result isolation and cancellation. load-error reports failures, and the instance refresh() method retries. A business loader may accept only query and ignore the second argument. filterable enables entering a search query. filterOption controls only local matching and never sends requests. With an options loader, remote results are not filtered again by default; with only an array, local matching is enabled by default. Most callers do not need filter-option. ```vue ``` `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. --- Document: llms/en-US/components/skeleton.md # Skeleton Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `:loading="loading"`. Example source: src/skeleton/__demos__/basic.vue ```vue ``` ## Content and presentation ### Skeleton content shapes #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Whether to show a title placeholder | Skeleton content shapes, Animation | | `loading` | Whether to display the loading skeleton | Skeleton content shapes, Fullscreen | | `avatar` | Whether to show an avatar placeholder | Skeleton content shapes, Animation | | `rows` | The paragraph number of rows | Skeleton content shapes | | `rows-width` | Width of each row | Skeleton content shapes | | `card` | Whether to show a card placeholder | Skeleton content shapes | Compare text-row placeholders with avatar and card shapes according to the final content layout. Example source: src/skeleton/__demos__/content-comparison.vue ```vue ``` ### Animation Preview configuration: `title`, `avatar`, `:animation="animation"`. Example source: src/skeleton/__demos__/animation.vue ```vue ``` ### Fullscreen Preview configuration: `fullscreen`, `:loading="loading"`. Example source: src/skeleton/__demos__/fullscreen.vue ```vue ``` ## Customization and slots ### Custom Template Preview configuration: `:rows="3"`, `:widths="['100%', '100%', '60%']"`, `shape="circle"`. Example source: src/skeleton/__demos__/custom-template.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ------------------ | ---------------------------- | ------------------------- | :-----: | | loading | Whether to display the loading skeleton | `boolean` | `true` | | animation | Whether skeleton animation is enabled | `boolean` | `true` | | title | Whether to show a title placeholder | `boolean` | `false` | | avatar | Whether to show an avatar placeholder | `boolean` | `false` | | card | Whether to show a card placeholder | `boolean` | `false` | | rows | The paragraph number of rows | `number \| string` | `3` | | rows-width | Width of each row | `Array` | `[]` | | title-width | `50%` | `number \| string` | `-` | | avatar-size | `34px` | `number \| string` | `-` | | card-height | `160px` | `number \| string` | `-` | | fullscreen | Whether to use a fullscreen placeholder | `boolean` | `false` | | fullscreen-z-index | Fullscreen placeholder stacking level | `number \| string` | `100` | ### `` Slots | Slot | Description | | -------- | -------------------- | | default | Actual content after loading | | template | Custom loading placeholder | ### `` Props | Parameter | Description | Type | Default | | ------------ | ---------------- | ------------------------- | :----: | | rows | Displayed row count | `number` | `1` | | widths | Line skeleton width | `Array` | `[]` | | line-height | Line skeleton height | `number` | `20` | | line-spacing | Line skeleton row spacing | `number` | `15` | ### `` Props | Parameter | Description | Type | Default | | ------ | -------------- | ---------------------- | :--------: | | shape | Graphic skeleton shape | `'square' \| 'circle'` | `'square'` | | size | Graphic skeleton size | `'sm' \| 'md' \| 'lg'` | `'md'` | ### Type definitions The component exports the following types ```ts import type { SkeletonInstance, SkeletonLineProps, SkeletonShapeProps, } from "@cedar-design/ui"; ``` ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. Skeleton, SkeletonLine and SkeletonShape use independently copied source. Each library maintains its skeleton theme and size tokens. ### Managed defaults | Token | Default | | --- | --- | | `--c-skeleton-content-padding` | `var(--c-sys-space-6)` | | `--c-skeleton-card-border-radius` | `var(--c-sys-radius-md)` | | `--c-skeleton-card-margin-bottom` | `var(--c-sys-space-6)` | | `--c-skeleton-card-background-color` | `var(--c-sys-color-state-hover)` | | `--c-skeleton-animation-background` | `linear-gradient(90deg, transparent, var(--c-sys-color-surface-default), transparent)` | | `--c-skeleton-avatar-border-radius` | `50%` | | `--c-skeleton-avatar-margin-right` | `var(--c-sys-space-6)` | | `--c-skeleton-avatar-background-color` | `var(--c-sys-color-state-hover)` | | `--c-skeleton-title-border-radius` | `10px` | | `--c-skeleton-title-background-color` | `var(--c-sys-color-state-hover)` | | `--c-skeleton-row-height` | `12px` | | `--c-skeleton-row-border-radius` | `10px` | | `--c-skeleton-row-margin-top` | `10px` | | `--c-skeleton-shape-size-sm` | `36px` | | `--c-skeleton-shape-size-md` | `48px` | | `--c-skeleton-shape-size-lg` | `60px` | | `--c-skeleton-shape-border-radius` | `var(--c-sys-radius-md)` | ### Motion variables | Token | Default | | --- | --- | | `--c-skeleton-animation-duration` | `1s` | | `--c-skeleton-transition-duration` | `var(--c-sys-motion-duration-slow)` | Built-in motion follows prefers-reduced-motion: reduce, preserving content/state feedback while disabling decorative spinning, shimmer and ripples. Icon name changes skip waiting and cancel unfinished transitions. Ripple duration variables affect only CSS; the 250ms lifecycle timer remains unchanged, so each visual stage should not exceed 250ms. Callers must adapt custom animation classes. --- Document: llms/en-US/components/slider.md # Slider Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/slider/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Vertical #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------- | | `orientation` | Horizontal/vertical axis of the slider track and interaction, default horizontal; not the direction of value increments | Vertical | | `aria-label` | Name, or separate names for range thumbs | Vertical | | `range` | Fixed low/high thumbs; initial reversed values are sorted | Vertical | | `show-tooltip` | true on hover/focus/drag, false hidden, always persistent | Vertical | Preview configuration: `orientation="vertical"`, `aria-label="Vertical value"`, `range`, `show-tooltip="always"`. Example source: src/slider/__demos__/vertical.vue ```vue ``` ## Content and presentation ### Touch And Labels #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | -------------- | --------------------------------------------------------- | ---------------- | | `show-tooltip` | true on hover/focus/drag, false hidden, always persistent | Touch And Labels | | `aria-label` | Name, or separate names for range thumbs | Touch And Labels | Preview configuration: `show-tooltip="always"`, `aria-label="Always visible"`, `:show-tooltip="false"`, `active-color="#722ed1"`. Example source: src/slider/__demos__/touch-and-labels.vue ```vue ``` ## Interaction and control ### State Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ------------- | ---------------------------------------------------------- | -------------------------------- | | `aria-label` | Name, or separate names for range thumbs | Keyboard Input, Controlled Range | | `range` | Fixed low/high thumbs; initial reversed values are sorted | Keyboard Input, Controlled Range | | `step` | Positive finite step aligned to min; max remains reachable | Keyboard Input | | `marks` | Map positions within the finite range to text | Keyboard Input | | `show-ticks` | Show step ticks; dense ticks are reduced, up to 1000 | Keyboard Input | | `show-input` | InputNumber; Enter or blur commits via the same model | Keyboard Input | Example source: src/slider/__demos__/state-lab.vue ```vue ``` ### Keyboard Input - `step`: Controls the allowed increment. Example source: src/slider/__demos__/keyboard-input.vue ```vue ``` ### Controlled Range - `readonly`: Displays the current value without allowing edits. - `disabled`: Prevents user interaction. Example source: src/slider/__demos__/controlled-range.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Props | Prop | Description | Type | Default | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------- | | model-value | Controlled value; range uses a tuple | `SliderValue` | — | | default-value | Initial uncontrolled value | `SliderValue` | `0` | | min / max | Finite bounds; numeric strings are accepted. Invalid values fall back to 0/100. max<=min blocks interaction | `number \| string` | `0 / 100` | | step | Positive finite step aligned to min; max remains reachable | `number \| string` | `1` | | range | Fixed low/high thumbs; initial reversed values are sorted | `boolean` | `false` | | orientation | Horizontal/vertical axis of the slider track and interaction, default horizontal; not the direction of value increments | `horizontal \| vertical` | `horizontal` | | disabled / readonly / error | Inherits applicable FormItem/Form state when omitted; readonly is focusable but cannot change values | `boolean` | Inherited | | show-ticks | Show step ticks; dense ticks are reduced, up to 1000 | `boolean` | `false` | | marks | Map positions within the finite range to text | `Record` | — | | show-input | InputNumber; Enter or blur commits via the same model | `boolean` | `false` | | show-tooltip | true on hover/focus/drag, false hidden, always persistent | `boolean \| 'always'` | `true` | | format-tooltip | Formats tooltip and aria-valuetext | `(value:number)=>string\|number` | Original value | | aria-label | Name, or separate names for range thumbs | `string \| [string,string]` | — | | active-color / track-color / thumb-color | Active track/background/thumb fill colors | `string` | CSS variable | | label-color / label-text-color | Tooltip background/text colors | `string` | CSS variable | | track-height / thumb-size | Track thickness/thumb diameter in numeric px or CSS lengths; invalid values retain theme defaults | `number \| string` | CSS variable | ### Behavior and keyboard Arrows adjust by step, PageUp/PageDown by 10 steps, Home/End reach available endpoints. Range-thumb ARIA min/max follow the other thumb. When overlapping, clicks left/down separate the lower thumb, right/up the upper thumb. Keyboard events inside interactive thumb content are not intercepted. Readonly retains focus/tooltips; disabled leaves the Tab sequence. Pointer Events unify mouse, touch and pen. pointerup commits final coordinates; pointercancel/lost capture ends the latest proposal. Disabling, unmounting or KeepAlive deactivation cleans listeners/capture and stops value events. Horizontal sliders allow vertical page scrolling; vertical sliders allow horizontal scrolling. Controlled display changes only after parent updates; normalization does not emit automatically. change/update:model-value report distinct proposals; end includes the final proposal without guaranteeing acceptance. Each keyboard/numeric-input operation has start/end; a drag has one pair. Internal InputNumber does not duplicate Form validation. label-visible is removed; use show-tooltip without a compatibility alias. ### Events | Event | Arguments | Meaning | | ------------------ | ------------- | ----------------------------------------------------- | | update:model-value | `SliderValue` | Request an update | | change | `SliderValue` | Distinct numeric proposal paired with the model event | | start | — | Interaction starts | | end | `SliderValue` | Final proposal when interaction ends | ### Slots / Methods The button slot receives `{ currentValue:number,index:number }`. Custom content retains keyboard, ARIA and tooltip behavior. focus(index=0) focuses thumbs in display order; blur() removes focus. Exports SliderProps, SliderValue, SliderOrientation, SliderTooltipFormatter, SliderTooltipVisibility, SliderEmits, SliderSlots, SliderExpose, SliderInstance and runtime sliderProps. Component bodies/styles are independently copied; installation/Form integration remain local to each library. ### Style variables | Variable | Default | | -------------------------------- | -------------------------------------- | | `--c-slider-active-color` | `var(--c-sys-color-content-brand)` | | `--c-slider-track-color` | `var(--c-sys-color-state-hover)` | | `--c-slider-thumb-color` | `var(--c-sys-color-surface-default)` | | `--c-slider-thumb-border-color` | `var(--c-sys-color-content-brand)` | | `--c-slider-text-color` | `var(--c-sys-color-content-secondary)` | | `--c-slider-tooltip-background` | `var(--c-sys-color-surface-tooltip)` | | `--c-slider-tooltip-color` | `var(--c-sys-color-content-on-dark)` | | `--c-slider-error-color` | `var(--c-sys-color-content-danger)` | | `--c-slider-disabled-color` | `var(--c-sys-color-content-disabled)` | | `--c-slider-track-height` | `4px` | | `--c-slider-thumb-size` | `16px` | | `--c-slider-control-height` | `var(--c-sys-control-height-md)` | | `--c-slider-font-size` | `var(--c-sys-font-size-sm)` | | `--c-slider-gap` | `var(--c-sys-space-4)` | | `--c-slider-radius` | `var(--c-sys-radius-md)` | | `--c-slider-transition-duration` | `var(--c-sys-motion-duration-fast)` | | `--c-slider-input-width` | `80px` | ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. --- Document: llms/en-US/components/space.md # Space Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Example source: src/space/__demos__/basic.vue ```vue ``` ## Appearance and states ### Size - `size`: Controls the component size. Example source: src/space/__demos__/size.vue ```vue ``` ## Layout and arrangement ### Vertical #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `direction` | Row/column order of children, default row; column stacks them vertically. Does not use horizontal/vertical values | Vertical, Align, Layout Lab | | `align` | Cross-axis alignment: `flex-start`, `flex-end`, `center`, `stretch` or `baseline`. When omitted, inferred from `direction`: `row` → `center`, `column` → `stretch` | Align, Layout Lab | | `wrap` | Whether to exceed the line break | Wrap, Split | | `size` | Gap: `xs`/`sm`/`md`/`lg`/`xl` or `[rowGap, columnGap]`, supporting CSS lengths and shorthand | Split, Layout Lab | | `justify` | Main axis arrangement, Can be set to `flex-start` `flex-end` `center` `space-around` `space-between` `space-evenly` | Layout Lab | - `direction`: Controls the content direction. Example source: src/space/__demos__/vertical.vue ```vue ``` ### Align - `direction`: Controls the content direction. - `align`: Controls alignment on the cross axis. Example source: src/space/__demos__/align.vue ```vue ``` ### Wrap Example source: src/space/__demos__/wrap.vue ```vue ``` ### Split - `size`: Controls the component size. Example source: src/space/__demos__/split.vue ```vue ``` ### Layout Lab - `direction`: Controls the content direction. - `size`: Controls the component size. Example source: src/space/__demos__/layout-lab.vue ```vue ``` ### Split wrapping and content state Change wrapping, direction and order after typing a draft. A separator stays with its preceding item and may appear at a line end. Example source: src/space/__demos__/split-wrapping.vue ```vue ``` ## Interaction and control ### Interactive Layout #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `wrap` | Whether to exceed the line break | Interactive Layout | | `size` | Gap: `xs`/`sm`/`md`/`lg`/`xl` or `[rowGap, columnGap]`, supporting CSS lengths and shorthand | Interactive Layout | | `direction` | Row/column order of children, default row; column stacks them vertically. Does not use horizontal/vertical values | Interactive Layout | - `size`: Controls the component size. - `direction`: Controls the content direction. Example source: src/space/__demos__/interactive-layout.vue ```vue ``` ## Reading direction Inherits the nearest `dir="ltr|rtl"`. Row layout follows reading order; column layout stays top to bottom. Flex-start/flex-end follows the corresponding flex axis. The size pair always means [rowGap,columnGap], including in RTL. Wrapping and split slots preserve content order. Direction changes do not reverse data or recreate children with stable keys. ## API ### Children and size boundaries Keyed Fragment groups preserve their local child identity when reordered. Pure whitespace, empty text, comments and empty Fragments do not create spacing items; visible text, zero and empty elements remain. Empty split content also produces no separator item. With wrap and split, separators stay with their preceding item. This permits trailing separators at line ends; it does not suppress separators at every line boundary. Items wider than the available line may still overflow. Without wrap, the existing Flex gap and justify allocation are unchanged. Layout switches preserve content nodes. block switches the container between flex and inline-flex. align=stretch stretches item wrappers, not every control inside them: use the child control's block option or width:100% when required. Invalid size shapes, negative/nonfinite numbers or tuples without exactly two lengths fall back to md and receive development diagnostics. Tuple entries are lengths, not presets. CSS var/calc expressions remain supported; CSS grammar and resolved values belong to the browser. ### Space Props ### Props | Arguments | Description | Type | Default | | --------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------- | | direction | Row/column order of children, default row; column stacks them vertically. Does not use horizontal/vertical values | _string_ | `row` | | justify | Main axis arrangement, Can be set to `flex-start` `flex-end` `center` `space-around` `space-between` `space-evenly` | _string_ | `flex-start` | | align | Cross-axis alignment: `flex-start`, `flex-end`, `center`, `stretch` or `baseline`. When omitted, inferred from `direction`: `row` → `center`, `column` → `stretch` | _string_ | `-` | | size | Gap: `xs`/`sm`/`md`/`lg`/`xl` or `[rowGap, columnGap]`, supporting CSS lengths and shorthand | _string \| number \| [string \| number, string \| number]_ | `md` | | wrap | Whether to exceed the line break | _boolean_ | `false` | | block | Whether to use a flex container | _boolean_ | `true` | ### Slots | Slot | Description | Arguments | | --------- | ---------- | ---- | | `default` | Content of space | `-` | | `split` | Range separator | `-` | ### Type definitions ```ts import type { SpaceProps, SpaceSize, SpaceDirection, SpaceAlign, SpaceJustify, SpaceInternalSize, SpaceInstance } from '@cedar-design/ui' ``` ### Style variables | Variable | Default | | --- | --- | | `--c-space-size-xs-row-gap` | `var(--c-sys-space-2)` | | `--c-space-size-xs-column-gap` | `var(--c-sys-space-2)` | | `--c-space-size-sm-row-gap` | `var(--c-sys-space-4)` | | `--c-space-size-sm-column-gap` | `var(--c-sys-space-3)` | | `--c-space-size-md-row-gap` | `var(--c-sys-space-5)` | | `--c-space-size-md-column-gap` | `var(--c-sys-space-4)` | | `--c-space-size-lg-row-gap` | `var(--c-sys-space-6)` | | `--c-space-size-lg-column-gap` | `var(--c-sys-space-5)` | | `--c-space-size-xl-row-gap` | `var(--c-sys-space-8)` | | `--c-space-size-xl-column-gap` | `var(--c-sys-space-6)` | ## Shared implementation and platform boundaries Each platform maintains complete local source without a common core or shared instances/reactive state. Update both implementations together. Read-only parity checks cover bodies, props, child flattening, main styles, size tokens and paired tests. Only installation entries/namespaces are adapted locally. Both default to `size="md"`, `wrap=false`, `block=true` and `direction="row"`. Omitted align means center for row and stretch for column. Maple callers previously relying on default wrapping must add `wrap` explicitly. `size` supports all five presets, numbers/numeric strings in px, CSS lengths/expressions such as 1rem or var(--gap), and `[rowGap, columnGap]`. Arrays are always row then column; direction does not swap them. Array entries are lengths, not preset names. Shared [row,column] presets: xs=[4,4], sm=[8,6], md=[12,8], lg=[16,12], xl=[24,16] px, overridable through CSS variables. --- Document: llms/en-US/components/split-button.md # Split Button Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `placement`: Chooses the position relative to the trigger. Example source: src/split-button/__demos__/basic.vue ```vue ``` ## Appearance and states ### Variants #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `variant` | Button group variant | Variants | | `disabled` | Whether the entire split button is disabled | Disabled | | `button-props` | Props for the primary button | Disabled | | `trigger-button-props` | Props for the menu trigger button | Disabled | | `placement` | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | Appearance configuration comparison | - `variant`: Selects the visual variant. Example source: src/split-button/__demos__/variants.vue ```vue ``` ### Disabled - `disabled`: Prevents user interaction. Example source: src/split-button/__demos__/disabled.vue ```vue ``` ### Appearance configuration comparison Choose an axis to compare its available values with the same content and model. Other settings remain unchanged while comparing. Example source: src/split-button/__demos__/appearance-lab.vue ```vue ``` ## Content and presentation ### Popup #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `placement` | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | Popup | | `offset-y` | Screen-vertical offset; numbers are px, strings are converted as lengths | Popup | | `popup-max-height` | Maximum menu height | Popup | | `hide-on-select` | Close the menu after selection | Popup | - `placement`: Chooses the position relative to the trigger. Example source: src/split-button/__demos__/popup.vue ```vue ``` ## Customization and slots ### Custom Icon Preview configuration: `label="保存草稿"`, `value="draft"`, `label="保存并发布"`, `value="publish"`. Example source: src/split-button/__demos__/custom-icon.vue ```vue ``` ## Interaction and control ### Controlled Preview configuration: `v-model:open="open"`, `label="保存草稿"`, `value="draft"`, `label="保存并发布"`. Example source: src/split-button/__demos__/controlled.vue ```vue ``` ## Async and dynamic data ### Async Action click is a normal emitted event and supports async handlers. Business state controls loading; restore it in finally. Listener Promises do not automatically drive loading. Disabled/loading links have no effective href. Example source: src/split-button/__demos__/async-action.vue ```vue ``` ## Reading direction The primary action sits at reading start and the menu button at reading end. Direction changes neither swap actions nor select a value. Enter/Space retains native button behavior. Up/Down opens the menu and skips disabled items; Home/End focuses boundaries, Enter selects and Escape closes and restores focus. Popovers inherit the reference direction; start/end alignment follows reading direction while explicit left/right remains physical. Downward slot graphics are not mirrored. ## API ### `` Props | Parameter | Description | Type | Default | | -------------------- | ----------------------------------------- | ------------------------------------------------ | :-------: | | open **(v-model)** | Whether the menu is open | `boolean` | `-` | | default-open | Default menu open state in uncontrolled mode | `boolean` | `false` | | disabled | Whether the entire split button is disabled | `boolean` | `false` | | status | Button group semantic status | `SemanticStatus` | `default` | | variant | Button group variant | `ButtonVariant` | `default` | | size | Button group size | `ComponentSize` | `md` | | color | Background color | `string` | `''` | | text-color | Custom text color | `string` | `''` | | elevation | Button group elevation | `boolean \| number` | `true` | | button-props | Props for the primary button | `Partial` | `-` | | trigger-button-props | Props for the menu trigger button | `Partial` | `-` | | trigger | Menu trigger method | `'hover' \| 'click' \| 'focus' \| 'contextMenu'` | `click` | | placement | Preferred popup side relative to the trigger, default bottom. With the default auto-fit-position enabled, Trigger may flip and constrain it to the viewport when space is limited; this is not a fixed final position | `MenuPlacement`: the standard twelve placements | `bottom` | | popup-container | Menu mount container | `PopupContainer` | `-` | | popup-max-height | Maximum menu height | `boolean \| number` | `true` | | popup-class | Menu popup class | `string \| array \| object` | `-` | | offset-x | Screen-horizontal offset; numbers are px, strings are converted as lengths | `string \| number` | `0` | | offset-y | Screen-vertical offset; numbers are px, strings are converted as lengths | `string \| number` | `0` | | hide-on-select | Close the menu after selection | `boolean` | `true` | ### `` Events | Event | Description | Arguments | | ----------- | -------------------------- | -------------------- | | update:open | Emitted when an open-state update is requested | open: `boolean` | | open-change | Emitted when the menu open state changes | open: `boolean` | | click | Emitted when the primary button is clicked | event: `MouseEvent` | | select | Emitted when a menu option is selected | value, option, event | ### `` Slots | Slot | Description | Arguments | | ------- | ---------------- | --------------- | | default | Primary button content | - | | icon | Menu trigger button icon | open: `boolean` | | content | Menu content | - | ### Instance methods | Method | Description | | -------- | -------------------------- | | open() | Request menu opening; disabled prevents it | | close() | Request menu closing | | resize() | Recalculate menu position | Controlled `open` emits update requests only; callers must update it. Main-button clicks bubble normally without opening the menu. Like Button, `click` is a Promise-consuming `onClick` callback prop supporting `@click`, not a second emitted notification. If `button-props.onClick` is also supplied, each handler runs once. Both platforms independently copy bodies, props, style dependency entries and contract tests. Cedar adapts positioning through Menu without shared instances/runtime. ## Type definitions ```ts import type { SplitButtonInstance, SplitButtonProps } from '@cedar-design/ui' ``` ### Placement semantics and configuration The menu side passes through the internal Menu placement to Trigger and uses MenuPlacement, without a second positioning entry. --- Document: llms/en-US/components/split.md # Split Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `size`: The size of the segmentation, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px - `min`: Minimum threshold, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px Example source: src/split/__demos__/basic.vue ```vue ``` ## Layout and arrangement ### Nested - `orientation`: Direction of division Example source: src/split/__demos__/nested.vue ```vue ``` ## API ### `` Props | Parameter | Description | Type | Default | | ------------------ | ----------------------------------------------------------------- | ---------------------------- | :------------: | | component | The html tag of the split box | `string` | `'div'` | | orientation | Arrangement axis of the two panels: horizontal by default means left/right panels, whose divider handle is vertical | `'horizontal' \| 'vertical'` | `'horizontal'` | | size **(v-model)** | The size of the segmentation, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px | `number\|string` | `-` | | default-size | Default split size, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px | `number\|string` | `0.5` | | min | Minimum threshold, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px | `number\|string` | `-` | | max | Maximum threshold, it can be 0~1 representing a percentage, or a specific number of pixels, such as 300px | `number\|string` | `-` | | disabled | Whether disabled | `boolean` | `false` | ### `` Events | Event | Description | Arguments | | ---------- | ---------------- | ---- | | move-start | Emitted before dragging starts | - | | moving | Emitted during dragging | - | | move-end | Emitted after dragging ends | - | ### `` Slots | Slot | Description | Arguments | | ------------------- | :--------------: | ---- | | first | First panel content | - | | resize-trigger | Resize-handle content | - | | resize-trigger-icon | Resize-handle icon | - | | second | Second panel content | - | ### Type definitions The component exports the following types ```ts import type { SplitInstance } from '@cedar-design/ui' ``` `--c-split-trigger-size-icon-wrapper` (default 6px) controls handle thickness: width for vertical handles, height for horizontal handles. It does not change their 100% length along the panel. ## Reading direction and interaction Split inherits the nearest native dir. Size and bounds always describe the first pane, preserving ratio or pixel units. In RTL, dragging left grows the first horizontal pane; vertical movement is unchanged. Focused separators support arrows, Shift, Home and End. Direction/orientation changes, disablement and teardown cancel gestures and restore the cursor without changing the size merely because direction changed. --- Document: llms/en-US/components/statistic.md # Statistic Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `title="Downloads"`, `:value="125670"`, `show-group-separator`, `title="Comments"`. Example source: src/statistic/__demos__/basic.vue ```vue ``` ## Content and presentation ### Tabular Nums #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Displayed-value title | Tabular Nums, Extra, Animation | | `value` | Displayed value | Tabular Nums, Extra, Animation | | `suffix` | Value suffix | Tabular Nums | | `value-style` | Custom style of the value | Tabular Nums | | `tabular-nums` | Use tabular digits to prevent width changes as values update | Tabular Nums | | `prefix` | Value prefix | Extra | Preview configuration: `title="比例数字(右侧标记会跳动)"`, `:value="count"`, `suffix="\|"`, `:value-style="{ fontVariantNumeric: 'proportional-nums' }"`. Example source: src/statistic/__demos__/tabular-nums.vue ```vue ``` ### Extra Preview configuration: `title="Revenue"`, `:value="9280"`, `prefix="$"`, `show-group-separator`. Example source: src/statistic/__demos__/extra.vue ```vue ``` ### Animation Preview configuration: `title="Growth Rate"`, `:value="50.52"`, `:precision="2"`, `:value-from="0"`. Example source: src/statistic/__demos__/animation.vue ```vue ``` ### Statistic Preview configuration: `title="Countdown"`, `:time="2 * 60 * 60 * 1000"`, `title="Campaign"`, `:time="4 * 24 * 60 * 60 * 1000"`. Example source: src/countdown/__demos__/statistic.vue ```vue ``` ## Customization and slots ### Prefix Suffix #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `title` | Displayed-value title | Prefix Suffix, Count To | | `suffix` | Value suffix | Prefix Suffix, Count To | | `value` | Displayed value | Prefix Suffix | | `prefix` | Value prefix | Prefix Suffix | | `show-group-separator` | Whether to show the group separator | Prefix Suffix | | `precision` | Decimal places (number mode) | Prefix Suffix | Preview configuration: `title="Account Balance"`, `:value="125670"`, `prefix="$"`, `show-group-separator`. Example source: src/statistic/__demos__/prefix-suffix.vue ```vue ``` ### Count To Preview configuration: `title="Active Users"`, `:from="0"`, `:to="125670"`, `:duration="2000"`. Example source: src/statistic/__demos__/count-to.vue ```vue ``` ## API ### `` Props | Prop | Description | Type | Default | | ---------------------- | -------------------------------------------------------------- | ------------------------- | ------------ | | `title` | Displayed-value title | `string` | - | | `value` | Displayed value | `number \| string \| Date` | - | | `prefix` | Value prefix | `string` | - | | `suffix` | Value suffix | `string` | - | | `format` | Date format (date mode) | `string` | `'HH:mm:ss'` | | `extra` | Extra content | `string` | - | | `start` | Whether to start the animation | `boolean` | `true` | | `precision` | Decimal places (number mode) | `number` | `0` | | `separator` | Group separator (number mode) | `string` | - | | `show-group-separator` | Whether to show the group separator | `boolean` | `false` | | `tabular-nums` | Use tabular digits to prevent width changes as values update | `boolean` | `false` | | `animation` | Whether to enable animation | `boolean` | `false` | | `animation-duration` | Animation duration | `number` | `2000` | | `value-from` | Animation start value | `number` | - | | `placeholder` | Placeholder when `value` is `undefined` and the default slot is unused | `string` | - | | `value-style` | Custom style of the value | `CSSProperties` | - | ### `` Slots | Slot | Description | Arguments | | --------- | ---------------------------------------- | ---- | | `default` | Custom `value`, used when `value` is not provided | `-` | | `title` | Title | `-` | | `prefix` | The prepend icon of alert | `-` | | `suffix` | Suffix | `-` | | `extra` | Extra content | `-` | ### Type definitions The component exports the following types ```ts import type { StatisticProps } from '@cedar-design/ui' ``` ### Style variables | Variable | Default | | --- | --- | | `--c-statistic-title-color` | `var(--c-sys-color-content-secondary)` | | `--c-statistic-title-font-size` | `var(--c-font-size-body-3)` | | `--c-statistic-title-margin-bottom` | `var(--c-spacing-4)` | | `--c-statistic-value-color` | `var(--c-sys-color-content-primary)` | | `--c-statistic-value-font-size` | `26px` | | `--c-statistic-value-font-weight` | `var(--c-font-weight-500)` | | `--c-statistic-decimal-font-size` | `inherit` | | `--c-statistic-prefix-color` | `var(--c-sys-color-content-secondary)` | | `--c-statistic-prefix-font-size` | `14px` | | `--c-statistic-prefix-spacing` | `var(--c-spacing-1)` | | `--c-statistic-suffix-color` | `var(--c-sys-color-content-secondary)` | | `--c-statistic-suffix-font-size` | `14px` | | `--c-statistic-suffix-spacing` | `var(--c-spacing-1)` | | `--c-statistic-extra-color` | `var(--c-sys-color-content-secondary)` | | `--c-statistic-extra-font-size` | `var(--c-font-size-body-3)` | | `--c-statistic-extra-margin-top` | `var(--c-spacing-4)` | ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. Placeholder text updates when the default slot appears/disappears. Animation pauses on unmount/KeepAlive deactivation. --- Document: llms/en-US/components/steps.md # Steps Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `status`: Selects the semantic state. Example source: src/steps/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance Lab #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `type` | Steps appearance type | Step types and states | | `status` | Current step status | Step types and states | | `changeable` | Whether clicking can change steps | Step types and states | Preview configuration: `layout="vertical"`, `aria-label="status"`, `options`, `variant="button"`. Example source: src/steps/__demos__/appearance-lab.vue ```vue ``` ### Step types and states All four types share one current-step and status model. Click a step or select 1–3, then choose wait, process, finish or error: default, arrow, dot and navigation update together. Status changes the current node’s semantic state without changing its index. Titles and descriptions follow the page language to fit the phone preview.
Configuration details and limits #### Types Preview configuration: `aria-label="Current step"`, `options`, `variant="button"`, `size="sm"`. #### Error - `status`: Selects the semantic state. #### Arrow - `status`: Selects the semantic state. #### Dot - `status`: Selects the semantic state. #### Navigation - `status`: Selects the semantic state.
Example source: src/steps/__demos__/types.vue ```vue ``` ## Layout and arrangement ### Content Placement #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Current step status | Content Placement, Vertical | | `content-placement` | Content side relative to the step node: right or bottom, default right. Dot steps derive it from orientation; navigation steps always use right | Content Placement | | `orientation` | Horizontal/vertical axis of the step flow, default horizontal; arrow and navigation variants remain horizontal | Vertical | - `status`: Selects the semantic state. Example source: src/steps/__demos__/content-placement.vue ```vue ``` ### Vertical - `status`: Selects the semantic state. Example source: src/steps/__demos__/vertical.vue ```vue ``` ## Content and presentation ### Description #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `status` | Current step status | Description, Line Less | | `show-line` | Whether to show connectors | Line Less | - `status`: Selects the semantic state. Example source: src/steps/__demos__/description.vue ```vue ``` ### Line Less - `status`: Selects the semantic state. Example source: src/steps/__demos__/line-less.vue ```vue ``` ## Customization and slots ### Custom Icon - `status`: Selects the semantic state. Example source: src/steps/__demos__/custom-icon.vue ```vue ``` ## Interaction and control ### Changeable #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `changeable` | Whether clicking can change steps | Changeable | | `status` | Current step status | Changeable | - `status`: Selects the semantic state. Example source: src/steps/__demos__/changeable.vue ```vue ``` ## API Use ordinary `v-model`. `modelValue` is the current step, starting at 1. `defaultValue` initializes uncontrolled state once; later changes do not reset it. Initialization emits no `update:modelValue`. When supplied, `modelValue` is controlled by the parent. ### Steps Props | Prop | Description | Type | Default | | -------------------- | ------------------------ | ----------------------------------------------------- | -------------- | | type | Steps appearance type | `'default'` \| `'arrow'` \| `'dot'` \| `'navigation'` | `'default'` | | orientation | Horizontal/vertical axis of the step flow, default horizontal; arrow and navigation variants remain horizontal | `'horizontal'` \| `'vertical'` | `'horizontal'` | | content-placement | Content side relative to the step node: right or bottom, default right. Dot steps derive it from orientation; navigation steps always use right | `'right'` \| `'bottom'` | `'right'` | | model-value(**v-model**) | Current step number | `number` | `-` | | default-value | Default uncontrolled step number | `number` | `1` | | status | Current step status | `'wait'` \| `'process'` \| `'finish'` \| `'error'` | `'process'` | | show-line | Whether to show connectors | `boolean` | `true` | | size | Steps size | `'sm'` \| `'md'` | `'md'` | | changeable | Whether clicking can change steps | `boolean` | `false` | ### Steps Events | Event | Description | Arguments | | ------------------- | ------------------------------ | ---------------------------- | | change | Emitted when the step number changes; requires `changeable` | current:`number`
previous:`number`
ev:`Event` | | update:modelValue | `v-model` sync | step:`number` | ### Steps Slots | Slot | Description | | ----------- | ------------ | | default | Step content | | finish-icon | Finished status icon | | error-icon | Error status icon | ### Step Props | Prop | Description | Type | Default | | ----------- | ------------ | -------------------------------------------------- | ------- | | title | Step title | `string` | `-` | | description | Step description | `string` | `-` | | status | Step status | `'wait'` \| `'process'` \| `'finish'` \| `'error'` | `-` | | disabled | Whether the step is disabled | `boolean` | `false` | ### Step Slots | Slot | Description | Arguments | | ----------- | ---- | --------------------------------- | | default | Title | `index`、`status`、`active`、`disabled` | | title | Title | `index`、`status`、`active`、`disabled` | | node | Node | `index`、`status`、`active`、`disabled` | | icon | Icon | `index`、`status`、`active`、`disabled` | | description | Description | `index`、`status`、`active`、`disabled` | ## Type definitions The component exports the following types ```ts import type { StepsProps, StepProps, StepsType, StepStatus, StepsSize, StepsContentPlacement, StepsInstance, StepsStepInstance, } from '@cedar-design/ui' ``` ## Shared implementation and platform boundaries Each platform maintains a complete local implementation. They do not import a common core or share component instances or reactive state. Changes must update both implementations. Component bodies, props, key styles and paired tests have read-only source consistency checks; theme tokens and installation entries remain local to each library. Steps/Step bodies, props, context protocol and styles are source copies. Injection Symbols are defined separately per library, not shared. The four types and existing status/event contracts remain. `active` indicates only whether the current one-based step index matches modelValue, independently of wait/process/finish/error status. A current error step remains `active`. Focus/hover do not change `active`. ### Placement semantics and configuration content-placement shares side vocabulary and spelling, not an identical set across all components. Steps implements only right/bottom; dot and navigation variants have derived rules. Unsupported sides are not added for naming uniformity. ## Reading direction and keyboard interaction Steps inherits the nearest native `dir` and supports live changes. Horizontal layout and directional geometry follow reading order; vertical progression stays top to bottom. With `changeable`, arrow keys move focus, Home/End reach the first/last enabled step, and Enter/Space activate it. Focus navigation and direction changes do not update progress. --- Document: llms/en-US/components/style-provider.md # Style Provider Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage Preview configuration: `tag="section"`, `:style-vars="active ? { '--c-demo-color': 'teal' } : null"`, `:style-vars="{ '--c-demo-color': 'coral' }"`. Example source: src/style-provider/__demos__/basic.vue ```vue ``` ## Global calls ```ts import { StyleProvider, Themes } from '@cedar-design/ui' StyleProvider.setStyleVars(Themes.default.dark) StyleProvider.setStyleVars(Themes.maple.light) StyleProvider.setStyleVars(null) ``` Each call replaces previous injected values rather than merging cumulatively. Values already equal to base styles are not written again. `dark` sets `html[cedar-theme="dark"]`; `light` removes it. Without color-scheme, existing theme attributes remain. `null` removes this library's injection/theme attributes without affecting the other library. SSR calls have no side effects. Variables accept full CSS names or camelCase such as `cColorScheme`. Library prefixes are not added automatically. Prefer full `--c-*` names. ## Installation and defaults ```ts import { StyleProvider } from '@cedar-design/ui' app.use(StyleProvider) StyleProvider.setPropsDefaults({ tag: 'section', styleVars: () => ({ '--c-demo-color': 'teal' }), }) ``` Set defaults during initialization before mounting; mounted instances are not retroactively updated. Explicit props take precedence. Object defaults are copied per instance; factories/`null` are supported. Defaults are local to each library, not shared. Installation always registers `CStyleProvider` without modifying app global config. For aliases, use `app.component('MyStyleProvider', StyleProvider)`. ## API | Prop | Description | Type | Default | | --- | --- | --- | --- | | `style-vars` | Local CSS variables; null clears local overrides | `Record \| null` | `{}` | | `tag` | Wrapper tag | `string` | `div` | The default slot supplies component content. No events. ## Type definitions Exports `StyleVars`, `StyleProviderProps`, `StyleProviderDefaults` and `StyleProviderInstance`. `StyleProvider` is the only public component entry; `styleProviderProps` and resolver-facing `_StyleProviderComponent` are also exported. No component-specific theme tokens. Variable values are strings; numeric dimensions should be unit-bearing strings. --- Document: llms/en-US/components/style/atomic-css.md # Style Atomic Css Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Starter Example source: src/style/atomic-css/__demos__/starter.vue ```vue ``` ### Overview Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/atomic-css/__demos__/overview.vue ```vue ``` ## Colors, typography and spacing ### Colors Example source: src/style/atomic-css/__demos__/colors.vue ```vue ``` ### Font Size Example source: src/style/atomic-css/__demos__/font-size.vue ```vue ``` ### Spacing Example source: src/style/atomic-css/__demos__/spacing.vue ```vue ``` ## Responsive layout and composition ### Breakpoints Preview configuration: `:columns="columns"`, `:data="rows"`, `:pagination="false"`. Example source: src/style/atomic-css/__demos__/breakpoints.vue ```vue ``` ### Combined Example source: src/style/atomic-css/__demos__/combined.vue ```vue ``` ## UnoCSS ### Installation ```shell pnpm add -D @cedar-design/preset-unocss unocss ``` ### Configuration ```js // uno.config.ts import { defineConfig } from "unocss"; import { presetCedar } from "@cedar-design/preset-unocss"; export default defineConfig({ presets: [presetCedar()], }); ``` Optional `presetCedar({ colors, fontSize, breakpoints })`; `false` disables a section. ### Load theme variables first ```js import "@cedar-design/ui/dist/index.css"; // Or import a theme stylesheet containing --c-* variables ``` --- ## Tailwind CSS ### Installation ```shell pnpm add -D @cedar-design/preset-tailwindcss tailwindcss ``` ### Tailwind v3 ```js // tailwind.config.js import { presetCedar } from "@cedar-design/preset-tailwindcss"; export default { content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], presets: [presetCedar()], }; ``` ### Tailwind v4 ```js // tailwind.config.js import { presetCedar } from "@cedar-design/preset-tailwindcss"; export default { presets: [presetCedar()], }; ``` ```css /* src/style.css */ @import "tailwindcss"; @config '../tailwind.config.js'; ``` --- See [Common patterns](llms/en-US/components/style/atomic-usage.md) for all Flex/spacing/sizing/overflow/radius classes. Only utilities mapped to Cedar tokens are listed below. ## Optional configuration ```js presetCedar({ colors: true, // or false / partial key overrides fontSize: true, // false disables it; custom fontSize maps are accepted // Uno: breakpoints: true, // TW: // screens: true, }); ``` ### Custom theme mapping `colors`/`fontSize` may override part of the defaults; omitted keys retain default mappings: ```js presetCedar({ colors: { primary: "var(--app-color-brand)", danger: "var(--app-color-error)", }, fontSize: { md: "15px", }, }); ``` `false` disables the corresponding Cedar theme mapping. Generator-native utilities may still exist but no longer bind Cedar variables. --- ## Corresponding Maple configuration Maple's UnoCSS preset includes `presetUno` with an `mp-` prefix: ```js import { defineConfig } from "unocss"; import { presetMaple } from "@nio-pow/maple-preset-unocss"; export default defineConfig({ presets: [presetMaple()], }); ``` Both Maple UnoCSS/Tailwind presets generate `mp-bg-primary`, `mp-text-primary` and `mp-border mp-border-primary` without unprefixed aliases. Tailwind `prefix` is global; one Tailwind instance should not load Cedar/Maple presets with different prefixes simultaneously. --- ## Notes - The preset includes the framework's full atomic classes with `c-` prefixes, e.g. `c-flex`/`c-p-16`. - Classes must start with `c-`, e.g. `c-bg-primary`; no unprefixed aliases. - Choose UnoCSS or Tailwind CSS; do not enable both generators in one app. - Cedar/Maple share theme key names. Even with different UnoCSS utility prefixes, avoid merging both themes in one config or matching colors may overwrite by preset order. --- Document: llms/en-US/components/style/atomic-usage.md # Style Atomic Usage Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Combined Example source: src/style/atomic-css/__demos__/combined.vue ```vue ``` ## Spacing and responsive layout ### Spacing Example source: src/style/atomic-css/__demos__/spacing.vue ```vue ``` ### Breakpoints Preview configuration: `:columns="columns"`, `:data="rows"`, `:pagination="false"`. Example source: src/style/atomic-css/__demos__/breakpoints.vue ```vue ``` ## Colors and typography ### Colors Example source: src/style/atomic-css/__demos__/colors.vue ```vue ``` Example source: src/style/atomic-css/__demos__/font-size.vue ```vue ``` --- Document: llms/en-US/components/style/color.md # Style Color Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Fill Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/color/__demos__/fill.vue ```vue ``` ## Applying colors ### Border Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/color/__demos__/border.vue ```vue ``` ### Text Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/color/__demos__/text.vue ```vue ``` ### Background Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/color/__demos__/background.vue ```vue ``` --- Document: llms/en-US/components/style/elevation.md # Style Elevation Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Class Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/elevation/__demos__/class.vue ```vue ``` ## Shadow composition ### Demo Example source: src/style/elevation/__demos__/demo.vue ```vue ``` --- Document: llms/en-US/components/style/typography.md # Style Typography Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Font Preview configuration: `:columns="columns2"`, `:data="dataFont"`, `:pagination="false"`. Example source: src/style/typography/__demos__/font.vue ```vue ``` ## Font size and face ### Font Size Preview configuration: `:columns="columns"`, `:data="dataSize"`, `:pagination="false"`. Example source: src/style/typography/__demos__/font-size.vue ```vue ``` ### Font Family Preview configuration: `:columns="columns"`, `:data="dataFamily"`, `:pagination="false"`. Example source: src/style/typography/__demos__/font-family.vue ```vue ``` ### Font Weight Preview configuration: `:columns="columns"`, `:data="dataWeight"`, `:pagination="false"`. Example source: src/style/typography/__demos__/font-weight.vue ```vue ``` ## Alignment and line height ### Text Align Preview configuration: `:columns="columns"`, `:data="data"`, `:pagination="false"`. Example source: src/style/typography/__demos__/text-align.vue ```vue ``` ### Line Height Preview configuration: `:columns="columns"`, `:data="dataLineHeight"`, `:pagination="false"`. Example source: src/style/typography/__demos__/line-height.vue ```vue ``` --- Document: llms/en-US/components/style/utilities.md # Style Utilities Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Overview Example source: src/style/utilities/__demos__/overview.vue ```vue ``` --- Document: llms/en-US/components/switch.md # Switch The same scenarios, parameters and interactions as Cedar. Only component prefixes differ; themes and site shells remain independent. ## Reading direction Switch inherits source dir: its unchecked handle starts at inline start and moves toward inline end when checked. Space/Enter still toggle. Direction changes do not modify values; disabled, readonly and loading states block commits. ## Basic examples ### Controlled and default value Example source: src/switch/__demos__/basic.vue ```vue ``` ## Appearance and states ### Appearance configuration comparison Choose a dimension to compare all its values side by side while keeping other settings and content identical. Change the other settings to inspect combinations; input specimens share one model. Example source: src/switch/__demos__/appearance-lab.vue ```vue ``` ## Customization and slots ### Custom colors #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | ----------------- | --------------------- | --------------------------- | | `variant` | Appearance | Custom text, Custom icons | | `checked-color` | Checked track color | Custom colors | | `unchecked-color` | Unchecked track color | Custom colors | | `checked-text` | Checked label | Custom text | | `unchecked-text` | Unchecked label | Custom text | | `ripple` | Click ripple | Ripple and handle elevation | Example source: src/switch/__demos__/custom-color.vue ```vue ``` ### Custom text Example source: src/switch/__demos__/custom-text.vue ```vue ``` ### Custom icons Example source: src/switch/__demos__/custom-icon.vue ```vue ``` ### Ripple and handle elevation Example source: src/switch/__demos__/custom.vue ```vue ``` ## Interaction and control ### Interaction state comparison #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --------------- | ------------------------------------------------------------ | ---------------------------- | | `disabled` | Disable interaction, including inherited form disabled state | Interaction state comparison | | `readonly` | Read only; focus and click remain available without toggling | Interaction state comparison | | `variant` | Appearance | Loading | | `loading` | Loading; blocks clicks and changes | Loading | | `default-value` | Initial uncontrolled value; falls back to uncheckedValue | Loading | | `size` | Size; omitted value follows platform rules below | Focus and event order | Toggle disabled, read-only and error states, then interact with the same instance. Recovery controls remain outside the target; error appearance alone does not validate data. Example source: src/switch/__demos__/state-lab.vue ```vue ``` ### Loading Example source: src/switch/__demos__/loading.vue ```vue ``` ### Focus and event order Example source: src/switch/__demos__/events.vue ```vue ``` ### Custom values and events Example source: src/switch/__demos__/custom-value.vue ```vue ``` ## Async and dynamic data ### Async allow, deny and rejection Example source: src/switch/__demos__/switch-interception.vue ```vue ``` ## API ### Empty values and reading placeholders `empty-values` recognizes empty data; `empty-value` keeps existing clear output. `empty-text` defaults to `'-'` under `read-pretty`, with Field > FormItem > Form precedence and custom read slots first. With explicit empty-values, built-in required uses the policy; custom validators receive original data. See the [shared guide](llms/en-US/guide/empty-values.md). | Prop | Type | Default and scope | | ------------ | ------------------ | --------------------------------------------------------------------------- | | empty-values | readonly unknown[] | Field > FormItem > Form > component-family default; replaces the whole list | | empty-text | string | Field > FormItem > Form > '-'; explicit '' is valid | These props belong to field presentation; pure panels do not gain reading mode. Form and FormItem provide inherited settings. The existing empty-value type and clear fallback remain component-specific. ### Value and default value Use ordinary `v-model`. `modelValue` is the actual switch value and matches checkedValue/uncheckedValue types. `defaultValue` initializes uncontrolled state once; later changes do not reset it. Explicit binding takes precedence, with no initialization `update:modelValue`. ### Props | Prop | Meaning | Type | Default | | ---------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | --------- | | model-value | Controlled value; managed internally when omitted | string / number / boolean | undefined | | default-value | Initial uncontrolled value; falls back to uncheckedValue | string / number / boolean | undefined | | clearable | Show clearing in popup editing | boolean | false | | empty-value | Value committed after clearing; accepts a value or factory | SwitchValue \| null \| (() => SwitchValue \| null) | undefined | | edit-mode | Editing mode; inherits FormItem/Form when unset. See editing-mode guidance for platform-specific values | FieldEditMode | undefined | | read-pretty | Plain reading display, independent of readonly | boolean | undefined | | before-commit | Cancelable interceptor before saving the editor | BeforeFieldCommit | undefined | | open | Controlled editor open state | boolean | undefined | | default-open | Initial uncontrolled editor state | boolean | false | | popup-container | Editor mount container | PopupContainer | undefined | | checked-value | Checked value | string / number / boolean | true | | unchecked-value | Unchecked value | string / number / boolean | false | | variant | Appearance | circle / round / line / tonal | circle | | size | Size; omitted value follows platform rules below | sm / md / lg | undefined | | disabled | Disable interaction, including inherited form disabled state | boolean | undefined | | readonly | Read only; focus and click remain available without toggling | boolean | undefined | | loading | Loading; blocks clicks and changes | boolean | false | | before-change | Switch interceptor, not an event | (payload, done, context) => boolean / void / Promise | — | | checked-text | Checked label | string | — | | unchecked-text | Unchecked label | string | — | | checked-color | Checked track color | string | — | | unchecked-color | Unchecked track color | string | — | | loading-color | Loading-icon color | string | — | | ripple | Click ripple | boolean | true | | handle-elevation | Thumb elevation: true means level 2; numbers are integer-clamped to 0–24 | boolean / number | true | before-change returning false, throwing or rejecting cancels switching. Other normal completion allows it. While awaiting a Promise or done, loading is automatic and repeated input is blocked. Pending results become stale after unmount, KeepAlive deactivation, external value updates or changes to disabled/readonly/loading. Controlled mode only requests updates. Selection changes after the parent updates model-value. Without model-value, internal state is used. ### Events | Event | Arguments and timing | | ------------------ | ---------------------------------------------------------------------- | | click | (event: Event), before interception when clicking is allowed | | update:model-value | (nextValue: SwitchValue), after switching is allowed and before change | | change | (nextValue: SwitchValue, event: Event), once per commit | | focus | (event: FocusEvent), on focus | | blur | (event: FocusEvent), on blur | Supports Enter/Space without repeated toggles on key repeat. disabled/loading emit neither click nor value changes; readonly may emit click without running the interceptor. External model-value updates do not emit an extra change. ### Slots | Slot | Description | Arguments | | -------------- | ------------------------------------------------------------- | --------- | | checked | Checked label; overrides checked-text; hidden for line/sm | — | | unchecked | Unchecked label; overrides unchecked-text; hidden for line/sm | — | | checked-icon | Checked thumb icon; replaced while loading | — | | unchecked-icon | Unchecked thumb icon; replaced while loading | — | ### Methods No public methods. ### Platform notes Props, event arguments and slots match. Cedar inherits omitted size from Form/global settings: xs/sm map to sm; lg/xl map to lg. Maple defaults to md. Both inherit disabled/readonly from field > FormItem > Form, with explicit false overriding the parent. Form integration is local to each platform. ### Types SwitchProps, SwitchVariant, SwitchSize, SwitchValue, SwitchBeforeChange and SwitchInstance are exported from both root and component entries. ### Style variables | Token: Cedar uses --c-, Maple uses --mp- | Default | | --------------------------------------------------------- | ------------------------------------------------------- | | --c-switch-width / height / handle-size | 40px / 24px / 16px | | --c-switch-size-sm-scale / size-lg-scale | .8 / 1.2 | | --c-switch-tonal-width / tonal-height / tonal-handle-size | 52px / 32px / 24px | | --c-switch-line-height / line-handle-size | 12px / 20px | | --c-switch-hit-area | 0px; outward hit-area expansion without changing layout | | --c-switch-track-background / track-active-background | Neutral / theme color | | --c-switch-handle-background / handle-color | White / theme color | | --c-switch-disabled-opacity | .5 | | --c-switch-round-radius / gap | 4px / 4px | See style/token.less for all variables. Legacy platform-specific Switch geometry tokens are not guaranteed to remain. ## Migration Maple standard becomes line. Omitting variant now selects circle. Both platforms use four variants; standard is not retained as an alias. lazy-change is removed. before-change moves from a (value, change) callback to return-value/Promise control; applications no longer call change manually. Maple change now includes the original event as its second argument. checked-color/unchecked-color control the track consistently; tokens customize thumbs. ### Color variables and tonal foreground migration | Variable suffix: --c-switch- | Default system role | Responsibility | | ---------------------------- | ------------------- | ---------------------------------------------------------------- | | track-background | content-secondary | Ordinary unchecked solid track | | track-active-background | content-brand | Checked track and keyboard-focus ring | | track-error-background | content-danger | Interactive error track and tonal error border | | handle-background | surface-default | Ordinary/checked/error thumb fill | | handle-color | content-brand | Ordinary/checked/error thumb icon color | | text-color | surface-default | Text on a solid track | | checked-text-color | switch-text-color | Checked-track text; error retains existing foreground precedence | | tonal-track-background | surface-muted | Tonal unchecked-track background | | tonal-border-color | content-secondary | Tonal unchecked border and thumb fill | | tonal-text-color | content-secondary | Added: tonal unchecked-track text | | tonal-handle-color | surface-default | Added: tonal unchecked-thumb icon | Defaults reference matching system roles, e.g. var(--c-sys-color-content-secondary). Unchecked tonal uses tonal-text-color / tonal-handle-color; customize both ordinary and tonal foregrounds for all variants. Interactive errors use ordinary text/thumb pairing; disabled/loading suppress error colors. Custom tracks require foreground-contrast checks. Shadows, geometry and motion are outside this color contract. ### Theme names and variant names Theme entries are Themes.default.light/dark and Themes.maple.light/dark. Switch tonal is a variant, not a theme. Public variants and eight dedicated variables consistently use tonal without old-name aliases. ### Motion variables Built-in motion follows `prefers-reduced-motion: reduce`. Reduced motion does not prevent loading-state or close-event updates. | Token | Default | | ----------------------------- | ------- | | `--c-switch-loading-duration` | `1s` | ### Form field presentation and confirmation This component supports `edit-mode` with field > FormItem > Form precedence. When unset, it defaults to `direct` and preserves `direct` editing. Supported values: `direct / click / dblclick`. Non-`direct` modes open the editor through the field value trigger and keep one draft; v-model updates only after confirmation. Cancel, reset or enabling readPretty discards the draft. Cedar uses edit-mode="click" / "dblclick" to open an editor popup near the field. Enter/F2 also opens it; cancel/Escape discards the draft, and confirmation commits it. readPretty is an independent reading setting, separate from readonly and disabled. `before-commit(value, { previousValue, signal })` can reject an overlay save. FormItem validates the candidate first and keeps the editor open on failure. `open / default-open / update:open` control the editor. Use `#read="{ value, text }"` to customize display. See the full field comparison in Form. `read-pretty` is an independent boolean alongside `readonly` and `disabled`. It inherits from field to FormItem to Form; explicit `false` overrides the parent. The default is `false`. Reading mode renders no editor. ### Form state inheritance Omitted `disabled` / `readonly` inherit FormItem, then Form; an explicit `false` overrides inherited state. Becoming `disabled` or read-only invalidates a pending `beforeChange`, so a late result cannot toggle the value. Outside a form, omitted values behave as `false`. ## Inheriting Form disabled state The default disabled=undefined means inheritance, resolved as local ?? FormItem ?? Form ?? false. Explicit false remains effective, allowing one field to stay enabled while unspecified fields follow Form. Form disabled is the form-wide default, not a lock preventing child overrides. `empty-value` accepts explicit `null` (or `() => null`). Clearing publishes `null` unchanged; omitted values preserve the existing default. Editors render `null` as blank without converting ordinary empty-string input to `null`. In popup editing, clearing changes the draft; confirm commits it and cancel preserves the original model. ```vue ``` ```ts const beforeChange = (next, done) => { canChange(next).then((allowed) => done(allowed)); }; ``` Cancellable hooks use `(payload, done, context)`: closure payloads contain `{ action }`, change/commit payloads contain `{ value, previousValue }`, and Popup uses `{ reason }`. Context provides `signal` and an optional original `event`. Return a boolean/Promise, or call done()/done(false). Synchronous void waits for done; Promise<void> allows the operation. First completion wins. Pending state controls loading/disabled automatically. Cancellation invalidates stale results. Button refs are not exposed. ### Before-hook waiting feedback Before-hook waits show visible feedback and aria-busy. Rejected or failed operations recover; duplicate submissions do not start another copy. Notification event Promises never drive loading. --- Document: llms/en-US/components/table-column-manager.md # Table Column Manager Start with the basic example, then compare related settings before moving to controlled, asynchronous or combined use cases. ## Basic examples ### Basic usage - `options`: Supplies the available options. Example source: src/table-column-manager/__demos__/basic.vue ```vue ``` ## Table integration and persistence ### With Table Ungrouped #### Configuration reference for this comparison | Configuration | Purpose | Related examples | | --- | --- | --- | | `open` | Drawer visibility; `v-model:open` | With Table | | `columns` | Current Table columns; assembled back into full definitions on confirmation | With Table | | `options` | Left-side column definitions | With Table | | `drawer-title` | Drawer title | With Table | | `inline` | Render only the inline panel without a drawer | With Table | Preview configuration: `v-model:columns="columns"`, `extra-column`, `column-resizable`, `:data="data"`. Example source: src/table-column-manager/__demos__/with-table-ungrouped.vue ```vue