# 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
' }]} />;
}
```
#### Vue
Install: `npm install @colletdev/core @colletdev/vue`
```vue
```
#### Svelte
Install: `npm install @colletdev/core @colletdev/svelte`
```svelte
Hello' }]} />
```
#### Angular
Install: `npm install @colletdev/core @colletdev/angular`
```ts
import { Component } from '@angular/core';
import { init } from '@colletdev/core';
import { CxChat } from '@colletdev/angular/chat';
void init({ components: ['chat'] });
@Component({
standalone: true,
imports: [CxChat],
template: `Hello' }]">`,
})
export class Example {}
```
## ChatInput (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `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'`. |
| `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text shown when empty. Example: `'Enter a value'`. |
| `value` | `value` | `string` | no | `""` | Current value of the component. Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `max-rows` | `maxRows` | `number` | no | `0` | Maximum number of visible rows before the input scrolls. Example: `1`. |
| `show-action-button` | `showActionButton` | `boolean` | no | `true` | Whether to display the secondary action button. Example: `true`. |
| `action-label` | `actionLabel` | `string` | no | `""` | Accessible label for the secondary action button. Example: `'example'`. |
| `submit-label` | `submitLabel` | `string` | no | `""` | Accessible label for the submit/send button. Example: `'example'`. |
| `label` | `label` | `string` | no | `""` | Visible or screen-reader label for the message field. May be omitted only when ariaLabel supplies the accessible name. Example: `'Example label'`. |
| `max-length` | `maxLength` | `number` | no | `0` | Maximum character count. Displays a character counter when set. Example: `1`. |
| `accept-files` | `acceptFiles` | `boolean` | no | `false` | Whether to show the file attachment button. Example: `true`. |
| `accept` | `accept` | `string` | no | `""` | Accepted file types for the attachment button (MIME types or extensions). Example: `'image/*,.pdf'`. |
| `max-file-size` | `maxFileSize` | `number` | no | `0` | Maximum file size in bytes for attachments. Example: `1`. |
| `multiple-files` | `multipleFiles` | `boolean` | no | `false` | Whether multiple file selection is allowed for attachments. Example: `true`. |
| `submitting` | `submitting` | `boolean` | no | `false` | Whether a message is currently being submitted. Disables the send button and shows a loading state. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `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`. |
| `cx-submit` | `onSubmit` | `CustomEvent` | Fires when the user submits the current value. Detail: `ChatSubmitDetail`. |
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `InputDetail`. |
| `cx-file-add` | `onFileAdd` | `CustomEvent` | Fires after files are accepted for attachment. Detail: `FileAddDetail`. |
| `cx-file-remove` | `onFileRemove` | `CustomEvent` | Fires after an attachment is removed. Detail: `FileRemoveDetail`. |
| `cx-file-reject` | `onFileReject` | `CustomEvent` | Fires when files fail attachment validation. Detail: `FileRejectDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `focus(): void` | Focuses the textarea. |
| `getValue(): string` | Returns the current textarea value. |
| `setValue(value: string): void` | Sets the textarea value programmatically. |
| `addFiles(files: FileList): void` | Adds files programmatically to the attachment tray. |
| `getAttachments(): FileInfo[]` | Returns current attachments as FileInfo[]. |
| `clearAttachments(): void` | Removes all file attachments. |
### 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 { ChatInput } from '@colletdev/react/chat-input';
void init({ components: ['chat-input'] });
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 { CxChatInput } from '@colletdev/angular/chat-input';
void init({ components: ['chat-input'] });
@Component({
standalone: true,
imports: [CxChatInput],
template: ``,
})
export class Example {}
```
## Checkbox (``)
### 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'`. |
| `shape` | `shape` | `'sharp' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `checked` | `checked` | `boolean \| '' \| 'checked' \| 'indeterminate'` | no | `Rust default` | Three-state check. Accepts true/false as aliases for 'checked'/unchecked, and keeps 'indeterminate' for the third state. Allowed values: ``, `checked`, `indeterminate`. Example: `'checked'`. |
| `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`. |
| `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'`. |
| `unlabeled` | `unlabeled` | `boolean` | no | `false` | Renders the input without a visible label (still requires aria-label). Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `CheckedDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `CheckedDetail`. |
| `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 |
|---|---|
| `focus(): void` | Focuses the checkbox input. |
| `getValue(): string` | Returns the current checked state as a string. |
| `setValue(value: string): void` | Sets the checked state programmatically. |
### 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 { Checkbox } from '@colletdev/react/checkbox';
void init({ components: ['checkbox'] });
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 { CxCheckbox } from '@colletdev/angular/checkbox';
void init({ components: ['checkbox'] });
@Component({
standalone: true,
imports: [CxCheckbox],
template: ``,
})
export class Example {}
```
## CodeBlock (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `content` | `content` | `string` | no | `""` | Text content to display. Example: `'Example content'`. |
| `variant` | `variant` | `'default' \| 'minimal'` | no | `Rust default` | Visual style variant. Allowed values: `default`, `minimal`. Example: `'default'`. |
| `shape` | `shape` | `'rounded' \| 'sharp'` | no | `Rust default` | Corner radius style. Allowed values: `rounded`, `sharp`. Example: `'rounded'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `language` | `language` | `string` | no | `""` | Programming language for syntax highlighting. Example: `'example'`. |
| `filename` | `filename` | `string` | no | `""` | Name of the file displayed in the header. Example: `'example.rs'`. |
| `line-numbers` | `lineNumbers` | `boolean` | no | `true` | Whether to display line numbers in the gutter. Example: `true`. |
| `copy-button` | `copyButton` | `boolean` | no | `true` | Whether to show a copy-to-clipboard button. Example: `true`. |
| `traffic-lights` | `trafficLights` | `boolean` | no | `true` | Enables macOS-style traffic light dots in the header. Example: `true`. |
| `slotted` | `slotted` | `boolean` | no | `false` | Emits `` elements for Shadow DOM content projection. 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 { CodeBlock } from '@colletdev/react/code-block';
void init({ components: ['code-block'] });
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 { CxCodeBlock } from '@colletdev/angular/code-block';
void init({ components: ['code-block'] });
@Component({
standalone: true,
imports: [CxCodeBlock],
template: ``,
})
export class Example {}
```
## Collapsible (``)
### 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'`. |
| `trigger-html` | `triggerHtml` | `string` | no | `""` | Pre-rendered HTML for the trigger element that toggles the panel. Example: `'example'`. |
| `open` | `open` | `boolean` | no | `false` | Whether the collapsible panel is expanded. Example: `true`. |
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `no-icon` | `noIcon` | `boolean` | no | `false` | Hides the expand/collapse chevron icon. Example: `true`. |
| `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`. |
### 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 |
|---|---|
| `default` | Default slot (maps to content) |
| `trigger` | Named slot for trigger content |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Expands the collapsible content. |
| `close(): void` | Collapses the content. |
| `toggle(): void` | Toggles the collapsible 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 { Collapsible } from '@colletdev/react/collapsible';
void init({ components: ['collapsible'] });
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 { CxCollapsible } from '@colletdev/angular/collapsible';
void init({ components: ['collapsible'] });
@Component({
standalone: true,
imports: [CxCollapsible],
template: ``,
})
export class Example {}
```
## CommandPalette (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text for the search input. Example: `'Enter a value'`. |
| `shape` | `shape` | `'sharp' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `groups` | `groups` | `CxCommandGroup[]` | no | `Rust default` | Array of command groups. Each group has a label and array of items with id, label, optional icon/shortcut/description/disabled/href. Example: `[{ label: 'Actions', items: [{ id: 'save', label: 'Save' }] }]`. |
| `open` | `open` | `boolean` | no | `false` | Boolean. When set, opens the palette as a modal dialog. Remove to close. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-close` | `onClose` | `CustomEvent` | Fires when the component closes. Detail: `CloseDetail`. |
| `cx-select` | `onSelect` | `CustomEvent` | Fires when the user selects an item or data node. Detail: `CommandSelectDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the command palette as a modal dialog. |
| `close(): void` | Closes the command palette. |
| `toggle(): void` | Toggles the command palette open/closed. |
### 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 { CommandPalette } from '@colletdev/react/command-palette';
void init({ components: ['command-palette'] });
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 { CxCommandPalette } from '@colletdev/angular/command-palette';
void init({ components: ['command-palette'] });
@Component({
standalone: true,
imports: [CxCommandPalette],
template: ``,
})
export class Example {}
```
## DatePicker (``)
### 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'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `selected` | `selected` | `string` | no | `""` | Currently selected item ID(s). Example: `'example'`. |
| `min` | `min` | `string` | no | `""` | Earliest selectable date (ISO 8601 string). Example: `'example'`. |
| `max` | `max` | `string` | no | `""` | Latest selectable date (ISO 8601 string). Example: `'example'`. |
| `disabled-dates` | `disabledDates` | `string[]` | no | `Rust default` | Array of ISO date strings or date ranges to disable. Example: `['item-1']`. |
| `format` | `format` | `'iso' \| 'us-short' \| 'eu-short' \| 'eu-dot'` | no | `Rust default` | Date display format string. Allowed values: `iso`, `us-short`, `eu-short`, `eu-dot`. Example: `'iso'`. |
| `first-day` | `firstDay` | `'monday' \| 'sunday'` | no | `Rust default` | First day of the week (0=Sunday, 1=Monday, etc.). Allowed values: `monday`, `sunday`. Example: `'monday'`. |
| `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'`. |
| `viewing` | `viewing` | `string` | no | `""` | Currently displayed month/year (ISO string). Controls the calendar view without changing the selected value. Example: `'example'`. |
| `week-numbers` | `weekNumbers` | `boolean` | no | `false` | Whether to show ISO week numbers. Example: `true`. |
### 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: `InputDetail`. |
| `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 calendar panel. |
| `close(): void` | Closes the calendar panel. |
| `focus(): void` | Focuses the trigger button. |
| `getValue(): string` | Returns the current date value as ISO string. |
| `setValue(value: string): void` | Sets the date value programmatically (ISO format). |
### 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 { DatePicker } from '@colletdev/react/date-picker';
void init({ components: ['date-picker'] });
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 { CxDatePicker } from '@colletdev/angular/date-picker';
void init({ components: ['date-picker'] });
@Component({
standalone: true,
imports: [CxDatePicker],
template: ``,
})
export class Example {}
```
## Dialog (``)
### 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` | yes | `—` | Title text. Example: `'Example title'`. |
| `variant` | `variant` | `'standard' \| 'alert'` | no | `Rust default` | Visual style variant. Allowed values: `standard`, `alert`. Example: `'standard'`. |
| `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'`. |
| `size` | `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | no | `Rust default` | Dialog width preset: sm, md (default), lg, xl, or full. Allowed values: `sm`, `md`, `lg`, `xl`, `full`. Example: `'sm'`. |
| `close-button` | `closeButton` | `boolean` | no | `Rust default` | Whether to render a close button. Example: `true`. |
| `drawer` | `drawer` | `'bottom' \| 'left' \| 'right' \| 'centered'` | no | `Rust default` | Renders the dialog as a drawer (slides in from an edge instead of centering). Allowed values: `bottom`, `left`, `right`, `centered`. Example: `'bottom'`. |
| `open` | `open` | `boolean` | no | `false` | Whether the component is in an open/expanded state. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-close` | `onClose` | `CustomEvent` | Fires when the component closes. Detail: `CloseDetail`. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to body) |
| `footer` | Named slot for footer content |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the dialog modal with entrance animation. |
| `close(): void` | Closes the dialog modal with exit animation. |
| `toggle(): void` | Toggles the dialog open/close 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 { Dialog } from '@colletdev/react/dialog';
void init({ components: ['dialog'] });
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 { CxDialog } from '@colletdev/angular/dialog';
void init({ components: ['dialog'] });
@Component({
standalone: true,
imports: [CxDialog],
template: ``,
})
export class Example {}
```
## Drawer (``)
### 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` | yes | `—` | 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'`. |
| `side` | `side` | `'left' \| 'right' \| 'top' \| 'bottom'` | no | `Rust default` | Which viewport edge the drawer slides from (left, right, top, bottom). Allowed values: `left`, `right`, `top`, `bottom`. Example: `'left'`. |
| `size` | `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | no | `Rust default` | Component size. Allowed values: `sm`, `md`, `lg`, `xl`, `full`. Example: `'sm'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `close-button` | `closeButton` | `boolean` | no | `Rust default` | Whether to render a close button. Example: `true`. |
| `open` | `open` | `boolean` | no | `false` | Whether the component is in an open/expanded state. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-close` | `onClose` | `CustomEvent` | Fires when the component closes. Detail: `CloseDetail`. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to body) |
| `footer` | Named slot for footer content |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the drawer panel with slide-in animation. |
| `close(): void` | Closes the drawer panel with slide-out animation. |
| `toggle(): void` | Toggles the drawer open/close 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 { Drawer } from '@colletdev/react/drawer';
void init({ components: ['drawer'] });
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 { CxDrawer } from '@colletdev/angular/drawer';
void init({ components: ['drawer'] });
@Component({
standalone: true,
imports: [CxDrawer],
template: ``,
})
export class Example {}
```
## Fab (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `aria-label` | `ariaLabel` | `string` | no | `""` | Accessible label for screen readers when no visible label is present. Example: `'example'`. |
| `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` | `'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `rounded`, `pill`. Example: `'rounded'`. |
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | no | `Rust default` | Component size. Allowed values: `sm`, `md`, `lg`. Example: `'sm'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `has-popup` | `hasPopup` | `boolean` | no | `false` | ARIA attribute indicating the FAB triggers a popup (e.g. menu or dialog). Example: `true`. |
| `expanded` | `expanded` | `boolean` | no | `false` | Whether the component is in an expanded state. Example: `true`. |
| `controls` | `controls` | `string` | no | `""` | ID of the element this FAB controls (aria-controls). Example: `'example'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-click` | `onClick` | `CustomEvent` | Fires when the user activates the component. Detail: `ClickDetail`. |
### 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 { Fab } from '@colletdev/react/fab';
void init({ components: ['fab'] });
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 { CxFab } from '@colletdev/angular/fab';
void init({ components: ['fab'] });
@Component({
standalone: true,
imports: [CxFab],
template: ``,
})
export class Example {}
```
## FileUpload (``)
### 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` | `'inline' \| 'overlay'` | no | `Rust default` | Selection mode (single or multiple). Allowed values: `inline`, `overlay`. Example: `'inline'`. |
| `variant` | `variant` | `'outline' \| 'filled' \| 'subtle'` | no | `Rust default` | Visual style variant. Allowed values: `outline`, `filled`, `subtle`. 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'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `multiple` | `multiple` | `boolean` | no | `false` | Whether multiple file selection is allowed. Example: `true`. |
| `accept` | `accept` | `string` | no | `""` | Comma-separated list of accepted MIME types or extensions (e.g. "image/*,.pdf"). Example: `'image/*,.pdf'`. |
| `max-size` | `maxSize` | `number` | no | `Rust default` | Maximum file size in bytes. Example: `1`. |
| `heading` | `heading` | `string` | no | `""` | Heading text displayed in the drop zone. Example: `'example'`. |
| `browse-text` | `browseText` | `string` | no | `""` | Label text for the browse button. Example: `'example'`. |
| `hint` | `hint` | `string` | no | `""` | Helper text displayed below the component. Example: `'example'`. |
| `capture` | `capture` | `'user' \| 'environment'` | no | `Rust default` | Camera capture mode for mobile: 'user' (front) or 'environment' (back). Allowed values: `user`, `environment`. Example: `'user'`. |
| `preview` | `preview` | `boolean` | no | `false` | Whether to show file previews after selection. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `FileChangeDetail`. |
### 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 { FileUpload } from '@colletdev/react/file-upload';
void init({ components: ['file-upload'] });
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 { CxFileUpload } from '@colletdev/angular/file-upload';
void init({ components: ['file-upload'] });
@Component({
standalone: true,
imports: [CxFileUpload],
template: ``,
})
export class Example {}
```
## Flavour (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `preset` | `preset` | `'matte' \| 'aurora' \| 'gloss' \| 'grain' \| 'paper' \| 'linen' \| 'neon' \| 'blueprint' \| 'film'` | no | `Rust default` | Named preset configuration combining gradient, noise, and texture settings. Allowed values: `matte`, `aurora`, `gloss`, `grain`, `paper`, `linen`, `neon`, `blueprint`, `film`. Example: `'matte'`. |
| `gradient` | `gradient` | `GradientConfig` | no | `Rust default` | Gradient layer configuration with kind, angle, and color stops. Example: `{ angle: 135, stops: [{ color: '#7c3aed', position: 0 }] }`. |
| `noise` | `noise` | `NoiseConfig` | no | `Rust default` | Noise layer configuration with frequency, octaves, seed, opacity, and blend mode. Example: `{ opacity: 0.12 }`. |
| `texture` | `texture` | `TextureConfig` | no | `Rust default` | Texture layer configuration with kind, opacity, scale, and blend mode. Example: `{ kind: 'paper', opacity: 0.15 }`. |
| `overlay` | `overlay` | `OverlayConfig` | no | `Rust default` | Overlay layer configuration with color, opacity, and blend mode. Example: `{ color: '#000000', opacity: 0.2 }`. |
| `vignette` | `vignette` | `VignetteConfig` | no | `Rust default` | Vignette layer configuration with strength and radius. Example: `{ strength: 0.25, radius: 0.5 }`. |
| `opacity` | `opacity` | `number` | no | `Rust default` | Overall opacity of the decorative layers (0–1). Example: `1`. |
| `radius` | `radius` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| 'full'` | no | `Rust default` | Border radius for the flavour container. Allowed values: `none`, `sm`, `md`, `lg`, `xl`, `2xl`, `full`. Example: `'none'`. |
| `animate` | `animate` | `boolean` | no | `false` | Enables animated hue-rotate gradient + pulse layers. 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 { Flavour } from '@colletdev/react/flavour';
void init({ components: ['flavour'] });
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 { CxFlavour } from '@colletdev/angular/flavour';
void init({ components: ['flavour'] });
@Component({
standalone: true,
imports: [CxFlavour],
template: ``,
})
export class Example {}
```
## Label (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `text` | `text` | `string` | no | `""` | Visible label text; also serves as the accessible name. Example: `'example'`. |
| `for-input` | `forInput` | `string` | no | `""` | ID of the associated form control, bound via the native `for` attribute (enables click-to-focus and screen-reader pairing). Example: `'example'`. |
| `required` | `required` | `boolean` | no | `false` | Marks the field as required for form validation. Example: `true`. |
| `optional-text` | `optionalText` | `string` | no | `""` | Muted indicator text for non-required fields, e.g. "(optional)". Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `helper-text` | `helperText` | `string` | no | `""` | Helper text displayed below the input. Example: `'example'`. |
| `error-text` | `errorText` | `string` | no | `""` | Error message shown below the label; rendered in an assertive live region (`role="alert"`). Example: `'example'`. |
### 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 { Label } from '@colletdev/react/label';
void init({ components: ['label'] });
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 { CxLabel } from '@colletdev/angular/label';
void init({ components: ['label'] });
@Component({
standalone: true,
imports: [CxLabel],
template: ``,
})
export class Example {}
```
## Listbox (``)
### 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` | `'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'`. |
| `selection-mode` | `selectionMode` | `'none' \| 'single' \| 'multiple'` | no | `Rust default` | Selection behavior: none (display only), single (one item), or multiple (checkboxes). Allowed values: `none`, `single`, `multiple`. Example: `'none'`. |
| `selected` | `selected` | `string[]` | no | `Rust default` | Currently selected item ID(s). Example: `['item-1']`. |
| `items` | `items` | `SelectOption[]` | no | `Rust default` | Typed array of item data objects. Bind as a property; do not stringify it or use children for list items. 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-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 |
|---|---|
| — | 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 { Listbox } from '@colletdev/react/listbox';
void init({ components: ['listbox'] });
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 { CxListbox } from '@colletdev/angular/listbox';
void init({ components: ['listbox'] });
@Component({
standalone: true,
imports: [CxListbox],
template: ``,
})
export class Example {}
```
## Menu (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `trigger-label` | `triggerLabel` | `string` | no | `""` | Accessible label for the trigger button. Example: `'example'`. |
| `entries` | `entries` | `MenuEntry[]` | no | `Rust default` | Menu or split-button entry definitions. Each entry has an `id` field — this is what `MenuActionDetail.id` returns in action events. Example: `[{ id: 'edit', label: 'Edit', icon: 'pencil' }]`. |
| `variant` | `variant` | `'filled' \| 'outline' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `filled`, `outline`, `ghost`. Example: `'filled'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `width` | `width` | `'auto' \| 'sm' \| 'md' \| 'lg'` | no | `Rust default` | Menu panel width preset. Allowed values: `auto`, `sm`, `md`, `lg`. Example: `'auto'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-action` | `onAction` | `CustomEvent` | Fires when the user activates an action item. Detail: `MenuActionDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `MenuChangeDetail`. |
| `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 menu dropdown. |
| `close(): void` | Closes the menu dropdown. |
### 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 { Menu } from '@colletdev/react/menu';
void init({ components: ['menu'] });
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 { CxMenu } from '@colletdev/angular/menu';
void init({ components: ['menu'] });
@Component({
standalone: true,
imports: [CxMenu],
template: ``,
})
export class Example {}
```
## MessageBubble (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `message-role` | `messageRole` | `string` | no | `""` | Role of the message sender (user or assistant). Example: `'example'`. |
| `variant` | `variant` | `'filled' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `filled`, `ghost`. Example: `'filled'`. |
| `shape` | `shape` | `'sharp' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `alignment` | `alignment` | `'auto' \| 'start' \| 'end'` | no | `Rust default` | Content alignment. Allowed values: `auto`, `start`, `end`. Example: `'auto'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `content` | `content` | `string` | no | `""` | Text content to display. Example: `'Example content'`. |
| `html-content` | `htmlContent` | `string` | no | `""` | Pre-rendered HTML content for the message body. Example: `'example'`. |
| `sender-name` | `senderName` | `string` | no | `""` | Display name of the message sender. Example: `'example'`. |
| `timestamp` | `timestamp` | `string` | no | `""` | Timestamp text displayed with the message. Example: `'example'`. |
| `border` | `border` | `'auto' \| 'none'` | no | `Rust default` | Border treatment for the bubble: `auto` follows the variant, `none` removes it. Allowed values: `auto`, `none`. Example: `'auto'`. |
| `animated` | `animated` | `boolean` | no | `false` | Whether to animate transitions between states. Example: `true`. |
| `role` | `role` | `'user' \| 'assistant'` | no | `Rust default` | Message role: 'user' or 'assistant'. Controls alignment and styling. Allowed values: `user`, `assistant`. Example: `'user'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| — | — | — | No public events. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to 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 { MessageBubble } from '@colletdev/react/message-bubble';
void init({ components: ['message-bubble'] });
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 { CxMessageBubble } from '@colletdev/angular/message-bubble';
void init({ components: ['message-bubble'] });
@Component({
standalone: true,
imports: [CxMessageBubble],
template: ``,
})
export class Example {}
```
## MessageGroup (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `message-role` | `messageRole` | `string` | no | `""` | Role of the message sender (user or assistant). Example: `'example'`. |
| `alignment` | `alignment` | `'auto' \| 'start' \| 'end'` | no | `Rust default` | Content alignment. Allowed values: `auto`, `start`, `end`. Example: `'auto'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `sender-name` | `senderName` | `string` | no | `""` | Display name shown in the group header. Example: `'example'`. |
| `animated` | `animated` | `boolean` | no | `false` | Whether to animate transitions between states. Example: `true`. |
| `parts` | `parts` | `MessageGroupPart[]` | no | `Rust default` | Array of message parts in this group. Example: `[{ kind: 'text', content: 'Hello' }]`. |
| `role` | `role` | `'user' \| 'assistant'` | no | `Rust default` | Message role: 'user' or 'assistant'. Controls alignment and styling for all messages in the group. Allowed values: `user`, `assistant`. Example: `'user'`. |
### 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 { MessageGroup } from '@colletdev/react/message-group';
void init({ components: ['message-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 { CxMessageGroup } from '@colletdev/angular/message-group';
void init({ components: ['message-group'] });
@Component({
standalone: true,
imports: [CxMessageGroup],
template: ``,
})
export class Example {}
```
## MessagePart (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `kind` | `kind` | `'text' \| 'tool-call' \| 'tool-result' \| 'thinking' \| 'code-block' \| 'error' \| 'preview'` | no | `Rust default` | Part type: text, tool-call, tool-result, attachment, or markdown. Allowed values: `text`, `tool-call`, `tool-result`, `thinking`, `code-block`, `error`, `preview`. Example: `'text'`. |
| `connection` | `connection` | `'standalone' \| 'first' \| 'middle' \| 'last'` | no | `Rust default` | Visual connection style to adjacent parts (none, top, middle, bottom). Allowed values: `standalone`, `first`, `middle`, `last`. Example: `'standalone'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `content` | `content` | `string` | no | `""` | Text content to display. Example: `'Example content'`. |
| `html-content` | `htmlContent` | `string` | no | `""` | Pre-rendered HTML content injected into Shadow DOM. Example: `'example'`. |
| `tool-name` | `toolName` | `string` | no | `""` | Name of the tool being called (for tool-call parts). Example: `'example'`. |
| `tool-arguments` | `toolArguments` | `string` | no | `""` | JSON string of arguments passed to the tool call. Example: `'example'`. |
| `tool-status` | `toolStatus` | `'pending' \| 'success' \| 'error'` | no | `Rust default` | Execution status of the tool call (running, complete, error). Allowed values: `pending`, `success`, `error`. Example: `'pending'`. |
| `tool-action` | `toolAction` | `'generic' \| 'read' \| 'write' \| 'edit' \| 'delete' \| 'search'` | no | `Rust default` | Pre-rendered HTML for a tool action button (e.g. approve, retry). Allowed values: `generic`, `read`, `write`, `edit`, `delete`, `search`. Example: `'generic'`. |
| `description` | `description` | `string` | no | `""` | Description text for tool calls or attachments. Example: `'Additional context'`. |
| `collapsible` | `collapsible` | `boolean` | no | `false` | Whether the part can be collapsed. Example: `true`. |
| `completed` | `completed` | `boolean` | no | `false` | Whether the tool call or operation has finished. Example: `true`. |
| `border` | `border` | `'auto' \| 'none' \| 'subtle'` | no | `Rust default` | Border treatment. `auto` follows the variant; `none` removes it; `subtle` renders a lighter rule. Allowed values: `auto`, `none`, `subtle`. Example: `'auto'`. |
| `thinking-label` | `thinkingLabel` | `string` | no | `""` | Label text for the collapsible thinking section header. Example: `'example'`. |
| `language` | `language` | `string` | no | `""` | Programming language for syntax-highlighted code parts. Example: `'example'`. |
| `filename` | `filename` | `string` | no | `""` | Name of the file displayed in the header. Example: `'example.rs'`. |
| `markdown` | `markdown` | `boolean` | no | `false` | Whether to render content as Markdown. Example: `true`. |
| `slotted` | `slotted` | `boolean` | no | `false` | Emits `` elements for Shadow DOM content projection. Example: `true`. |
| `attachment-name` | `attachmentName` | `string` | no | `""` | Filename of the attachment. Example: `'example'`. |
| `attachment-size` | `attachmentSize` | `number` | no | `Rust default` | Human-readable file size string (e.g. "2.4 MB"). Example: `1`. |
| `attachment-type` | `attachmentType` | `string` | no | `""` | MIME type of the attachment. Example: `'example'`. |
| `attachment-thumbnail` | `attachmentThumbnail` | `string` | no | `""` | URL for the attachment thumbnail image. Example: `'example'`. |
| `stream` | `stream` | `boolean` | no | `false` | When present, enables imperative streaming mode: the streaming parser owns the DOM (via startStream/appendTokens/endStream) and WASM re-render is suppressed. Fires `cx-stream-end` when finalized. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-stream-end` | `onStreamEnd` | `CustomEvent` | Fires after streamed content is finalized and sanitized. Detail: `StreamEndDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `startStream(): Promise` | Initializes the streaming Markdown parser. |
| `appendTokens(text: string): void` | Appends a Markdown token chunk to the active stream. |
| `endStream(): Promise` | Finalizes and sanitizes the active stream. |
### 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 { MessagePart } from '@colletdev/react/message-part';
void init({ components: ['message-part'] });
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 { CxMessagePart } from '@colletdev/angular/message-part';
void init({ components: ['message-part'] });
@Component({
standalone: true,
imports: [CxMessagePart],
template: ``,
})
export class Example {}
```
## MessageTimeline (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `message-role` | `messageRole` | `string` | no | `""` | Role of the message sender (user or assistant). Example: `'example'`. |
| `alignment` | `alignment` | `'auto' \| 'start' \| 'end'` | no | `Rust default` | Content alignment. Allowed values: `auto`, `start`, `end`. Example: `'auto'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `sender-name` | `senderName` | `string` | no | `""` | Display name of the message sender. Example: `'example'`. |
| `events` | `events` | `TimelineEvent[]` | no | `Rust default` | Array of timeline event objects to display. Example: `[{ type: 'text-done', id: 'event-1', content: 'Started' }]`. |
| `role` | `role` | `'user' \| 'assistant'` | no | `Rust default` | Message role for visual alignment (user or assistant). Allowed values: `user`, `assistant`. Example: `'user'`. |
### 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 { MessageTimeline } from '@colletdev/react/message-timeline';
void init({ components: ['message-timeline'] });
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 { CxMessageTimeline } from '@colletdev/angular/message-timeline';
void init({ components: ['message-timeline'] });
@Component({
standalone: true,
imports: [CxMessageTimeline],
template: ``,
})
export class Example {}
```
## Pagination (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `current-page` | `currentPage` | `number` | no | `0` | Currently active page number (1-based). Example: `1`. |
| `page-size` | `pageSize` | `number` | no | `0` | Number of items per page. Example: `10`. |
| `total-items` | `totalItems` | `number` | no | `0` | Total number of items across all pages. Example: `1`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `show-info` | `showInfo` | `boolean` | no | `true` | Whether to display "Page X of Y" info text. Example: `true`. |
| `show-prev-next` | `showPrevNext` | `boolean` | no | `true` | Whether to show previous/next navigation buttons. Example: `true`. |
| `variant` | `variant` | `'pages' \| 'load-more'` | no | `Rust default` | Visual style variant. Allowed values: `pages`, `load-more`. Example: `'pages'`. |
| `prev-label` | `prevLabel` | `string` | no | `""` | Accessible label for the previous page button. Example: `'example'`. |
| `next-label` | `nextLabel` | `string` | no | `""` | Accessible label for the next page button. Example: `'example'`. |
| `load-more-label` | `loadMoreLabel` | `string` | no | `""` | Label text for the "load more" button in infinite scroll mode. Example: `'example'`. |
| `page-size-options` | `pageSizeOptions` | `number[]` | no | `Rust default` | Array of page size options for the page size selector. Example: `[10, 25, 50]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `PageDetail`. |
### 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 { Pagination } from '@colletdev/react/pagination';
void init({ components: ['pagination'] });
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 { CxPagination } from '@colletdev/angular/pagination';
void init({ components: ['pagination'] });
@Component({
standalone: true,
imports: [CxPagination],
template: ``,
})
export class Example {}
```
## Popover (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `trigger-label` | `triggerLabel` | `string` | no | `""` | Accessible label for the trigger button. Example: `'example'`. |
| `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'`. |
| `width` | `width` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'auto'` | no | `Rust default` | Popover panel width preset. Allowed values: `sm`, `md`, `lg`, `xl`, `auto`. Example: `'sm'`. |
| `placement` | `placement` | `'top' \| 'bottom'` | no | `Rust default` | Preferred placement relative to the trigger (top, bottom, left, right). Allowed values: `top`, `bottom`. Example: `'top'`. |
| `align` | `align` | `'start' \| 'center' \| 'end'` | no | `Rust default` | Alignment along the placement axis (start, center, end). Allowed values: `start`, `center`, `end`. Example: `'start'`. |
| `arrow` | `arrow` | `boolean` | no | `false` | Whether to show an arrow pointing to the trigger. Example: `true`. |
| `close-button` | `closeButton` | `boolean` | no | `false` | Whether to render a close button. Example: `true`. |
| `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'`. |
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| — | — | — | No public events. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to content) |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the popover panel. |
| `close(): void` | Closes the popover panel. |
### 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 { Popover } from '@colletdev/react/popover';
void init({ components: ['popover'] });
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 { CxPopover } from '@colletdev/angular/popover';
void init({ components: ['popover'] });
@Component({
standalone: true,
imports: [CxPopover],
template: ``,
})
export class Example {}
```
## ProfileMenu (``)
### 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'`. |
| `image` | `image` | `string` | no | `""` | URL of the image to display. Example: `'example'`. |
| `initials` | `initials` | `string` | no | `""` | Fallback initials displayed when no avatar image is available. Example: `'example'`. |
| `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'`. |
| `width` | `width` | `'auto' \| 'sm' \| 'md' \| 'lg'` | no | `Rust default` | Dropdown panel width preset. Allowed values: `auto`, `sm`, `md`, `lg`. Example: `'auto'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `entries` | `entries` | `MenuEntry[]` | no | `Rust default` | Menu or split-button entry definitions. Each entry has an `id` field — this is what `MenuActionDetail.id` returns in action events. Example: `[{ id: 'edit', label: 'Edit', icon: 'pencil' }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-action` | `onAction` | `CustomEvent` | Fires when the user activates an action item. Detail: `MenuActionDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `MenuChangeDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the profile menu dropdown. |
| `close(): void` | Closes the profile menu dropdown. |
### 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 { ProfileMenu } from '@colletdev/react/profile-menu';
void init({ components: ['profile-menu'] });
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 { CxProfileMenu } from '@colletdev/angular/profile-menu';
void init({ components: ['profile-menu'] });
@Component({
standalone: true,
imports: [CxProfileMenu],
template: ``,
})
export class Example {}
```
## Progress (``)
### 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'`. |
| `value` | `value` | `number` | no | `Rust default` | Percentage 0–100. No max prop — the component assumes max=100. Example: `1`. |
| `value-text` | `valueText` | `string` | no | `""` | Accessible text representation of the current value (e.g. "75%"). Example: `'example'`. |
| `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` | `'rounded' \| 'sharp' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `rounded`, `sharp`, `pill`. Example: `'rounded'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
### 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 { Progress } from '@colletdev/react/progress';
void init({ components: ['progress'] });
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 { CxProgress } from '@colletdev/angular/progress';
void init({ components: ['progress'] });
@Component({
standalone: true,
imports: [CxProgress],
template: ``,
})
export class Example {}
```
## RadioGroup (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. |
| `legend` | `legend` | `string` | yes | `—` | Fieldset legend text for the radio group. Example: `'Choose an option'`. |
| `shape` | `shape` | `'round' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `round`, `rounded`. Example: `'round'`. |
| `orientation` | `orientation` | `'vertical' \| 'horizontal'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `vertical`, `horizontal`. Example: `'vertical'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `selected` | `selected` | `string` | no | `""` | Currently selected item ID(s). Example: `'example'`. |
| `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`. |
| `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'`. |
| `options` | `options` | `RadioOption[]` | no | `Rust default` | Typed array of selectable options. Bind as a property; do not stringify it or use children for options. Example: `[{ 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: `SelectDetail`. |
| `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 |
|---|---|
| `getValue(): string` | Returns the selected radio value. |
| `setValue(value: string): void` | Sets the selected radio value. |
### 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 { RadioGroup } from '@colletdev/react/radio-group';
void init({ components: ['radio-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 { CxRadioGroup } from '@colletdev/angular/radio-group';
void init({ components: ['radio-group'] });
@Component({
standalone: true,
imports: [CxRadioGroup],
template: ``,
})
export class Example {}
```
## ScrollArea (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `track` | `track` | `'with-track' \| 'floating'` | no | `Rust default` | Scrollbar track treatment: a visible track gutter, or a floating thumb over the content. Allowed values: `with-track`, `floating`. Example: `'with-track'`. |
| `axis` | `axis` | `'vertical' \| 'horizontal' \| 'both'` | no | `Rust default` | Scroll axis: vertical, horizontal, or both. Allowed values: `vertical`, `horizontal`, `both`. Example: `'vertical'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `height` | `height` | `string` | no | `""` | Fixed height for the scroll container. Example: `'h-[600px]'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `auto-scroll` | `autoScroll` | `'off' \| 'bottom-stick'` | no | `Rust default` | Automatically scrolls to the bottom when new content is added. Allowed values: `off`, `bottom-stick`. Example: `'off'`. |
| `new-content-label` | `newContentLabel` | `string` | no | `""` | Accessible label for the "new content" indicator button. Example: `'example'`. |
| `log-role` | `logRole` | `boolean` | no | `false` | Adds role="log" for chat-style containers with live content. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-scroll-end` | `onScrollEnd` | `CustomEvent` | Fires when the scroll container reaches its end. Detail: `ScrollEndDetail`. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to content) |
### Methods
| Method | Description |
|---|---|
| `scrollToBottom(): void` | Scrolls content to the bottom. |
| `scrollToTop(): void` | Scrolls content to the top. |
| `recalculate(): void` | Recalculates scrollbar thumb size and position after dynamic content changes. |
### 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 { ScrollArea } from '@colletdev/react/scroll-area';
void init({ components: ['scroll-area'] });
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 { CxScrollArea } from '@colletdev/angular/scroll-area';
void init({ components: ['scroll-area'] });
@Component({
standalone: true,
imports: [CxScrollArea],
template: ``,
})
export class Example {}
```
## Scrollbar (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `track` | `track` | `'with-track' \| 'floating'` | no | `Rust default` | Scrollbar track treatment: a visible track gutter, or a floating thumb over the content. Allowed values: `with-track`, `floating`. Example: `'with-track'`. |
| `axis` | `axis` | `'vertical' \| 'horizontal' \| 'both'` | no | `Rust default` | Scroll axis: vertical or horizontal. Allowed values: `vertical`, `horizontal`, `both`. Example: `'vertical'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `height` | `height` | `string` | no | `""` | Height of the scrollable container. Example: `'h-[600px]'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| — | — | — | No public events. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to content) |
### Methods
| Method | Description |
|---|---|
| `recalculate(): void` | Recalculates scrollbar thumb size and position after dynamic content changes. |
### 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 { Scrollbar } from '@colletdev/react/scrollbar';
void init({ components: ['scrollbar'] });
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 { CxScrollbar } from '@colletdev/angular/scrollbar';
void init({ components: ['scrollbar'] });
@Component({
standalone: true,
imports: [CxScrollbar],
template: ``,
})
export class Example {}
```
## SearchBar (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text shown when empty. Example: `'Enter a value'`. |
| `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'`. |
| `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. |
| `value` | `value` | `string` | no | `""` | Current value of the component. Example: `'example'`. |
| `loading` | `loading` | `boolean` | no | `false` | Whether the component is in a loading state. Example: `true`. |
| `shortcut` | `shortcut` | `string` | no | `""` | Keyboard shortcut hint displayed in the search bar (e.g. "Ctrl+K"). Example: `'example'`. |
| `expandable` | `expandable` | `boolean` | no | `false` | Collapses to an icon button and expands on click/focus. Example: `true`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `readonly` | `readonly` | `boolean` | no | `false` | Makes the component read-only. Example: `true`. |
| `controls` | `controls` | `string` | no | `""` | ID of the element this search bar controls (aria-controls). Example: `'example'`. |
| `shimmer` | `shimmer` | `boolean` | no | `false` | Enables a one-shot gradient sweep animation on the placeholder text when focused. 10-second cooldown between triggers. Example: `true`. |
| `debounce-ms` | `debounceMs` | `number` | no | `Rust default` | Debounce delay in milliseconds before emitting search events. Example: `1`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `InputDetail`. |
| `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`. |
| `cx-submit` | `onSubmit` | `CustomEvent` | Fires when the user submits the current value. Detail: `InputDetail`. |
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `InputDetail`. |
| `cx-clear` | `onClear` | `CustomEvent` | Fires after the current value is cleared. Detail: `ClearDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `focus(): void` | Focuses the search input. |
| `clear(): void` | Clears the search input value. |
| `getValue(): string` | Returns the current search query. |
| `setValue(value: string): void` | Sets the search query programmatically. |
### 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 { SearchBar } from '@colletdev/react/search-bar';
void init({ components: ['search-bar'] });
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 { CxSearchBar } from '@colletdev/angular/search-bar';
void init({ components: ['search-bar'] });
@Component({
standalone: true,
imports: [CxSearchBar],
template: ``,
})
export class Example {}
```
## Select (``)
### 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` | Selection mode (single or multiple). Allowed values: `single`, `multiple`. Example: `'single'`. |
| `selected` | `selected` | `string[]` | no | `Rust default` | Currently selected item ID(s). Example: `['item-1']`. |
| `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`. |
| `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. |
| `items` | `items` | `SelectOption[]` | no | `Rust default` | Typed array of item data objects. Bind as a property; do not stringify it or use children for list items. 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 dropdown. |
| `close(): void` | Closes the dropdown. |
| `focus(): void` | Focuses the trigger button. |
| `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 { Select } from '@colletdev/react/select';
void init({ components: ['select'] });
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 { CxSelect } from '@colletdev/angular/select';
void init({ components: ['select'] });
@Component({
standalone: true,
imports: [CxSelect],
template: ``,
})
export class Example {}
```
## Separator (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `variant` | `variant` | `'solid' \| 'dashed' \| 'dotted'` | no | `Rust default` | Visual style variant. Allowed values: `solid`, `dashed`, `dotted`. Example: `'solid'`. |
| `orientation` | `orientation` | `'horizontal' \| 'vertical'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `horizontal`, `vertical`. Example: `'horizontal'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `semantic` | `semantic` | `boolean` | no | `false` | When true, exposes the separator to assistive tech as a meaningful boundary (`role="separator"`) instead of a decorative divider. Example: `true`. |
| `decorative` | `decorative` | `boolean` | no | `false` | When true, marks the separator as purely visual, hiding it from the accessibility tree (`role="none"` + `aria-hidden="true"`). 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 { Separator } from '@colletdev/react/separator';
void init({ components: ['separator'] });
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 { CxSeparator } from '@colletdev/angular/separator';
void init({ components: ['separator'] });
@Component({
standalone: true,
imports: [CxSeparator],
template: ``,
})
export class Example {}
```
## Sidebar (``)
### 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'`. |
| `side` | `side` | `'left' \| 'right'` | no | `Rust default` | Which viewport edge the component anchors to. Allowed values: `left`, `right`. Example: `'left'`. |
| `state` | `state` | `'expanded' \| 'narrow' \| 'hidden'` | no | `Rust default` | Sidebar state: expanded, collapsed, or auto. Allowed values: `expanded`, `narrow`, `hidden`. Example: `'expanded'`. |
| `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'`. |
| `mobile-actions` | `mobileActions` | `string` | no | `""` | Pre-rendered HTML for action buttons in the mobile bar trailing zone. Example: `'example'`. |
| `separators-after` | `separatorsAfter` | `number[]` | no | `Rust default` | Array of group indices after which to render a visual separator. Example: `[10, 25, 50]`. |
| `groups` | `groups` | `SidebarGroup[]` | no | `Rust default` | Navigation groups. Each group has a label and array of NavItem entries. Example: `[{ label: 'Main', items: [{ id: 'home', label: 'Home', href: '/' }] }]`. |
| `open` | `open` | `boolean` | no | `false` | Whether the component is in an open/expanded state. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-close` | `onClose` | `CustomEvent` | Fires when the component closes. Detail: `CloseDetail`. |
| `cx-navigate` | `onNavigate` | `CustomEvent` | Fires when the user activates a navigation item. Detail: `NavigateDetail`. |
| `cx-toggle` | `onToggle` | `CustomEvent` | Fires when the expanded or narrow state toggles. Detail: `SidebarToggleDetail`. |
### Slots
| Slot | Description |
|---|---|
| `header` | Named slot for header content |
| `footer` | Named slot for footer content |
| `mobile-leading` | Named slot for mobile-leading content |
| `mobile-trailing` | Named slot for mobile-trailing content |
| `mobile-header` | Named slot for mobile-header content |
| `mobile-footer` | Named slot for mobile-footer content |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the mobile sidebar drawer. |
| `close(): void` | Closes the mobile sidebar drawer. |
| `toggle(): void` | Toggles the mobile sidebar drawer open/close 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 { Sidebar } from '@colletdev/react/sidebar';
void init({ components: ['sidebar'] });
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 { CxSidebar } from '@colletdev/angular/sidebar';
void init({ components: ['sidebar'] });
@Component({
standalone: true,
imports: [CxSidebar],
template: ``,
})
export class Example {}
```
## Skeleton (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `variant` | `variant` | `'text' \| 'circle' \| 'rectangular'` | no | `Rust default` | Visual style variant. Allowed values: `text`, `circle`, `rectangular`. Example: `'text'`. |
| `animation` | `animation` | `'pulse' \| 'wave'` | no | `Rust default` | Animation style: 'pulse' (default) or 'wave'. Allowed values: `pulse`, `wave`. Example: `'pulse'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `lines` | `lines` | `number` | no | `Rust default` | Number of skeleton text lines to render. Example: `1`. |
### 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 { Skeleton } from '@colletdev/react/skeleton';
void init({ components: ['skeleton'] });
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 { CxSkeleton } from '@colletdev/angular/skeleton';
void init({ components: ['skeleton'] });
@Component({
standalone: true,
imports: [CxSkeleton],
template: ``,
})
export class Example {}
```
## Slider (``)
### 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'`. |
| `aria-label` | `ariaLabel` | `string` | no | `""` | Accessible label for screen readers when no visible label is present. Example: `'example'`. |
| `value` | `value` | `number` | no | `50` | Current value of the component. Example: `1`. |
| `min` | `min` | `number` | no | `0` | Minimum allowed value. Example: `1`. |
| `max` | `max` | `number` | no | `100` | Maximum allowed value. Example: `100`. |
| `step` | `step` | `number` | no | `1` | Step increment between allowed values. Example: `1`. |
| `orientation` | `orientation` | `'horizontal' \| 'vertical'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `horizontal`, `vertical`. Example: `'horizontal'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `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-value` | `showValue` | `boolean` | no | `true` | Whether to display the current value label. Example: `true`. |
| `value-text` | `valueText` | `string` | no | `""` | Accessible text representation of the current value (e.g. "$50"). Example: `'example'`. |
| `helper-text` | `helperText` | `string` | no | `""` | Helper text displayed below the input. Example: `'example'`. |
| `error-text` | `errorText` | `string` | no | `""` | Error message text displayed below the slider. Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `unlabeled` | `unlabeled` | `boolean` | no | `false` | Renders the input without a visible label (still requires aria-label). Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `SliderDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `SliderDetail`. |
| `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 |
|---|---|
| `focus(): void` | Focuses the range input. |
| `getValue(): string` | Returns the current slider value. |
| `setValue(value: string): void` | Sets the slider value programmatically. |
### 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 { Slider } from '@colletdev/react/slider';
void init({ components: ['slider'] });
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 { CxSlider } from '@colletdev/angular/slider';
void init({ components: ['slider'] });
@Component({
standalone: true,
imports: [CxSlider],
template: ``,
})
export class Example {}
```
## SpeedDial (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `aria-label` | `ariaLabel` | `string` | no | `""` | Accessible label for screen readers when no visible label is present. Example: `'example'`. |
| `close-icon` | `closeIcon` | `string` | no | `""` | Icon shown on the FAB when the speed dial is open (default: X/close). Example: `'example'`. |
| `variant` | `variant` | `'filled' \| 'outline' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `filled`, `outline`, `ghost`. Example: `'filled'`. |
| `shape` | `shape` | `'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `rounded`, `pill`. Example: `'rounded'`. |
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | no | `Rust default` | Component size. Allowed values: `sm`, `md`, `lg`. Example: `'sm'`. |
| `direction` | `direction` | `'up' \| 'down' \| 'left' \| 'right'` | no | `Rust default` | Direction actions expand from the FAB trigger (up, down, left, right). Allowed values: `up`, `down`, `left`, `right`. Example: `'up'`. |
| `backdrop` | `backdrop` | `boolean` | no | `true` | Whether to show a backdrop overlay when the speed dial is open. Example: `true`. |
| `tooltips` | `tooltips` | `boolean` | no | `true` | Whether to show tooltip labels next to action items. Example: `true`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `actions` | `actions` | `SpeedDialAction[]` | no | `Rust default` | Array of action items. Each has id, label, icon, optional disabled/href. Example: `[{ id: 'create', label: 'Create', icon: 'plus' }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-action` | `onAction` | `CustomEvent` | Fires when the user activates an action item. Detail: `MenuActionDetail`. |
| `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` | Opens the speed dial action menu. |
| `close(): void` | Closes the speed dial action menu. |
| `toggle(): void` | Toggles the speed dial action menu. |
### 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 { SpeedDial } from '@colletdev/react/speed-dial';
void init({ components: ['speed-dial'] });
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 { CxSpeedDial } from '@colletdev/angular/speed-dial';
void init({ components: ['speed-dial'] });
@Component({
standalone: true,
imports: [CxSpeedDial],
template: ``,
})
export class Example {}
```
## Spinner (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `variant` | `variant` | `'circle' \| 'square' \| 'morph'` | no | `Rust default` | Visual style variant. Allowed values: `circle`, `square`, `morph`. Example: `'circle'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
### 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 { Spinner } from '@colletdev/react/spinner';
void init({ components: ['spinner'] });
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 { CxSpinner } from '@colletdev/angular/spinner';
void init({ components: ['spinner'] });
@Component({
standalone: true,
imports: [CxSpinner],
template: ``,
})
export class Example {}
```
## SplitButton (``)
### 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 | `""` | Text label for the primary action button. 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'`. |
| `icon-leading` | `iconLeading` | `string` | no | `""` | Icon displayed before the primary button label. Example: `'example'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `primary-disabled` | `primaryDisabled` | `boolean` | no | `false` | Disables only the primary action button (dropdown trigger remains active). Example: `true`. |
| `trigger-disabled` | `triggerDisabled` | `boolean` | no | `false` | Disables only the dropdown trigger button. Example: `true`. |
| `trigger-label` | `triggerLabel` | `string` | no | `""` | Accessible label for the dropdown trigger button (default: "More options"). Example: `'example'`. |
| `entries` | `entries` | `SplitMenuEntry[]` | no | `Rust default` | Menu or split-button entry definitions. Each entry has an `id` field — this is what `MenuActionDetail.id` returns in action events. Example: `[{ id: 'duplicate', label: 'Duplicate' }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-click` | `onClick` | `CustomEvent` | Fires when the user activates the component. Detail: `ClickDetail`. |
| `cx-action` | `onAction` | `CustomEvent` | Fires when the user activates an action item. Detail: `MenuActionDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the dropdown menu. |
| `close(): void` | Closes the dropdown menu. |
### 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 { SplitButton } from '@colletdev/react/split-button';
void init({ components: ['split-button'] });
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 { CxSplitButton } from '@colletdev/angular/split-button';
void init({ components: ['split-button'] });
@Component({
standalone: true,
imports: [CxSplitButton],
template: ``,
})
export class Example {}
```
## Stepper (``)
### 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'`. |
| `current` | `current` | `number` | no | `0` | Index or ID of the currently active step. Example: `1`. |
| `variant` | `variant` | `'outline' \| 'filled' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `outline`, `filled`, `ghost`. Example: `'outline'`. |
| `shape` | `shape` | `'sharp' \| 'rounded'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `orientation` | `orientation` | `'horizontal' \| 'vertical'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `horizontal`, `vertical`. Example: `'horizontal'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `linear` | `linear` | `boolean` | no | `false` | When true, steps must be completed in order — users cannot skip ahead. Example: `true`. |
| `steps` | `steps` | `StepperStep[]` | no | `Rust default` | Array of step definitions. Each step has id, label, optional description/icon. Example: `[{ id: 'details', label: 'Details' }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `SelectDetail`. |
### 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 { Stepper } from '@colletdev/react/stepper';
void init({ components: ['stepper'] });
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 { CxStepper } from '@colletdev/angular/stepper';
void init({ components: ['stepper'] });
@Component({
standalone: true,
imports: [CxStepper],
template: ``,
})
export class Example {}
```
## Switch (``)
### 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'`. |
| `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'`. |
| `checked` | `checked` | `boolean` | no | `false` | Boolean checked state (unlike Checkbox, which uses a string). Example: `true`. |
| `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`. |
| `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'`. |
| `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'`. |
| `unlabeled` | `unlabeled` | `boolean` | no | `false` | Renders the input without a visible label (still requires aria-label). Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `CheckedDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `CheckedDetail`. |
| `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 |
|---|---|
| `focus(): void` | Focuses the switch input. |
| `getValue(): string` | Returns "true" or "false". |
| `setValue(value: string): void` | Sets the switch state ("true" or "false"). |
### 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 { Switch } from '@colletdev/react/switch';
void init({ components: ['switch'] });
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 { CxSwitch } from '@colletdev/angular/switch';
void init({ components: ['switch'] });
@Component({
standalone: true,
imports: [CxSwitch],
template: ``,
})
export class Example {}
```
## Table (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `caption` | `caption` | `string` | yes | `—` | Caption text displayed below the main content. Example: `'Results'`. |
| `columns` | `columns` | `TableColumn[]` | no | `Rust default` | Typed table-column array. Bind as a property; do not stringify it or use `` children. Example: `[{ id: 'name', header: 'Name' }]`. |
| `rows` | `rows` | `TableRow[]` | no | `Rust default` | Typed table-row array. Bind as a property; do not stringify it or use ` | ` children. Example: `[{ id: 'row-1', cells: { name: 'Ada' } }]`. |
| `variant` | `variant` | `'plain' \| 'striped' \| 'bordered'` | no | `Rust default` | Visual style variant. Allowed values: `plain`, `striped`, `bordered`. Example: `'plain'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `selectable` | `selectable` | `'none' \| 'single' \| 'multiple'` | no | `Rust default` | Enables row selection with checkboxes. Allowed values: `none`, `single`, `multiple`. Example: `'none'`. |
| `selected` | `selected` | `string[]` | no | `Rust default` | Currently selected item ID(s). Example: `['item-1']`. |
| `sorts` | `sorts` | `SortState[]` | no | `Rust default` | Column sort configuration. Array of sort definitions with column ID and direction. Example: `[{ column_id: 'name', direction: 'asc' }]`. |
| `filters` | `filters` | `FilterState[]` | no | `Rust default` | Column filter configuration. Array of active filters with column ID and value. Example: `[{ column_id: 'name', operator: 'contains', value: 'Ada' }]`. |
| `pagination` | `pagination` | `PaginationConfig` | no | `Rust default` | Full pagination config object for external pagination control. Example: `{ current_page: 1, page_size: 10, total_items: 42 }`. |
| `hoverable` | `hoverable` | `boolean` | no | `true` | Enables hover highlighting on table rows. Example: `true`. |
| `sticky-header` | `stickyHeader` | `boolean` | no | `false` | Pins the table header row when scrolling. Example: `true`. |
| `footer` | `footer` | `FooterRow[]` | no | `Rust default` | Pre-rendered HTML for the table footer row. Example: `[{ cells: { total: '42' } }]`. |
| `empty-state` | `emptyState` | `EmptyStateConfig` | no | `Rust default` | Content displayed when the table has no rows. Example: `{ title: 'No results', description: 'Try another query' }`. |
| `column-order` | `columnOrder` | `string[]` | no | `Rust default` | Array of column IDs defining the display order. Example: `['name', 'email']`. |
| `virtual-scroll` | `virtualScroll` | `VirtualScrollConfig` | no | `Rust default` | Virtual scrolling window configuration with total count, render count, and start index. Example: `{ total_count: 1000, render_count: 40, start_index: 0 }`. |
| `page-size` | `pageSize` | `number` | no | `0` | Rows per page for auto-pagination. Set this alone and the table handles pagination internally — no need to manage current_page or total_items. For full control, use the pagination prop instead. Example: `10`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `loading` | `loading` | `number` | no | `0` | Number of skeleton rows to render while data loads. 0 renders the real rows. Example: `5`. |
| `error` | `error` | `string` | no | `""` | Error message text. When set, shows validation error styling. Example: `'This field is invalid'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-sort` | `onSort` | `CustomEvent` | Fires when the requested table sort changes. Detail: `SortDetail`. |
| `cx-select` | `onSelect` | `CustomEvent` | Fires when the user selects an item or data node. Detail: `TableSelectDetail`. |
| `cx-expand` | `onExpand` | `CustomEvent` | Fires when expandable content changes state. Detail: `TableExpandDetail`. |
| `cx-page` | `onPage` | `CustomEvent` | Fires when the requested table page changes. Detail: `PageDetail`. |
| `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`. |
| `cx-resize` | `onResize` | `CustomEvent` | Fires when a resizable table column changes width. Detail: `ResizeDetail`. |
| `cx-scroll` | `onScroll` | `CustomEvent` | Fires when the virtualized table viewport changes. Detail: `ScrollDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `goToPage(page: number): void` | Navigates to a specific page (1-indexed). Works in both controlled and auto-pagination modes. |
### 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 { Table } from '@colletdev/react/table';
void init({ components: ['table'] });
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 { CxTable } from '@colletdev/angular/table';
void init({ components: ['table'] });
@Component({
standalone: true,
imports: [CxTable],
template: ``,
})
export class Example {}
```
## Tabs (``)
### 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'`. |
| `items` | `items` | `TabItem[]` | no | `Rust default` | Typed array of item data objects. Bind as a property; do not stringify it or use children for list items. Example: `[{ value: 'overview', label: 'Overview' }]`. |
| `default-tab` | `defaultTab` | `string` | no | `""` | ID of the tab to activate on initial render. Example: `'example'`. |
| `variant` | `variant` | `'underline' \| 'enclosed' \| 'pill'` | no | `Rust default` | Visual style variant. Allowed values: `underline`, `enclosed`, `pill`. Example: `'underline'`. |
| `orientation` | `orientation` | `'horizontal' \| 'vertical'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `horizontal`, `vertical`. Example: `'horizontal'`. |
| `width` | `width` | `'auto' \| 'full'` | no | `Rust default` | Tab bar width preset. Allowed values: `auto`, `full`. Example: `'auto'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `active-tab` | `activeTab` | `string` | no | `""` | Controlled active tab. Set to a tab value or index to switch tabs without re-render. Updates on user interaction. Example: `'example'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `SelectDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `focus(): void` | Focuses the active tab. |
| `activateTab(index: number): void` | Activates the tab at the given index. Fires cx-change. |
### 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 { Tabs } from '@colletdev/react/tabs';
void init({ components: ['tabs'] });
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 { CxTabs } from '@colletdev/angular/tabs';
void init({ components: ['tabs'] });
@Component({
standalone: true,
imports: [CxTabs],
template: ``,
})
export class Example {}
```
## TagInput (``)
### 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` | `'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'`. |
| `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'`. |
| `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text for the input field. 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`. |
| `readonly` | `readonly` | `boolean` | no | `false` | Makes the component read-only. Example: `true`. |
| `required` | `required` | `boolean` | no | `false` | Marks the field as required for form validation. Example: `true`. |
| `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. |
| `max-tags` | `maxTags` | `number` | no | `Rust default` | Maximum number of tags allowed. Input becomes readonly at capacity. Example: `1`. |
| `tags` | `tags` | `CxTagData[]` | no | `Rust default` | Array of tags. Each tag has value, label, optional icon and disabled flag. Example: `[{ value: 'rust', label: 'Rust' }]`. |
### 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: `TagInputChangeDetail`. |
| `cx-dismiss` | `onDismiss` | `CustomEvent` | Fires when the user dismisses the component. Detail: `TagDismissDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `addTag(tag: CxTagData): void` | Adds a tag. Fires cx-change. |
| `removeTag(value: string): void` | Removes a tag by value. Fires cx-change. |
| `clearTags(): void` | Removes all tags. Fires cx-change. |
| `getTags(): CxTagData[]` | Returns the current tag list. |
### 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 { TagInput } from '@colletdev/react/tag-input';
void init({ components: ['tag-input'] });
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 { CxTagInput } from '@colletdev/angular/tag-input';
void init({ components: ['tag-input'] });
@Component({
standalone: true,
imports: [CxTagInput],
template: ``,
})
export class Example {}
```
## Text (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `text-role` | `textRole` | `'display' \| 'h1' \| 'h2' \| 'h3' \| 'label-lg' \| 'label-md' \| 'label-sm' \| 'body-lg' \| 'body-md' \| 'body-sm' \| 'overline' \| 'caption' \| 'code'` | no | `Rust default` | Semantic role of the text (e.g. heading, caption, code, label). Allowed values: `display`, `h1`, `h2`, `h3`, `label-lg`, `label-md`, `label-sm`, `body-lg`, `body-md`, `body-sm`, `overline`, `caption`, `code`. Example: `'display'`. |
| `align` | `align` | `'start' \| 'center' \| 'end'` | no | `Rust default` | Text alignment (left, center, right, justify). Allowed values: `start`, `center`, `end`. Example: `'start'`. |
| `color` | `color` | `'primary' \| 'inverse' \| 'muted'` | no | `Rust default` | Text color override using a named color token. Allowed values: `primary`, `inverse`, `muted`. Example: `'primary'`. |
| `muted` | `muted` | `boolean` | no | `false` | Renders text in a subdued/secondary color. Example: `true`. |
| `strong` | `strong` | `boolean` | no | `false` | Renders text with bold font weight. Example: `true`. |
| `italic` | `italic` | `boolean` | no | `false` | Renders text in italic style. Example: `true`. |
| `underline` | `underline` | `boolean` | no | `false` | Renders text with an underline decoration. Example: `true`. |
| `underline-strong` | `underlineStrong` | `boolean` | no | `false` | Renders text with a thicker underline decoration. Example: `true`. |
| `truncate` | `truncate` | `boolean` | no | `false` | Truncates text with an ellipsis when it overflows. Example: `true`. |
| `line-clamp` | `lineClamp` | `number` | no | `Rust default` | Maximum number of visible lines before truncation with an ellipsis. Example: `1`. |
| `balance` | `balance` | `boolean` | no | `false` | Applies CSS text-wrap: balance for even line lengths. Example: `true`. |
| `prose` | `prose` | `boolean` | no | `false` | Enables prose typography: a readable measure and looser line height. Example: `true`. |
| `element-as` | `elementAs` | `string` | no | `""` | Override the rendered HTML element (e.g. span, div, p). Example: `'example'`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| — | — | — | No public events. |
### Slots
| Slot | Description |
|---|---|
| `default` | Default slot (maps to 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 { Text } from '@colletdev/react/text';
void init({ components: ['text'] });
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 { CxText } from '@colletdev/angular/text';
void init({ components: ['text'] });
@Component({
standalone: true,
imports: [CxText],
template: ``,
})
export class Example {}
```
## TextInput (``)
### 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'`. |
| `kind` | `kind` | `'text' \| 'email' \| 'password' \| 'search' \| 'multiline'` | no | `Rust default` | Input type. Use 'multiline' for textarea behavior with optional rows and autoGrow. Allowed values: `text`, `email`, `password`, `search`, `multiline`. Example: `'text'`. |
| `placeholder` | `placeholder` | `string` | no | `""` | Placeholder text shown when empty. Example: `'Enter a value'`. |
| `value` | `value` | `string` | no | `""` | Controlled value. Set via onInput callback. Example: `'example'`. |
| `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`. |
| `readonly` | `readonly` | `boolean` | no | `false` | Makes the component read-only. Example: `true`. |
| `required` | `required` | `boolean` | no | `false` | Marks the field as required for form validation. Example: `true`. |
| `clearable` | `clearable` | `boolean` | no | `false` | Whether a clear button appears when the field has a value. Example: `true`. |
| `prefix-icon` | `prefixIcon` | `string` | no | `""` | Icon displayed at the start of the input field. Example: `'example'`. |
| `suffix-icon` | `suffixIcon` | `string` | no | `""` | Icon displayed at the end of the input field. Example: `'example'`. |
| `password-toggle` | `passwordToggle` | `boolean` | no | `false` | Whether to show a toggle button for password visibility. Example: `true`. |
| `password-visible` | `passwordVisible` | `boolean` | no | `false` | Controlled password visibility state. Example: `true`. |
| `name` | `name` | `string` | no | `""` | Form field name for submission. Example: `'fieldName'`. |
| `min-length` | `minLength` | `number` | no | `Rust default` | Minimum character length for validation. Example: `1`. |
| `max-length` | `maxLength` | `number` | no | `Rust default` | Maximum character length allowed. Example: `1`. |
| `pattern` | `pattern` | `string` | no | `""` | Regex pattern for input validation. Example: `'example'`. |
| `autocomplete` | `autocomplete` | `string` | no | `""` | Browser autocomplete hint (e.g. "email", "name", "off"). Example: `'example'`. |
| `rows` | `rows` | `number` | no | `3` | Visible row count for a multiline input. Applies only when kind is multiline. Example: `6`. |
| `auto-grow` | `autoGrow` | `boolean` | no | `false` | Automatically expands the textarea to fit content (multiline mode only). Example: `true`. |
### 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: `InputDetail`. |
| `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 |
|---|---|
| `focus(): void` | Focuses the inner input or textarea. |
| `blur(): void` | Blurs the inner input or textarea. |
| `select(): void` | Selects all text in the input. |
| `getValue(): string` | Returns the current input value. |
| `setValue(value: string): void` | Sets the input value programmatically. |
### 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 { TextInput } from '@colletdev/react/text-input';
void init({ components: ['text-input'] });
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 { CxTextInput } from '@colletdev/angular/text-input';
void init({ components: ['text-input'] });
@Component({
standalone: true,
imports: [CxTextInput],
template: ``,
})
export class Example {}
```
## Thinking (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `variant` | `variant` | `'ghost' \| 'filled'` | no | `Rust default` | Visual style variant. Allowed values: `ghost`, `filled`. Example: `'ghost'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `label` | `label` | `string` | no | `""` | Visible label text. Example: `'Example label'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `speed` | `speed` | `string` | no | `""` | Animation speed multiplier for the thinking indicator. Example: `'example'`. |
### 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 { Thinking } from '@colletdev/react/thinking';
void init({ components: ['thinking'] });
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 { CxThinking } from '@colletdev/angular/thinking';
void init({ components: ['thinking'] });
@Component({
standalone: true,
imports: [CxThinking],
template: ``,
})
export class Example {}
```
## Toast (``)
### 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. Example: `true`. |
| `icon` | `icon` | `string` | no | `""` | Icon name to display. Example: `'example'`. |
| `dismissible` | `dismissible` | `boolean` | no | `true` | 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'`. |
| `duration` | `duration` | `number` | no | `4250` | Auto-dismiss delay in milliseconds (default: 4250). Set to 0 for persistent toasts. Example: `300`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-dismiss` | `onDismiss` | `CustomEvent` | Fires when the user dismisses the component. Detail: `DismissDetail`. |
### Slots
| Slot | Description |
|---|---|
| `action` | Named slot for action content |
### Methods
| Method | Description |
|---|---|
| `dismiss(): void` | Dismisses the toast with exit animation. |
### 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 { Toast } from '@colletdev/react/toast';
void init({ components: ['toast'] });
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 { CxToast } from '@colletdev/angular/toast';
void init({ components: ['toast'] });
@Component({
standalone: true,
imports: [CxToast],
template: ``,
})
export class Example {}
```
## ToggleGroup (``)
### 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` | `'outline' \| 'ghost' \| 'filled'` | no | `Rust default` | Visual style variant. Allowed values: `outline`, `ghost`, `filled`. Example: `'outline'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `mode` | `mode` | `'single' \| 'multiple'` | no | `Rust default` | Selection mode (single or multiple). Allowed values: `single`, `multiple`. Example: `'single'`. |
| `orientation` | `orientation` | `'horizontal' \| 'vertical'` | no | `Rust default` | Layout orientation (horizontal or vertical). Allowed values: `horizontal`, `vertical`. Example: `'horizontal'`. |
| `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'`. |
| `disabled` | `disabled` | `boolean` | no | `false` | Disables the component, preventing interaction. Example: `true`. |
| `value` | `value` | `string \| string[]` | no | `""` | Controlled pressed item IDs. Pass a single ID or an array. Example: `'example'`. |
| `items` | `items` | `ToggleItem[]` | 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: 'bold', label: 'Bold' }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-input` | `onInput` | `CustomEvent` | Fires on each user edit before the value is committed. Detail: `ToggleDetail`. |
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `ToggleDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `getValue(): string` | Returns the pressed item ID(s) as comma-separated string. |
| `setValue(value: string): void` | Sets the pressed items (comma-separated IDs or single ID). |
### 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 { ToggleGroup } from '@colletdev/react/toggle-group';
void init({ components: ['toggle-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 { CxToggleGroup } from '@colletdev/angular/toggle-group';
void init({ components: ['toggle-group'] });
@Component({
standalone: true,
imports: [CxToggleGroup],
template: ``,
})
export class Example {}
```
## Tooltip (``)
### Props
| Attribute | Framework prop | Type | Required | Default | Description and example |
|---|---|---|---|---|---|
| `id` | `id` | `string` | no | `""` | Unique identifier for the element. Example: `'example-id'`. |
| `content` | `content` | `string` | no | `""` | Tooltip text shown on hover/focus. Also serves as the accessible name. Example: `'Example content'`. |
| `trigger-html` | `triggerHtml` | `string` | no | `""` | Pre-rendered HTML for the trigger element. Example: `'example'`. |
| `position` | `position` | `'top' \| 'bottom' \| 'left' \| 'right'` | no | `Rust default` | Placement position relative to the trigger. Allowed values: `top`, `bottom`, `left`, `right`. Example: `'top'`. |
| `arrow` | `arrow` | `boolean` | no | `false` | Whether to show an arrow pointing to the trigger. Example: `true`. |
| `open-delay` | `openDelay` | `number` | no | `0` | Delay in milliseconds before the tooltip appears on hover. Example: `300`. |
| `close-delay` | `closeDelay` | `number` | no | `300` | Delay in milliseconds before the tooltip hides after mouse leaves. Example: `300`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| — | — | — | No public events. |
### Slots
| Slot | Description |
|---|---|
| `trigger` (`children` alias) | Named slot for trigger 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 { Tooltip } from '@colletdev/react/tooltip';
void init({ components: ['tooltip'] });
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 { CxTooltip } from '@colletdev/angular/tooltip';
void init({ components: ['tooltip'] });
@Component({
standalone: true,
imports: [CxTooltip],
template: ``,
})
export class Example {}
```
## TopBar (``)
### 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'`. |
| `mobile-content` | `mobileContent` | `string` | no | `""` | Slot content for the mobile bar center zone. Example: `'example'`. |
| `variant` | `variant` | `'filled' \| 'outline' \| 'ghost'` | no | `Rust default` | Visual style variant. Allowed values: `filled`, `outline`, `ghost`. Example: `'filled'`. |
| `shape` | `shape` | `'sharp' \| 'rounded' \| 'pill'` | no | `Rust default` | Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. Example: `'sharp'`. |
| `position` | `position` | `'static' \| 'sticky' \| 'fixed'` | no | `Rust default` | Placement position relative to the trigger. Allowed values: `static`, `sticky`, `fixed`. Example: `'static'`. |
| `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'`. |
| `crush` | `crush` | `boolean` | no | `false` | Collapses the top bar to a compact height. Example: `true`. |
| `crush-threshold` | `crushThreshold` | `number` | no | `0` | Viewport width in pixels below which the top bar collapses to mobile mode. Example: `1`. |
| `movable` | `movable` | `boolean` | no | `false` | Enables drag-to-reorder for top bar items. Example: `true`. |
| `drawer-side` | `drawerSide` | `'top' \| 'left' \| 'right' \| 'bottom'` | no | `Rust default` | Which viewport edge the mobile drawer slides from. Allowed values: `top`, `left`, `right`, `bottom`. Example: `'top'`. |
| `drawer-size` | `drawerSize` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | no | `Rust default` | Width preset for the mobile navigation drawer. Allowed values: `sm`, `md`, `lg`, `xl`, `full`. Example: `'sm'`. |
| `separators-after` | `separatorsAfter` | `number[]` | no | `Rust default` | Array of group indices after which to render a visual separator. Example: `[0, 2]`. |
| `groups` | `groups` | `SidebarGroup[]` | no | `Rust default` | Navigation item groups rendered in the top bar. Example: `[{ label: 'Main', items: [{ id: 'home', label: 'Home', href: '/' }] }]`. |
| `open` | `open` | `boolean` | no | `false` | Whether the component is in an open/expanded state. Example: `true`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-close` | `onClose` | `CustomEvent` | Fires when the component closes. Detail: `CloseDetail`. |
| `cx-navigate` | `onNavigate` | `CustomEvent` | Fires when the user activates a navigation item. Detail: `NavigateDetail`. |
| `cx-crush` | `onCrush` | `CustomEvent` | Fires when cx-crush occurs. Detail: `CrushDetail`. |
| `cx-move` | `onMove` | `CustomEvent` | Fires when cx-move occurs. Detail: `MoveDetail`. |
### Slots
| Slot | Description |
|---|---|
| `leading` | Named slot for leading content |
| `content` | Named slot for content content |
| `trailing` | Named slot for trailing content |
| `mobile-leading` | Named slot for mobile-leading content |
| `mobile-trailing` | Named slot for mobile-trailing content |
### Methods
| Method | Description |
|---|---|
| `open(): void` | Opens the mobile navigation drawer. |
| `close(): void` | Closes the mobile navigation drawer. |
| `toggle(): void` | Toggles the mobile navigation drawer open/close 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 { TopBar } from '@colletdev/react/top-bar';
void init({ components: ['top-bar'] });
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 { CxTopBar } from '@colletdev/angular/top-bar';
void init({ components: ['top-bar'] });
@Component({
standalone: true,
imports: [CxTopBar],
template: ``,
})
export class Example {}
```
## TreeView (``)
### 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` | `'default' \| 'compact' \| 'outline'` | no | `Rust default` | Visual style variant. Allowed values: `default`, `compact`, `outline`. Example: `'default'`. |
| `selection-mode` | `selectionMode` | `'none' \| 'single' \| 'multiple'` | no | `Rust default` | Selection behavior: 'none' (display only), 'single' (one item), or 'multiple' (checkboxes with tri-state cascade). Allowed values: `none`, `single`, `multiple`. Example: `'none'`. |
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | no | `Rust default` | Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. Example: `'xs'`. |
| `nodes` | `nodes` | `CxTreeNode[]` | no | `Rust default` | Recursive tree structure. Each node has id, label, optional icon/children/expanded/selected/disabled. When expandedIds or selectedIds are set, per-node expanded/selected fields are ignored. Example: `[{ id: 'root', label: 'Root' }]`. |
| `expanded-ids` | `expandedIds` | `string[]` | no | `Rust default` | Controlled expanded state — array of node IDs to expand. When set, overrides per-node expanded fields. Enables controlled expand/collapse without rebuilding the tree. Example: `['item-1']`. |
| `selected-ids` | `selectedIds` | `string[]` | no | `Rust default` | Controlled selected state — array of node IDs to select. When set, overrides per-node selected fields. Enables controlled selection without rebuilding the tree. 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: `TreeChangeDetail`. |
| `cx-select` | `onSelect` | `CustomEvent` | Fires when the user selects an item or data node. Detail: `TreeSelectDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `expandAll(): void` | Expands all branch nodes in the tree. |
| `collapseAll(): void` | Collapses all branch nodes in the tree. |
| `expand(nodeId: string): void` | Expands a specific node by ID. |
| `collapse(nodeId: string): void` | Collapses a specific node by ID. |
| `selectAll(): void` | Selects all non-disabled nodes (multi-select mode only). |
| `deselectAll(): void` | Deselects all nodes. |
| `getSelectedIds(): string[]` | Returns the IDs of all currently selected nodes. |
| `getExpandedIds(): string[]` | Returns the IDs of all currently expanded nodes. |
### 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 { TreeView } from '@colletdev/react/tree-view';
void init({ components: ['tree-view'] });
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 { CxTreeView } from '@colletdev/angular/tree-view';
void init({ components: ['tree-view'] });
@Component({
standalone: true,
imports: [CxTreeView],
template: ``,
})
export class Example {}
```
## Treemap (``)
### 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'`. |
| `shape` | `shape` | `'sharp' \| 'rounded'` | no | `Rust default` | Border radius style for cells: 'sharp' (default) or 'rounded'. Allowed values: `sharp`, `rounded`. Example: `'sharp'`. |
| `fit` | `fit` | `'content' \| 'fill'` | no | `Rust default` | Grid sizing mode: 'content' (default, 5:3 aspect ratio) or 'fill' (fills parent container height). Allowed values: `content`, `fill`. Example: `'content'`. |
| `current-root` | `currentRoot` | `string` | no | `""` | ID of the node to zoom into. When set, renders that node's children. Empty = root view. Example: `'example'`. |
| `min-cell-area` | `minCellArea` | `number` | no | `0` | Minimum cell area fraction (0–1) before a node is aggregated into "Other" (default: 0.001). Example: `1`. |
| `show-values` | `showValues` | `boolean` | no | `true` | Whether to display formatted numeric values inside cells (default: true). Example: `true`. |
| `nodes` | `nodes` | `TreemapNode[]` | yes | `—` | Hierarchical tree data. Each node has id, label, value (numeric — determines cell area), optional intent, children (recursive), disabled. Example: `[{ id: 'root', label: 'Root', value: 100 }]`. |
### Events
| DOM event | React/Svelte callback | Type | Description |
|---|---|---|---|
| `cx-change` | `onChange` | `CustomEvent` | Fires when the committed component value or state changes. Detail: `TreemapChangeDetail`. |
| `cx-select` | `onSelect` | `CustomEvent` | Fires when the user selects an item or data node. Detail: `TreemapSelectDetail`. |
| `cx-hover` | `onHover` | `CustomEvent` | Fires when the active hover target changes. Detail: `TreemapHoverDetail`. |
### Slots
| Slot | Description |
|---|---|
| — | No public slots. |
### Methods
| Method | Description |
|---|---|
| `zoomTo(nodeId: string): void` | Zooms into a specific node by ID. Fires cx-change. |
| `zoomOut(): void` | Zooms out one level toward the root. Fires cx-change. |
| `resetZoom(): void` | Returns to the root view. Fires cx-change. |
### 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 { Treemap } from '@colletdev/react/treemap';
void init({ components: ['treemap'] });
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 { CxTreemap } from '@colletdev/angular/treemap';
void init({ components: ['treemap'] });
@Component({
standalone: true,
imports: [CxTreemap],
template: ``,
})
export class Example {}
```