# Collet complete component API (0.6.1) Generated from `packages/core/custom-elements.json` and `scripts/component-config.mjs`. Do not infer prop names. Attribute names are kebab-case; framework props are the exact camelCase conversion. Object/array props use property binding. Optional props use Rust defaults. ## Accordion (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. | | `mode` | `mode` | `'single' \| 'multiple'` | no | `Rust default` | Expansion behavior: 'single' (only one panel open) or 'multiple' (independent panels). Allowed values: `single`, `multiple`. Example: `'single'`. | | `collapsible` | `collapsible` | `boolean` | no | `false` | Whether all panels can be collapsed (when false, one panel always remains open). Example: `true`. | | `heading-level` | `headingLevel` | `'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6'` | no | `Rust default` | HTML heading level (1–6) for the panel trigger elements. Allowed values: `h2`, `h3`, `h4`, `h5`, `h6`. Example: `'h2'`. | | `default-expanded` | `defaultExpanded` | `number[]` | no | `Rust default` | Positional panel indices (0-based) to expand on initial render, passed as a number[] property. Example: [0, 2]. Example: `[0]`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. | | `items` | `items` | `AccordionItem[]` | no | `Rust default` | Typed array of item data objects. Bind as a property; do not stringify it or use children for list items. Example: `[{ id: 'item-1', trigger_label: 'Section', panel_content: 'Content' }]`. | | `expanded` | `expanded` | `number[]` | no | `Rust default` | Controlled expanded state as a number[] property (for example [0, 2]). Updates on user interaction; never stringify it. Example: `[0, 2]`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `AccordionDetail`. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | `expand(index: number): void` | Expands the panel at the given index. | | `collapse(index: number): void` | Collapses the panel at the given index. | | `toggle(index: number): void` | Toggles the panel at the given index. Respects single/multiple mode. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Accordion } from '@colletdev/react/accordion'; void init({ components: ['accordion'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxAccordion } from '@colletdev/angular/accordion'; void init({ components: ['accordion'] }); @Component({ standalone: true, imports: [CxAccordion], template: ``, }) export class Example {} ``` ## ActivityGroup (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `status` | `status` | `'pending' \| 'done' \| 'error'` | no | `Rust default` | Current activity status indicator. Allowed values: `pending`, `done`, `error`. Example: `'pending'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `border` | `border` | `'auto' \| 'none'` | no | `Rust default` | Border treatment for the group. Allowed values: `auto`, `none`. Example: `'auto'`. | | `summary` | `summary` | `string` | no | `""` | Short summary text displayed in the collapsed state. Example: `'example'`. | | `action` | `action` | `'generic' \| 'read' \| 'write' \| 'edit' \| 'delete' \| 'search'` | no | `Rust default` | Which action this group represents — selects the leading icon. Allowed values: `generic`, `read`, `write`, `edit`, `delete`, `search`. Example: `'generic'`. | | `expanded` | `expanded` | `boolean` | no | `false` | Whether the activity group is expanded to show all parts. Example: `true`. | | `parts` | `parts` | `string[]` | no | `Rust default` | Array of activity parts. Each has type, content, and optional metadata. Example: `['item-1']`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `CollapsibleDetail`. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | `open(): void` | Expands the activity group panel. | | `close(): void` | Collapses the activity group panel. | | `toggle(): void` | Toggles the activity group expanded state. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { ActivityGroup } from '@colletdev/react/activity-group'; void init({ components: ['activity-group'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxActivityGroup } from '@colletdev/angular/activity-group'; void init({ components: ['activity-group'] }); @Component({ standalone: true, imports: [CxActivityGroup], template: ``, }) export class Example {} ``` ## Alert (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `title` | `title` | `string` | no | `""` | Title text. Example: `'Example title'`. | | `description` | `description` | `string` | no | `""` | Secondary descriptive text rendered inside Shadow DOM. Not the same as React children — use the `description` prop for helper text. Example: `'Additional context'`. | | `variant` | `variant` | `'subtle' \| 'filled' \| 'outline'` | no | `Rust default` | Visual style variant. Allowed values: `subtle`, `filled`, `outline`. Example: `'subtle'`. | | `intent` | `intent` | `'neutral' \| 'primary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | no | `Rust default` | Semantic color intent (e.g. primary, success, danger). Allowed values: `neutral`, `primary`, `info`, `success`, `warning`, `danger`. Example: `'neutral'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `show-icon` | `showIcon` | `boolean` | no | `true` | Whether to display the intent icon (default: true). Example: `true`. | | `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. | | `dismissible` | `dismissible` | `boolean` | no | `false` | Whether the component can be dismissed by the user. Example: `true`. | | `dismiss-label` | `dismissLabel` | `string` | no | `""` | Accessible label for the dismiss/close button. Example: `'example'`. | | `compact` | `compact` | `boolean` | no | `false` | Reduced-padding variant for inline or dense layouts. Example: `true`. | | `dynamic` | `dynamic` | `boolean` | no | `false` | Adds role="status" for live-region announcements. Example: `true`. | | `actions-html` | `actionsHtml` | `string` | no | `""` | Pre-rendered HTML for action buttons (e.g. retry, undo). Example: `'example'`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | `cx-dismiss` | `onDismiss` | `CustomEvent` | Fires when the user dismisses the component. Detail: `DismissDetail`. | ### Slots | Slot | Description | |---|---| | `actions` | Named slot for actions content | ### Methods | Method | Description | |---|---| | — | No imperative methods. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Alert } from '@colletdev/react/alert'; void init({ components: ['alert'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxAlert } from '@colletdev/angular/alert'; void init({ components: ['alert'] }); @Component({ standalone: true, imports: [CxAlert], template: ``, }) export class Example {} ``` ## Autocomplete (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `label` | `label` | `string` | yes | `—` | Visible label text. Example: `'Example label'`. | | `variant` | `variant` | `'outline' \| 'filled' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `outline`, `filled`, `ghost`. Example: `'outline'`. | | `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `mode` | `mode` | `'single' \| 'multiple'` | no | `Rust default` | 'single' for single select, 'multiple' for multi-select with chips. Allowed values: `single`, `multiple`. Example: `'single'`. | | `selected` | `selected` | `string[]` | no | `Rust default` | Currently selected item ID(s). Example: `['item-1']`. | | `query` | `query` | `string` | no | `""` | Current search query text. Controlled by onInput events. Example: `'example'`. | | `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text shown when empty. Example: `'Enter a value'`. | | `helper-text` | `helperText` | `string` | no | `""` | Helper text displayed below the input. Example: `'example'`. | | `error` | `error` | `string` | no | `""` | Error message text. When set, shows validation error styling. Example: `'This field is invalid'`. | | `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. | | `required` | `required` | `boolean` | no | `false` | Marks the field as required for form validation. Example: `true`. | | `readonly` | `readonly` | `boolean` | no | `false` | Makes the component read-only. Example: `true`. | | `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. | | `allow-custom` | `allowCustom` | `boolean` | no | `false` | When true, user can submit values not in the items list. Example: `true`. | | `clearable` | `clearable` | `boolean` | no | `false` | Whether a clear button appears when the field has a value. Example: `true`. | | `items` | `items` | `SelectOption[]` | no | `Rust default` | Options to filter from. Filtering is client-side (fuzzy substring match). For server-side search, update this array in your onInput handler. Example: `[{ value: 'a', label: 'Option A' }]`. | | `groups` | `groups` | `OptionGroup[]` | no | `Rust default` | Typed array of grouped item data. Bind as a property; do not stringify it or use children for groups. Example: `[{ label: 'Group', options: [{ value: 'a', label: 'Option A' }] }]`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `InputDetail`. | | `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `SelectDetail`. | | `cx-focus` | `onFocus` | `CustomEvent` | Fires when focus enters the component. Detail: `FocusDetail`. | | `cx-blur` | `onBlur` | `CustomEvent` | Fires when focus leaves the component. Detail: `FocusDetail`. | | `cx-keydown` | `onKeydown` | `CustomEvent` | Fires when a key is pressed inside the component. Detail: `KeyboardDetail`. | | `cx-keyup` | `onKeyup` | `CustomEvent` | Fires when a key is released inside the component. Detail: `KeyboardDetail`. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | `open(): void` | Opens the suggestion dropdown. | | `close(): void` | Closes the suggestion dropdown. | | `clear(): void` | Clears all selections (multi-mode) or the input (single-mode). | | `focus(): void` | Focuses the search input. | | `getValue(): string | string[]` | Returns the current selection. A single string in single mode, a string array in `mode="multiple"` — matching the shape of `cx-change`'s `detail.value`. | | `setValue(value: string | string[]): void` | Sets the selection programmatically. Accepts an array in `mode="multiple"`. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Autocomplete } from '@colletdev/react/autocomplete'; void init({ components: ['autocomplete'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxAutocomplete } from '@colletdev/angular/autocomplete'; void init({ components: ['autocomplete'] }); @Component({ standalone: true, imports: [CxAutocomplete], template: ``, }) export class Example {} ``` ## Avatar (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. | | `shape` | `shape` | `'circle' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `circle`, `rounded`. Example: `'circle'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `image` | `image` | `string` | no | `""` | URL of the image to display. Example: `'example'`. | | `initials` | `initials` | `string` | no | `""` | Fallback initials displayed when no image is available or while loading. Example: `'example'`. | | `clickable` | `clickable` | `boolean` | no | `false` | Makes the avatar a clickable button with hover and focus styles. Example: `true`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | — | — | — | No public events. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | — | No imperative methods. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Avatar } from '@colletdev/react/avatar'; void init({ components: ['avatar'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxAvatar } from '@colletdev/angular/avatar'; void init({ components: ['avatar'] }); @Component({ standalone: true, imports: [CxAvatar], template: ``, }) export class Example {} ``` ## Backdrop (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `tint` | `tint` | `'none' \| 'light' \| 'medium' \| 'heavy'` | no | `Rust default` | Darkness of the tint overlay. Allowed values: `none`, `light`, `medium`, `heavy`. Example: `'none'`. | | `blur` | `blur` | `'none' \| 'sm' \| 'md' \| 'lg'` | no | `Rust default` | Backdrop blur intensity. Allowed values: `none`, `sm`, `md`, `lg`. Example: `'none'`. | | `dismissible` | `dismissible` | `boolean` | no | `false` | Whether the component can be dismissed by the user. Example: `true`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | — | — | — | No public events. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | — | No imperative methods. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Backdrop } from '@colletdev/react/backdrop'; void init({ components: ['backdrop'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxBackdrop } from '@colletdev/angular/backdrop'; void init({ components: ['backdrop'] }); @Component({ standalone: true, imports: [CxBackdrop], template: ``, }) export class Example {} ``` ## Badge (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. | | `variant` | `variant` | `'filled' \| 'outline' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `filled`, `outline`, `ghost`. Example: `'filled'`. | | `intent` | `intent` | `'neutral' \| 'primary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | no | `Rust default` | Semantic color intent (e.g. primary, success, danger). Allowed values: `neutral`, `primary`, `info`, `success`, `warning`, `danger`. Example: `'neutral'`. | | `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `dot` | `dot` | `boolean` | no | `false` | Dot-only mode — renders a small colored indicator with no text. Example: `true`. | | `dismissible` | `dismissible` | `boolean` | no | `false` | Whether the component can be dismissed by the user. Example: `true`. | | `dismiss-label` | `dismissLabel` | `string` | no | `""` | Accessible label for the dismiss button (shown when dismissible is true). Example: `'example'`. | | `dynamic` | `dynamic` | `boolean` | no | `false` | Adds role="status" and aria-live="polite" for live-region announcements. Example: `true`. | ### Events | DOM event | React/Svelte callback | Type | Description | |---|---|---|---| | `cx-dismiss` | `onDismiss` | `CustomEvent` | Fires when the user dismisses the component. Detail: `DismissDetail`. | ### Slots | Slot | Description | |---|---| | — | No public slots. | ### Methods | Method | Description | |---|---| | — | No imperative methods. | ### Runnable examples #### Core / HTML Install: `npm install @colletdev/core` ```html ``` #### React Install: `npm install @colletdev/core @colletdev/react` ```tsx import { init } from '@colletdev/core'; import { Badge } from '@colletdev/react/badge'; void init({ components: ['badge'] }); export function Example() { return ; } ``` #### Vue Install: `npm install @colletdev/core @colletdev/vue` ```vue ``` #### Svelte Install: `npm install @colletdev/core @colletdev/svelte` ```svelte ``` #### Angular Install: `npm install @colletdev/core @colletdev/angular` ```ts import { Component } from '@angular/core'; import { init } from '@colletdev/core'; import { CxBadge } from '@colletdev/angular/badge'; void init({ components: ['badge'] }); @Component({ standalone: true, imports: [CxBadge], template: ``, }) export class Example {} ``` ## Breadcrumb (``) ### Props | Attribute | Framework prop | Type | Required | Default | Description and example | |---|---|---|---|---|---| | `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. | | `separator` | `separator` | `string` | no | `""` | Custom separator character or HTML between breadcrumb items (default: "/"). Example: `'example'`. | | `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. | | `nav-label` | `navLabel` | `string` | no | `""` | Accessible label for the