ui/behaviors
ui/behaviors
Import from @norbital-ai/ui/behaviors
Single-source composable Svelte-5 headless behavior primitives. Used directly by @norbital-ai/ui built-in components AND exported for tenants to compose custom widgets with identical keyboard navigation, ARIA, overflow, resizing, dismissal, focus management, shortcuts, selection, pagination, clipboard, floating, portals, dates, direct manipulation, canvas gestures, live announcements and agent observability hooks.
behaviors
Accordion type
type Accordion = ReturnType<typeof create_accordion>; Return value of create_accordion.
Members
| Name | Type | Description |
|---|---|---|
open | readonly string[] | |
is_open | (key: string) => boolean | |
toggle | (key: string) => void | |
expand | (key: string) => void | |
collapse | (key: string) => void | |
item | (key: string) => import("svelte/attachments").Attachment<HTMLElement> | |
root_attrs | () => { onkeydown: (event: KeyboardEvent) => void; } | |
trigger_attrs | (key: string) => { type: "button"; id: string; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; } | |
content_attrs | (key: string) => { id: string; role: "region"; "aria-labelledby": string; hidden: boolean; "data-state": "open" | "closed"; } |
Source: packages/ui/src/behaviors/accordion.svelte.ts:32
AccordionMode type
type AccordionMode = 'single' | 'multiple'; Single or multiple expanded sections mode for create_accordion.
Source: packages/ui/src/behaviors/accordion.svelte.ts:9
AccordionOptions type
type AccordionOptions = {
/** Item keys in visual order. */
items: () => readonly string[];
/** Single or multiple expanded sections (default `'single'`). */
mode?: AccordionMode;
/** In single mode, allow collapsing the only open item (default `true`). */
collapsible?: boolean;
/** Controlled open keys; omit for internal state. */
open?: () => readonly string[];
/** Initial open keys when uncontrolled. */
default_open?: readonly string[];
/** Called whenever expanded keys change. */
on_change?: (open: readonly string[]) => void;
/** Disabled predicate per item key. */
disabled?: (key: string) => boolean;
/** Optional semantic control id/label for Norbius's `page` bridge. */
control?: {
id: string;
label?: string;
};
}; Options for create_accordion.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | Item keys in visual order. |
mode? | AccordionMode | Single or multiple expanded sections (default |
collapsible? | boolean | In single mode, allow collapsing the only open item (default |
open? | () => readonly string[] | Controlled open keys; omit for internal state. |
default_open? | readonly string[] | Initial open keys when uncontrolled. |
on_change? | (open: readonly string[]) => void | Called whenever expanded keys change. |
disabled? | (key: string) => boolean | Disabled predicate per item key. |
control? | { id: string; label?: string; } | Optional semantic control id/label for Norbius's |
Source: packages/ui/src/behaviors/accordion.svelte.ts:12
AnnounceOptions type
type AnnounceOptions = {
/** Announcement urgency (default `'polite'`). */
readonly priority?: AnnouncePriority;
/** Target document (defaults to global `document`). */
readonly doc?: Document;
}; Options for announce.
Members
| Name | Type | Description |
|---|---|---|
priority? | AnnouncePriority | Announcement urgency (default |
doc? | Document | Target document (defaults to global |
Source: packages/ui/src/behaviors/announce.svelte.ts:9
AnnouncePriority type
type AnnouncePriority = 'polite' | 'assertive'; Urgency of a screen-reader announcement ('polite' waits for idle, 'assertive' interrupts).
Source: packages/ui/src/behaviors/announce.svelte.ts:6
AreaBehavior type
type AreaBehavior = ReturnType<typeof create_area>; Return value of create_area.
Members
| Name | Type | Description |
|---|---|---|
value | AreaValue | |
percent_x | number | |
percent_y | number | |
dragging | boolean | |
set | (next: AreaValue, commitNow?: boolean) => void | |
surface | Attachment<HTMLElement> | |
thumb_attrs | () => { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/canvas.svelte.ts:131
AreaOptions type
type AreaOptions = {
readonly value?: () => AreaValue;
readonly default_value?: AreaValue;
readonly on_change?: (value: AreaValue) => void;
readonly on_commit?: (value: AreaValue) => void;
readonly min_x?: number;
readonly max_x?: number;
readonly min_y?: number;
readonly max_y?: number;
readonly step_x?: number;
readonly step_y?: number;
readonly label?: string;
}; Options for create_area.
Members
| Name | Type | Description |
|---|---|---|
value? | () => AreaValue | |
default_value? | AreaValue | |
on_change? | (value: AreaValue) => void | |
on_commit? | (value: AreaValue) => void | |
min_x? | number | |
max_x? | number | |
min_y? | number | |
max_y? | number | |
step_x? | number | |
step_y? | number | |
label? | string |
Source: packages/ui/src/behaviors/canvas.svelte.ts:116
AreaValue type
type AreaValue = {
readonly x: number;
readonly y: number;
}; 2D slider coordinates { x, y }.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:113
AriaPattern type
type AriaPattern = 'dialog' | 'menu' | 'menubar' | 'listbox' | 'combobox' | 'tabs' | 'accordion' | 'tree' | 'grid' | 'radiogroup' | 'toolbar' | 'switch' | 'slider' | 'carousel'; Supported WAI-ARIA Authoring Practices Guide widget patterns verified by check_pattern.
Source: packages/ui/src/behaviors/testing.ts:4
AsyncOptions type
type AsyncOptions<T> = ReturnType<typeof create_async_options<T>>; Return value of create_async_options.
Members
| Name | Type | Description |
|---|---|---|
query | string | |
items | readonly T[] | |
status | AsyncOptionsStatus | |
loading | boolean | |
error | unknown | |
has_more | boolean | |
set_query | (next: string, opts?: { immediate?: boolean; }) => void | |
load_more | () => void | |
reload | () => void | |
reset | () => void | |
cancel | () => void |
Source: packages/ui/src/behaviors/async-options.svelte.ts:38
AsyncOptionsContext type
type AsyncOptionsContext = {
/** Aborted automatically when a newer query or reset supersedes this request. */
readonly signal: AbortSignal;
/** Zero-based page index (`0` for fresh query, incremented by `load_more()`). */
readonly page: number;
}; Context passed to AsyncOptionsOptions.load.
Members
| Name | Type | Description |
|---|---|---|
signal | AbortSignal | Aborted automatically when a newer query or reset supersedes this request. |
page | number | Zero-based page index ( |
Source: packages/ui/src/behaviors/async-options.svelte.ts:18
AsyncOptionsOptions type
type AsyncOptionsOptions<T> = {
/** Fetches matching items for `query` and `ctx.page`, honoring `ctx.signal`. */
readonly load: (query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>>;
/** Initial query (default `''`). */
readonly initial_query?: string;
/** Typing debounce window in ms (default `200`). */
readonly debounce_ms?: number;
/** Fetch immediately for `initial_query` on mount (default `false`). */
readonly immediate?: boolean;
}; Options for create_async_options.
Members
| Name | Type | Description |
|---|---|---|
load | (query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>> | Fetches matching items for |
initial_query? | string | Initial query (default |
debounce_ms? | number | Typing debounce window in ms (default |
immediate? | boolean | Fetch immediately for |
Source: packages/ui/src/behaviors/async-options.svelte.ts:26
AsyncOptionsPage type
type AsyncOptionsPage<T> = readonly T[] | {
readonly items: readonly T[];
readonly has_more?: boolean;
}; Page payload returned by AsyncOptionsOptions.load.
Source: packages/ui/src/behaviors/async-options.svelte.ts:10
AsyncOptionsStatus type
type AsyncOptionsStatus = 'idle' | 'loading' | 'error'; Load lifecycle state of create_async_options.
Source: packages/ui/src/behaviors/async-options.svelte.ts:7
AutoScroll type
type AutoScroll = ReturnType<typeof create_auto_scroll>; Return value of create_auto_scroll.
Members
| Name | Type | Description |
|---|---|---|
update | (x: number, y: number) => void | |
stop | () => void |
Source: packages/ui/src/behaviors/drag.svelte.ts:164
AutoScrollOptions type
type AutoScrollOptions = {
/** Edge proximity threshold in px where scrolling begins (default `48`). */
readonly edge?: number;
/** Maximum scroll speed in px/frame at the edge (default `18`). */
readonly speed?: number;
/** Called after each scrolled frame so drag hit-testing updates under a stationary pointer. */
readonly on_scroll?: () => void;
/** Optional element to ignore when hit-testing scrollers underneath the pointer. */
readonly ignore?: () => Element | null | undefined;
}; Options for create_auto_scroll.
Members
| Name | Type | Description |
|---|---|---|
edge? | number | Edge proximity threshold in px where scrolling begins (default |
speed? | number | Maximum scroll speed in px/frame at the edge (default |
on_scroll? | () => void | Called after each scrolled frame so drag hit-testing updates under a stationary pointer. |
ignore? | () => Element | null | undefined | Optional element to ignore when hit-testing scrollers underneath the pointer. |
Source: packages/ui/src/behaviors/drag.svelte.ts:152
BindDragOptions type
type BindDragOptions = {
/** Movement in CSS px before `on_start`/`on_move` fire (default `DRAG_THRESHOLD`). */
readonly threshold?: number;
/** Return `false` to reject starting the drag. */
readonly on_start?: (event: PointerEvent) => boolean | void;
/** Called at most once per animation frame with latest pointer coordinates. */
readonly on_move: (sample: PointerSample) => void;
/** Called when the pointer lifts, cancels, or Escape aborts. */
readonly on_end?: (event: PointerEvent | KeyboardEvent, canceled: boolean) => void;
/** Cancel active drag on Escape (default `true`). */
readonly cancel_on_escape?: boolean;
/** Stop `pointerdown` propagation so nested drag surfaces do not both capture the gesture. */
readonly stop_propagation?: boolean;
/** Disable dragging reactively. */
readonly disabled?: () => boolean;
}; Options for bind_drag.
Members
| Name | Type | Description |
|---|---|---|
threshold? | number | Movement in CSS px before |
on_start? | (event: PointerEvent) => boolean | void | Return |
on_move | (sample: PointerSample) => void | Called at most once per animation frame with latest pointer coordinates. |
on_end? | (event: PointerEvent | KeyboardEvent, canceled: boolean) => void | Called when the pointer lifts, cancels, or Escape aborts. |
cancel_on_escape? | boolean | Cancel active drag on Escape (default |
stop_propagation? | boolean | Stop |
disabled? | () => boolean | Disable dragging reactively. |
Source: packages/ui/src/behaviors/drag.svelte.ts:21
BindHoldOptions type
type BindHoldOptions = {
/** Hold duration in ms before `on_hold` fires (default `500`). */
readonly delay?: number;
/** Max pointer drift in px before canceling (default `8`). */
readonly tolerance?: number;
/** Keys that start a keyboard hold (default `[' ', 'Enter']`). */
readonly keys?: readonly string[];
/** Called when press starts. */
readonly on_start?: (details: {
readonly event: PointerEvent | KeyboardEvent;
readonly input: HoldInput;
}) => void;
/** Called once the press crosses `delay`. */
readonly on_hold: (details: {
readonly event: PointerEvent | KeyboardEvent;
readonly input: HoldInput;
}) => void;
/** Called when the press lifts or cancels. */
readonly on_end?: (details: {
readonly event: Event;
readonly input: HoldInput;
readonly held: boolean;
readonly canceled: boolean;
}) => void;
/** Disable reactively. */
readonly disabled?: () => boolean;
}; Options for bind_hold.
Members
| Name | Type | Description |
|---|---|---|
delay? | number | Hold duration in ms before |
tolerance? | number | Max pointer drift in px before canceling (default |
keys? | readonly string[] | Keys that start a keyboard hold (default |
on_start? | (details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void | Called when press starts. |
on_hold | (details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void | Called once the press crosses |
on_end? | (details: { readonly event: Event; readonly input: HoldInput; readonly held: boolean; readonly canceled: boolean; }) => void | Called when the press lifts or cancels. |
disabled? | () => boolean | Disable reactively. |
Source: packages/ui/src/behaviors/micro.svelte.ts:199
BindRepeatOptions type
type BindRepeatOptions = {
/** Called immediately on press and repeatedly while held. */
readonly on_step: (count: number) => void;
/** Called when the repeating press stops. */
readonly on_end?: (count: number) => void;
/** Delay before repeating begins in ms (default `400`). */
readonly delay?: number;
/** Interval between repeated steps in ms (default `60`). */
readonly interval?: number;
/** Disable reactively. */
readonly disabled?: () => boolean;
}; Options for bind_repeat.
Members
| Name | Type | Description |
|---|---|---|
on_step | (count: number) => void | Called immediately on press and repeatedly while held. |
on_end? | (count: number) => void | Called when the repeating press stops. |
delay? | number | Delay before repeating begins in ms (default |
interval? | number | Interval between repeated steps in ms (default |
disabled? | () => boolean | Disable reactively. |
Source: packages/ui/src/behaviors/micro.svelte.ts:334
CalendarBehavior type
type CalendarBehavior = ReturnType<typeof create_calendar>; Return value of create_calendar.
Members
| Name | Type | Description |
|---|---|---|
placeholder | CalendarDate | |
months | readonly CalendarMonth[] | |
weekdays | readonly string[] | |
set_placeholder | (next: DateValue) => void | |
prev_month | () => void | |
next_month | () => void | |
reset_pending | () => void | |
focused | CalendarDate | |
focus_day | (target: CalendarDate) => void | |
day_ref | (date: CalendarDate) => Attachment<HTMLElement> | |
day_attrs | (date: CalendarDate, month: CalendarDate) => { role: "button"; tabindex: number; "data-value": string; "data-selected": string | undefined; "data-selection-start": string | undefined; "data-selection-end": string | undefined; "data-today": string | undefined; "data-outside-month": string | undefined; "data-disabled": string | undefined; "aria-disabled": true | undefined; "aria-selected": boolean;… |
Source: packages/ui/src/behaviors/date-time.svelte.ts:121
CalendarMode type
type CalendarMode = 'single' | 'range'; Selection mode for create_calendar.
Source: packages/ui/src/behaviors/date-time.svelte.ts:74
CalendarMonth type
type CalendarMonth = {
/** First day of this month. */
readonly value: CalendarDate;
/** Rows of 7 `CalendarDate` cells (including leading/trailing outside-month days). */
readonly weeks: readonly (readonly CalendarDate[])[];
}; One month grid returned by create_calendar.
Members
| Name | Type | Description |
|---|---|---|
value | CalendarDate | First day of this month. |
weeks | readonly (readonly CalendarDate[])[] | Rows of 7 |
Source: packages/ui/src/behaviors/date-time.svelte.ts:85
CalendarOptions type
type CalendarOptions = {
/** Single-day or date-range selection mode (default `'single'`). */
readonly mode?: CalendarMode | (() => CalendarMode);
/** Selected single date when `mode === 'single'`. */
readonly value?: () => DateValue | undefined;
/** Selected range when `mode === 'range'`. */
readonly range?: () => CalendarRange;
/** Called on single-day selection. */
readonly on_select?: (date: DateValue) => void;
/** Called when range selection updates (with `{ start, end }`). */
readonly on_range_change?: (range: CalendarRange) => void;
/** Controlled visible anchor month. */
readonly placeholder?: () => DateValue | undefined;
/** Called when the visible month changes. */
readonly on_placeholder_change?: (next: DateValue) => void;
/** Number of side-by-side months to build (default `1`). */
readonly number_of_months?: () => number;
/** BCP-47 locale for weekday order and names (default `'en-US'`). */
readonly locale?: () => string | undefined;
/** Minimum selectable date. */
readonly min?: () => DateValue | undefined;
/** Maximum selectable date. */
readonly max?: () => DateValue | undefined;
/** Disabled state. */
readonly disabled?: () => boolean;
}; Options for create_calendar.
Members
| Name | Type | Description |
|---|---|---|
mode? | CalendarMode | (() => CalendarMode) | Single-day or date-range selection mode (default |
value? | () => DateValue | undefined | Selected single date when |
range? | () => CalendarRange | Selected range when |
on_select? | (date: DateValue) => void | Called on single-day selection. |
on_range_change? | (range: CalendarRange) => void | Called when range selection updates (with |
placeholder? | () => DateValue | undefined | Controlled visible anchor month. |
on_placeholder_change? | (next: DateValue) => void | Called when the visible month changes. |
number_of_months? | () => number | Number of side-by-side months to build (default |
locale? | () => string | undefined | BCP-47 locale for weekday order and names (default |
min? | () => DateValue | undefined | Minimum selectable date. |
max? | () => DateValue | undefined | Maximum selectable date. |
disabled? | () => boolean | Disabled state. |
Source: packages/ui/src/behaviors/date-time.svelte.ts:93
CalendarRange type
type CalendarRange = {
/** First selected date, if any. */
readonly start: DateValue | undefined;
/** Last selected date, if any. */
readonly end: DateValue | undefined;
}; Start and end of a calendar date range.
Members
| Name | Type | Description |
|---|---|---|
start | DateValue | undefined | First selected date, if any. |
end | DateValue | undefined | Last selected date, if any. |
Source: packages/ui/src/behaviors/date-time.svelte.ts:77
CarouselBehavior type
type CarouselBehavior = ReturnType<typeof create_carousel>; Return value of create_carousel.
Members
| Name | Type | Description |
|---|---|---|
index | number | |
count | number | |
can_prev | boolean | |
can_next | boolean | |
paused | boolean | |
go_to | (next: number) => void | |
next | () => void | |
prev | () => void | |
set_paused | (p: boolean) => void | |
root | Attachment<HTMLElement> | |
track | Attachment<HTMLElement> | |
root_attrs | () => { role: "region"; "aria-roledescription": string; "aria-label": string; onpointerenter: () => boolean; onpointerleave: () => boolean; onfocusin: () => boolean; onfocusout: () => boolean; onkeydown: (event: KeyboardEvent) => void; } | |
slide_attrs | (i: number) => { role: "group"; "aria-roledescription": string; "aria-label": string; "aria-hidden": true | undefined; "data-active": string | undefined; } | |
dot_attrs | (i: number) => { type: "button"; "aria-label": string; "aria-current": "true" | undefined; "data-active": string | undefined; onclick: () => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:240
CarouselOptions type
type CarouselOptions = {
readonly count: () => number;
readonly index?: () => number;
readonly default_index?: number;
readonly on_change?: (index: number) => void;
readonly loop?: boolean;
readonly autoplay_ms?: number;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_carousel.
Members
| Name | Type | Description |
|---|---|---|
count | () => number | |
index? | () => number | |
default_index? | number | |
on_change? | (index: number) => void | |
loop? | boolean | |
autoplay_ms? | number | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:228
CellBounds type
type CellBounds = {
readonly top: number;
readonly left: number;
readonly bottom: number;
readonly right: number;
}; Normalized inclusive rectangular bounds of a CellRange.
Members
| Name | Type | Description |
|---|---|---|
top | number | |
left | number | |
bottom | number | |
right | number |
Source: packages/ui/src/behaviors/grid.svelte.ts:15
CellRange type
type CellRange = {
readonly anchor: GridCell;
readonly end: GridCell;
}; Rectangular cell range from anchor to end.
Members
| Name | Type | Description |
|---|---|---|
anchor | GridCell | |
end | GridCell |
Source: packages/ui/src/behaviors/grid.svelte.ts:12
CellRangeBehavior type
type CellRangeBehavior = ReturnType<typeof create_cell_range>; Return value of create_cell_range.
Members
| Name | Type | Description |
|---|---|---|
range | CellRange | null | |
bounds | CellBounds | null | |
dragging | boolean | |
start | (cell: GridCell) => void | |
extend | (to: GridCell, from?: GridCell, notify?: boolean) => void | |
select_row | (row: number) => void | |
select_col | (col: number) => void | |
clear | () => void | |
contains | (cell: GridCell) => boolean | |
to_text | (read: (cell: GridCell) => string) => string | |
cell_attrs | (cell: GridCell) => { "aria-selected": boolean; "data-in-range": string | undefined; onpointerdown: (event: PointerEvent) => void; onpointerenter: () => void; } |
Source: packages/ui/src/behaviors/grid.svelte.ts:253
CellRangeOptions type
type CellRangeOptions = {
/** Total row count. */
readonly rows: () => number;
/** Total column count. */
readonly cols: () => number;
/** Controlled range; omit for internal state. */
readonly range?: () => CellRange | null;
/** Called when the selected cell range changes. */
readonly on_change?: (range: CellRange | null) => void;
/** Optional live-region message formatter on range updates. */
readonly message?: (bounds: CellBounds) => string;
}; Options for create_cell_range.
Members
| Name | Type | Description |
|---|---|---|
rows | () => number | Total row count. |
cols | () => number | Total column count. |
range? | () => CellRange | null | Controlled range; omit for internal state. |
on_change? | (range: CellRange | null) => void | Called when the selected cell range changes. |
message? | (bounds: CellBounds) => string | Optional live-region message formatter on range updates. |
Source: packages/ui/src/behaviors/grid.svelte.ts:239
ChangeSource type
type ChangeSource = 'pointer' | 'keyboard' | 'agent' | 'programmatic'; Who initiated a UI change.
Source: packages/ui/src/behaviors/controls.svelte.ts:7
CheckboxGroup type
type CheckboxGroup = ReturnType<typeof create_checkbox_group>; Return value of create_checkbox_group.
Members
| Name | Type | Description |
|---|---|---|
checked | readonly string[] | |
all_state | boolean | "indeterminate" | |
is_checked | (key: string) => boolean | |
toggle | (key: string) => void | |
toggle_all | () => void | |
group_attrs | () => { role: "group"; "aria-label": string | undefined; } | |
all_attrs | () => { type: "checkbox"; checked: boolean; "aria-checked": boolean | "mixed"; onchange: () => void; } | |
item_attrs | (key: string) => { type: "checkbox"; checked: boolean; disabled: true | undefined; onchange: () => void; } |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:621
CheckboxGroupOptions type
type CheckboxGroupOptions = {
/** All selectable item keys. */
readonly items: () => readonly string[];
/** Controlled checked keys; omit for internal state. */
readonly value?: () => readonly string[];
/** Initial checked keys when uncontrolled. */
readonly default_value?: readonly string[];
/** Called when checked keys change. */
readonly on_change?: (next: readonly string[]) => void;
/** Per-item disabled predicate. */
readonly disabled?: (key: string) => boolean;
/** Accessible label for the group. */
readonly label?: string;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_checkbox_group.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | All selectable item keys. |
value? | () => readonly string[] | Controlled checked keys; omit for internal state. |
default_value? | readonly string[] | Initial checked keys when uncontrolled. |
on_change? | (next: readonly string[]) => void | Called when checked keys change. |
disabled? | (key: string) => boolean | Per-item disabled predicate. |
label? | string | Accessible label for the group. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:603
Clipboard type
type Clipboard = ReturnType<typeof create_clipboard>; Return value of create_clipboard.
Members
| Name | Type | Description |
|---|---|---|
copied | boolean | |
copy | (override?: string) => Promise<boolean> | |
reset | () => void |
Source: packages/ui/src/behaviors/clipboard.svelte.ts:16
ClipboardOptions type
type ClipboardOptions = {
/** Text to copy (reactive getter or static string). */
text: string | (() => string);
/** How long `copied` stays `true` in ms (default `1500`). */
timeout_ms?: number;
/** Optional callback after a copy attempt completes. */
on_copy?: (ok: boolean, value: string) => void;
}; Options for create_clipboard.
Members
| Name | Type | Description |
|---|---|---|
text | string | (() => string) | Text to copy (reactive getter or static string). |
timeout_ms? | number | How long |
on_copy? | (ok: boolean, value: string) => void | Optional callback after a copy attempt completes. |
Source: packages/ui/src/behaviors/clipboard.svelte.ts:6
ColorPickerBehavior type
type ColorPickerBehavior = ReturnType<typeof create_color_picker>; Return value of create_color_picker.
Members
| Name | Type | Description |
|---|---|---|
value | string | |
rgba | RgbaColor | |
hsv | HsvaColor | |
plane | { readonly value: import("./canvas.svelte.js").AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: import("./canvas.svelte.js").AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; 'aria-label': string | undefined; 'aria-valuetext': string; 'data-dragging': string | unde… | |
hue | { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; 'aria-orientation': "horizontal" | "vertical"; 'aria-label': string | undefined; 'aria-valuemin': numbe… | |
alpha | { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; 'aria-orientation': "horizontal" | "vertical"; 'aria-label': string | undefined; 'aria-valuemin': numbe… | |
set_text | (text: string) => boolean | |
set_rgba | (next: RgbaColor) => void |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:987
ColorPickerOptions type
type ColorPickerOptions = {
readonly value?: () => string;
readonly default_value?: string;
readonly on_change?: (hex: string, rgba: RgbaColor) => void;
readonly format?: 'hex' | 'rgb' | 'hsl';
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_color_picker.
Members
| Name | Type | Description |
|---|---|---|
value? | () => string | |
default_value? | string | |
on_change? | (hex: string, rgba: RgbaColor) => void | |
format? | 'hex' | 'rgb' | 'hsl' | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:977
ColorSchemeOptions type
type ColorSchemeOptions = {
readonly storage_key?: string;
readonly default_value?: ColorSchemePreference;
readonly apply_class?: boolean;
}; Options for create_color_scheme.
Members
| Name | Type | Description |
|---|---|---|
storage_key? | string | |
default_value? | ColorSchemePreference | |
apply_class? | boolean |
Source: packages/ui/src/behaviors/platform.svelte.ts:165
ColorSchemePreference type
type ColorSchemePreference = 'light' | 'dark' | 'system'; User color-scheme preference.
Source: packages/ui/src/behaviors/platform.svelte.ts:153
ConnectBehavior type
type ConnectBehavior = ReturnType<typeof create_connect>; Return value of create_connect.
Members
| Name | Type | Description |
|---|---|---|
draft | ConnectDraft | null | |
pending_from | string | null | |
port | (id: string) => Attachment<HTMLElement> | |
port_attrs | (id: string) => { tabindex: number; 'data-connecting': string | undefined; 'data-connect-target': string | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/canvas.svelte.ts:635
ConnectDraft type
type ConnectDraft = {
readonly from: string;
readonly x: number;
readonly y: number;
readonly over: string | null;
}; Active wire being dragged from a source port to pointer coordinates.
Members
| Name | Type | Description |
|---|---|---|
from | string | |
x | number | |
y | number | |
over | string | null |
Source: packages/ui/src/behaviors/canvas.svelte.ts:621
ConnectOptions type
type ConnectOptions = {
readonly can_connect?: (from: string, to: string) => boolean;
readonly on_connect: (from: string, to: string) => void;
}; Options for create_connect.
Members
| Name | Type | Description |
|---|---|---|
can_connect? | (from: string, to: string) => boolean | |
on_connect | (from: string, to: string) => void |
Source: packages/ui/src/behaviors/canvas.svelte.ts:629
ControlAction type
type ControlAction = (...args: readonly unknown[]) => void; Semantic action callback registered on a live UI control.
Source: packages/ui/src/behaviors/controls.svelte.ts:10
ControlChange type
type ControlChange = {
readonly id: string;
readonly kind: string;
readonly label?: string;
readonly key: string;
readonly previous: unknown;
readonly value: unknown;
readonly source: ChangeSource;
readonly reason: string;
readonly redacted?: boolean;
readonly committed: boolean;
}; Emitted change record for observe_controls and create_ui_history.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
key | string | |
previous | unknown | |
value | unknown | |
source | ChangeSource | |
reason | string | |
redacted? | boolean | |
committed | boolean |
Source: packages/ui/src/behaviors/controls.svelte.ts:74
ControlChoice type
type ControlChoice = {
readonly value: string;
readonly label: string;
}; Choice exposed by a selectable control (tabs, combobox, menu, radio group, tree).
Members
| Name | Type | Description |
|---|---|---|
value | string | |
label | string |
Source: packages/ui/src/behaviors/controls.svelte.ts:13
ControlDescriptor type
type ControlDescriptor = {
/** Stable semantic identifier, e.g. `'tabs:settings'` or `'combobox:status'`. */
readonly id: string;
/** Component kind, e.g. `'tabs'`, `'combobox'`, `'dialog'`, `'input'`, `'checkbox'`, `'menu'`. */
readonly kind: string;
/** Optional human-readable label (falls back to accessible name of `element`). */
readonly label?: string;
/** Optional root/interactive DOM element for scope filtering and `data-agent-*` marks. */
readonly element?: () => HTMLElement | null | undefined;
/** Live snapshot of state (active tab, open state, value, selected count, etc.). */
readonly state: () => Record<string, unknown>;
/** Optional choices accepted by selection actions. */
readonly items?: () => readonly ControlChoice[];
/** Named semantic actions callable by the host/agent bridge. */
readonly actions?: Readonly<Record<string, ControlAction>>;
/** Whether the control is currently disabled or read-only (hides callable actions). */
readonly disabled?: () => boolean;
/** Explicit confirmation prompt describing why a person must approve agent actions. */
readonly confirm?: string | (() => string | undefined);
/** Marks values as secret (writable by agent, always redacted in snapshots/observations). */
readonly secret?: boolean | (() => boolean);
/** Hides this control from agent snapshots and invocation. */
readonly hidden?: boolean | (() => boolean);
}; Registration descriptor for a live interactive UI control.
Members
| Name | Type | Description |
|---|---|---|
id | string | Stable semantic identifier, e.g. |
kind | string | Component kind, e.g. |
label? | string | Optional human-readable label (falls back to accessible name of |
element? | () => HTMLElement | null | undefined | Optional root/interactive DOM element for scope filtering and |
state | () => Record<string, unknown> | Live snapshot of state (active tab, open state, value, selected count, etc.). |
items? | () => readonly ControlChoice[] | Optional choices accepted by selection actions. |
actions? | Readonly<Record<string, ControlAction>> | Named semantic actions callable by the host/agent bridge. |
disabled? | () => boolean | Whether the control is currently disabled or read-only (hides callable actions). |
confirm? | string | (() => string | undefined) | Explicit confirmation prompt describing why a person must approve agent actions. |
secret? | boolean | (() => boolean) | Marks values as secret (writable by agent, always redacted in snapshots/observations). |
hidden? | boolean | (() => boolean) | Hides this control from agent snapshots and invocation. |
Source: packages/ui/src/behaviors/controls.svelte.ts:16
ControlInvokeResult type
type ControlInvokeResult = {
readonly ok: boolean;
readonly id?: string;
readonly label?: string;
readonly confirm?: string;
readonly error?: string;
}; Structured result returned by invoke_control.
Members
| Name | Type | Description |
|---|---|---|
ok | boolean | |
id? | string | |
label? | string | |
confirm? | string | |
error? | string |
Source: packages/ui/src/behaviors/controls.svelte.ts:65
ControlSnapshot type
type ControlSnapshot = {
readonly id: string;
readonly kind: string;
readonly label?: string;
readonly state: Record<string, unknown>;
readonly actions: readonly string[];
readonly items?: readonly ControlChoice[];
readonly confirm?: string;
readonly secret?: boolean;
readonly disabled?: boolean;
}; Read-only snapshot of a registered UI control's current state, safety marks and actions.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
state | Record<string, unknown> | |
actions | readonly string[] | |
items? | readonly ControlChoice[] | |
confirm? | string | |
secret? | boolean | |
disabled? | boolean |
Source: packages/ui/src/behaviors/controls.svelte.ts:42
CookieStorageOptions type
type CookieStorageOptions = {
readonly path?: string;
readonly max_age?: number;
readonly same_site?: 'Lax' | 'Strict' | 'None';
readonly secure?: boolean;
}; Options for create_cookie_storage.
Members
| Name | Type | Description |
|---|---|---|
path? | string | |
max_age? | number | |
same_site? | 'Lax' | 'Strict' | 'None' | |
secure? | boolean |
Source: packages/ui/src/behaviors/platform.svelte.ts:398
CropRect type
type CropRect = {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}; Normalized (0..1) crop rectangle over an image.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
width | number | |
height | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1086
DRAG_THRESHOLD const
const DRAG_THRESHOLD: 4 Default movement threshold in CSS px before a press becomes a drag.
Source: packages/ui/src/behaviors/drag.svelte.ts:7
DateFieldBehavior type
type DateFieldBehavior = ReturnType<typeof create_date_field>; Return value of create_date_field.
Members
| Name | Type | Description |
|---|---|---|
segments | readonly DateTimeSegment[] | |
segment_ref | (part: SegmentPart) => Attachment<HTMLElement> | |
segment_attrs | (seg: DateTimeSegment) => { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segmen… |
Source: packages/ui/src/behaviors/date-time.svelte.ts:56
DateFieldOptions type
type DateFieldOptions = {
/** Controlled `DateValue` getter. */
readonly value: () => DateValue | undefined;
/** Called when the complete date/time value changes (or clears to `undefined`). */
readonly on_change: (next: DateValue | undefined) => void;
/** Editing precision: `'day'` (date only), `'hour'` (date + hour), or `'minute'` (date + hour + minute). */
readonly granularity?: () => 'day' | 'hour' | 'minute';
/** BCP-47 locale for segment order and separators (default `'en-US'`). */
readonly locale?: () => string | undefined;
/** Disabled state. */
readonly disabled?: () => boolean;
/** Minimum allowed date value. */
readonly min?: () => DateValue | undefined;
/** Maximum allowed date value. */
readonly max?: () => DateValue | undefined;
}; Options for create_date_field.
Members
| Name | Type | Description |
|---|---|---|
value | () => DateValue | undefined | Controlled |
on_change | (next: DateValue | undefined) => void | Called when the complete date/time value changes (or clears to |
granularity? | () => 'day' | 'hour' | 'minute' | Editing precision: |
locale? | () => string | undefined | BCP-47 locale for segment order and separators (default |
disabled? | () => boolean | Disabled state. |
min? | () => DateValue | undefined | Minimum allowed date value. |
max? | () => DateValue | undefined | Maximum allowed date value. |
Source: packages/ui/src/behaviors/date-time.svelte.ts:38
DateTimeSegment type
type DateTimeSegment = {
/** Segment type (`'year'`, `'month'`, `'day'`, `'hour'`, `'minute'`, or `'literal'`). */
readonly part: SegmentPart;
/** Displayed text (zero-padded value, placeholder token or separator). */
readonly value: string;
/** Whether the segment is currently showing its placeholder rather than a set value. */
readonly placeholder: boolean;
}; One rendered segment of a segmented date or time field.
Members
| Name | Type | Description |
|---|---|---|
part | SegmentPart | Segment type ( |
value | string | Displayed text (zero-padded value, placeholder token or separator). |
placeholder | boolean | Whether the segment is currently showing its placeholder rather than a set value. |
Source: packages/ui/src/behaviors/date-time.svelte.ts:28
Debounced class
class Debounced<T> {
#private;
constructor(getter: () => T, wait?: number | (() => number));
/** The latest settled value. */
get current(): T;
/** Immediately sets the value and cancels any pending debounce timer. */
updateImmediately: (value: T) => void;
/** Cancels any pending scheduled update. */
cancel: () => void;
} Reactive debounced value mirroring getter() after wait ms of inactivity.
Members
| Name | Type | Description |
|---|---|---|
#private | any | |
current | T | The latest settled value. |
updateImmediately | (value: T) => void | Immediately sets the value and cancels any pending debounce timer. |
cancel | () => void | Cancels any pending scheduled update. |
Source: packages/ui/src/behaviors/reactive.svelte.ts:112
Disclosure type
type Disclosure = ReturnType<typeof create_disclosure>; Return value of create_disclosure.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
disabled | boolean | |
state | "open" | "closed" | |
set_open | (next: boolean) => void | |
toggle | () => void | |
show | () => void | |
hide | () => void | |
trigger_attrs | () => { type: "button"; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; onclick: () => void; } | Spread onto the trigger button ( |
content_attrs | () => { id: string; hidden: boolean; "data-state": "open" | "closed"; } | Spread onto the collapsible content element ( |
Source: packages/ui/src/behaviors/disclosure.svelte.ts:21
DisclosureOptions type
type DisclosureOptions = {
/** Controlled open state; omit for internal state. */
open?: () => boolean;
/** Initial open state when uncontrolled (default `false`). */
default_open?: boolean;
/** Called whenever the disclosure opens or closes. */
on_open_change?: (open: boolean) => void;
/** Whether interaction is disabled. */
disabled?: () => boolean;
/** Stable id prefix for `aria-controls`; auto-generated when omitted. */
id?: string;
}; Options for create_disclosure.
Members
| Name | Type | Description |
|---|---|---|
open? | () => boolean | Controlled open state; omit for internal state. |
default_open? | boolean | Initial open state when uncontrolled (default |
on_open_change? | (open: boolean) => void | Called whenever the disclosure opens or closes. |
disabled? | () => boolean | Whether interaction is disabled. |
id? | string | Stable id prefix for |
Source: packages/ui/src/behaviors/disclosure.svelte.ts:7
DismissLayer type
type DismissLayer = ReturnType<typeof create_dismiss>; Return value of create_dismiss.
Members
| Name | Type | Description |
|---|---|---|
depth | number | |
topmost | boolean | |
surface | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/dismiss.svelte.ts:24
DismissOptions type
type DismissOptions = {
/** Whether this layer is currently active/open. */
open: () => boolean;
/** Called when the topmost layer should close. */
on_dismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void;
/** Close on Escape key (default `true`). */
escape?: boolean | (() => boolean);
/** Close on pointerdown outside the attached surface (default `true`). */
outside?: boolean | (() => boolean);
/** Extra elements treated as inside (e.g. an anchor trigger button). */
ignore?: () => readonly (Element | null | undefined)[];
}; Options for create_dismiss.
Members
| Name | Type | Description |
|---|---|---|
open | () => boolean | Whether this layer is currently active/open. |
on_dismiss | (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void | Called when the topmost layer should close. |
escape? | boolean | (() => boolean) | Close on Escape key (default |
outside? | boolean | (() => boolean) | Close on pointerdown outside the attached surface (default |
ignore? | () => readonly (Element | null | undefined)[] | Extra elements treated as inside (e.g. an anchor trigger button). |
Source: packages/ui/src/behaviors/dismiss.svelte.ts:10
DismissReason type
type DismissReason = 'escape' | 'outside'; Why a dismissible layer was closed ('escape' or 'outside').
Source: packages/ui/src/behaviors/dismiss.svelte.ts:7
DragPreviewOptions type
type DragPreviewOptions = {
/** Reactive active drag coordinates (`null` when not dragging). */
readonly point: () => {
readonly x: number;
readonly y: number;
} | null;
/** Offset in px relative to pointer (default `{ x: 12, y: 12 }`). */
readonly offset?: {
readonly x: number;
readonly y: number;
};
}; Options for bind_drag_preview.
Members
| Name | Type | Description |
|---|---|---|
point | () => { readonly x: number; readonly y: number; } | null | Reactive active drag coordinates ( |
offset? | { readonly x: number; readonly y: number; } | Offset in px relative to pointer (default |
Source: packages/ui/src/behaviors/platform.svelte.ts:294
DrawerBehavior type
type DrawerBehavior = ReturnType<typeof create_drawer>; Return value of create_drawer.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
dragging | boolean | |
offset | number | |
snap_index | number | |
snap_fraction | number | |
set_open | (next: boolean) => void | |
set_snap | (idx: number) => void | |
surface | Attachment<HTMLElement> | |
handle | Attachment<HTMLElement> | |
surface_attrs | () => { role: "dialog"; "aria-modal": true | undefined; "aria-label": string | undefined; "data-side": DrawerSide; "data-dragging": string | undefined; "data-state": "open" | "closed"; style: string | undefined; } |
Source: packages/ui/src/behaviors/motion.svelte.ts:122
DrawerOptions type
type DrawerOptions = {
/** Controlled open state; omit for internal state. */
readonly open?: () => boolean;
/** Called when open state changes. */
readonly on_open_change?: (open: boolean) => void;
/** Edge the drawer slides from (default `'bottom'`). */
readonly side?: DrawerSide;
/** Fractional snap points in `(0, 1]` (default `[1]`, e.g. `[0.4, 0.9]`). */
readonly snap_points?: readonly number[];
/** Active snap point index (0-based). */
readonly active_snap?: () => number;
/** Called when the active snap point changes. */
readonly on_snap_change?: (index: number) => void;
/** Whether dragging past the dismissal threshold closes the drawer (default `true`). */
readonly dismissible?: boolean;
/** Trap focus and mark background inert while open (default `true`). */
readonly modal?: boolean;
/** Accessible label for the drawer surface. */
readonly label?: string;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_drawer.
Members
| Name | Type | Description |
|---|---|---|
open? | () => boolean | Controlled open state; omit for internal state. |
on_open_change? | (open: boolean) => void | Called when open state changes. |
side? | DrawerSide | Edge the drawer slides from (default |
snap_points? | readonly number[] | Fractional snap points in |
active_snap? | () => number | Active snap point index (0-based). |
on_snap_change? | (index: number) => void | Called when the active snap point changes. |
dismissible? | boolean | Whether dragging past the dismissal threshold closes the drawer (default |
modal? | boolean | Trap focus and mark background inert while open (default |
label? | string | Accessible label for the drawer surface. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/motion.svelte.ts:98
DrawerSide type
type DrawerSide = 'bottom' | 'top' | 'left' | 'right'; Side from which a swipeable drawer slides in.
Source: packages/ui/src/behaviors/motion.svelte.ts:95
EnterKeyHint type
type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; Label shown on mobile virtual keyboard Return keys (enterkeyhint).
Source: packages/ui/src/behaviors/micro.svelte.ts:432
FieldBehavior type
type FieldBehavior = ReturnType<typeof create_field>; Return value of create_field.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
invalid | boolean | |
error | string | undefined | |
label_attrs | () => { for: string; "data-required": string | undefined; "data-invalid": string | undefined; "data-disabled": string | undefined; } | |
control_attrs | () => { id: string; "aria-describedby": string | undefined; "aria-invalid": true | undefined; "aria-required": true | undefined; disabled: true | undefined; readonly: true | undefined; } | |
description_attrs | () => { id: string; } | |
error_attrs | () => { id: string; role: "alert"; } |
Source: packages/ui/src/behaviors/field.svelte.ts:23
FieldBehaviorOptions type
type FieldBehaviorOptions = {
/** Optional stable id prefix; auto-generated when omitted. */
id?: string;
/** Whether a helper description element is rendered. */
has_description?: () => boolean;
/** Current validation error message (non-empty marks the control invalid). */
error?: () => string | undefined | null;
/** Whether the field is required. */
required?: () => boolean;
/** Whether the field is disabled. */
disabled?: () => boolean;
/** Whether the field is read-only. */
readonly?: () => boolean;
}; Options for create_field.
Members
| Name | Type | Description |
|---|---|---|
id? | string | Optional stable id prefix; auto-generated when omitted. |
has_description? | () => boolean | Whether a helper description element is rendered. |
error? | () => string | undefined | null | Current validation error message (non-empty marks the control invalid). |
required? | () => boolean | Whether the field is required. |
disabled? | () => boolean | Whether the field is disabled. |
readonly? | () => boolean | Whether the field is read-only. |
Source: packages/ui/src/behaviors/field.svelte.ts:7
FileDropzone type
type FileDropzone = ReturnType<typeof create_file_dropzone>; Return value of create_file_dropzone.
Members
| Name | Type | Description |
|---|---|---|
dragging | boolean | |
disabled | boolean | |
open | () => void | |
process | (list: FileList | readonly File[]) => void | |
zone | Attachment<HTMLElement> | |
input | Attachment<HTMLInputElement> | |
input_attrs | () => { type: "file"; accept: string | undefined; multiple: boolean | undefined; disabled: true | undefined; onchange: (event: Event) => void; } |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:740
FileDropzoneOptions type
type FileDropzoneOptions = {
/** Accepted MIME types or extensions (e.g. `['image/*', '.pdf']`). */
readonly accept?: readonly string[];
/** Maximum file size in bytes. */
readonly max_bytes?: number;
/** Maximum number of files accepted in one drop/selection (default unlimited). */
readonly max_files?: number;
/** Disabled state. */
readonly disabled?: () => boolean;
/** Called with validated accepted and rejected files. */
readonly on_files: (result: {
readonly accepted: readonly File[];
readonly rejected: readonly RejectedFile[];
}) => void;
}; Options for create_file_dropzone.
Members
| Name | Type | Description |
|---|---|---|
accept? | readonly string[] | Accepted MIME types or extensions (e.g. |
max_bytes? | number | Maximum file size in bytes. |
max_files? | number | Maximum number of files accepted in one drop/selection (default unlimited). |
disabled? | () => boolean | Disabled state. |
on_files | (result: { readonly accepted: readonly File[]; readonly rejected: readonly RejectedFile[]; }) => void | Called with validated accepted and rejected files. |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:726
FindableOptions type
type FindableOptions = {
/** Whether the panel is currently open/visible. */
readonly open: () => boolean;
/** Whether closed content remains findable via browser Ctrl/Cmd+F (default `true`). */
readonly findable?: () => boolean;
/** Called when browser find-in-page matches text inside the closed panel (`beforematch`). */
readonly on_reveal: (event: Event) => void;
}; Options for bind_findable.
Members
| Name | Type | Description |
|---|---|---|
open | () => boolean | Whether the panel is currently open/visible. |
findable? | () => boolean | Whether closed content remains findable via browser Ctrl/Cmd+F (default |
on_reveal | (event: Event) => void | Called when browser find-in-page matches text inside the closed panel ( |
Source: packages/ui/src/behaviors/presence.svelte.ts:217
FlatTreeRow type
type FlatTreeRow<T = unknown> = {
readonly id: string;
readonly label: string;
readonly depth: number;
readonly parent: string | null;
readonly expandable: boolean;
readonly expanded: boolean;
readonly disabled: boolean;
readonly node: TreeNode<T>;
}; Flattened visible row produced by create_tree with depth and expansion state.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
depth | number | |
parent | string | null | |
expandable | boolean | |
expanded | boolean | |
disabled | boolean | |
node | TreeNode<T> |
Source: packages/ui/src/behaviors/tree.svelte.ts:19
Floating type
type Floating = ReturnType<typeof create_floating>; Return value of create_floating.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
side | FloatingSide | |
anchor_width | number | |
available_width | number | |
available_height | number | |
positioned | boolean | |
style | string | |
set_anchor | (next: FloatingAnchor | null) => void | Sets a programmatic element or virtual |
update | () => void | |
anchor | Attachment<HTMLElement> | |
content | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/floating.svelte.ts:57
FloatingAlign type
type FloatingAlign = 'start' | 'center' | 'end'; Cross-axis alignment relative to the anchor edge.
Source: packages/ui/src/behaviors/floating.svelte.ts:10
FloatingAnchor type
type FloatingAnchor = HTMLElement | VirtualAnchor; Either a live DOM element or a virtual point/rectangle anchor.
Source: packages/ui/src/behaviors/floating.svelte.ts:28
FloatingOptions type
type FloatingOptions = {
/** Whether the floating surface is open. */
readonly open: () => boolean;
/** Called when Escape or an outside pointer press dismisses the surface. */
readonly on_dismiss?: (reason: DismissReason) => void;
/** Optional reactive anchor element or virtual anchor getter. */
readonly anchor?: () => FloatingAnchor | null;
/** Preferred side relative to the anchor (default `'bottom'`). */
readonly side?: FloatingSide | (() => FloatingSide);
/** Cross-axis alignment relative to the anchor (default `'center'`). */
readonly align?: FloatingAlign | (() => FloatingAlign);
/** Gap between anchor and floating surface in px (default `4`). */
readonly side_offset?: number | (() => number);
/** Shift along the cross axis in px (default `0`). */
readonly align_offset?: number | (() => number);
/** Viewport edge padding in px (default `8`). */
readonly padding?: number | (() => number);
/** Flip to the opposite side when viewport room is insufficient (default `true`). */
readonly flip?: boolean | (() => boolean);
/** Close on Escape key (default `true`). */
readonly escape?: boolean | (() => boolean);
/** Close on outside pointer press (default `true`). */
readonly outside?: boolean | (() => boolean);
}; Options for create_floating.
Members
| Name | Type | Description |
|---|---|---|
open | () => boolean | Whether the floating surface is open. |
on_dismiss? | (reason: DismissReason) => void | Called when Escape or an outside pointer press dismisses the surface. |
anchor? | () => FloatingAnchor | null | Optional reactive anchor element or virtual anchor getter. |
side? | FloatingSide | (() => FloatingSide) | Preferred side relative to the anchor (default |
align? | FloatingAlign | (() => FloatingAlign) | Cross-axis alignment relative to the anchor (default |
side_offset? | number | (() => number) | Gap between anchor and floating surface in px (default |
align_offset? | number | (() => number) | Shift along the cross axis in px (default |
padding? | number | (() => number) | Viewport edge padding in px (default |
flip? | boolean | (() => boolean) | Flip to the opposite side when viewport room is insufficient (default |
escape? | boolean | (() => boolean) | Close on Escape key (default |
outside? | boolean | (() => boolean) | Close on outside pointer press (default |
Source: packages/ui/src/behaviors/floating.svelte.ts:31
FloatingSide type
type FloatingSide = 'top' | 'bottom' | 'left' | 'right'; Preferred side of the anchor where the floating surface opens.
Source: packages/ui/src/behaviors/floating.svelte.ts:8
FocusRecovery type
type FocusRecovery<T = unknown> = ReturnType<typeof create_focus_recovery<T>>; Return value of create_focus_recovery.
Members
| Name | Type | Description |
|---|---|---|
item | (key: string, data?: T) => Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:23
FocusRecoveryOptions type
type FocusRecoveryOptions<T = unknown> = {
/** Returns the next element to focus when a bound item unmounts with focus, or null/undefined. */
readonly fallback: (lost: LostFocus<T>) => HTMLElement | null | undefined;
}; Options for create_focus_recovery.
Members
| Name | Type | Description |
|---|---|---|
fallback | (lost: LostFocus<T>) => HTMLElement | null | undefined | Returns the next element to focus when a bound item unmounts with focus, or null/undefined. |
Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:17
FocusTrap type
type FocusTrap = ReturnType<typeof create_focus_trap>; Return value of create_focus_trap.
Members
| Name | Type | Description |
|---|---|---|
container | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/focus-trap.svelte.ts:48
FocusTrapOptions type
type FocusTrapOptions = {
/** Whether focus trapping is active. */
readonly active: () => boolean;
/** Automatically move focus into the container when activated (default `true`). */
readonly auto_focus?: boolean | (() => boolean);
/** Restore focus to the previously active element on close (default `true`). */
readonly restore_focus?: boolean | (() => boolean);
/** Keep Tab / focusin strictly contained inside the container (default `true`). */
readonly trap?: boolean | (() => boolean);
/** Mark background siblings `inert` while active (default `false`; set `true` on modal dialogs). */
readonly modal?: boolean | (() => boolean);
/** Apply ref-counted document scroll lock while active (default `false`). */
readonly prevent_scroll?: boolean | (() => boolean);
/** Optional predicate gating focus-trap listeners to only the topmost stacked layer. */
readonly topmost?: () => boolean;
/** Cancelable hook invoked before initial autofocus runs. */
readonly on_open_auto_focus?: (event: Event) => void;
/** Cancelable hook invoked before focus returns to the previous element on close. */
readonly on_close_auto_focus?: (event: Event) => void;
/** Called when focus escapes outside the container while active. */
readonly on_focus_outside?: (event: FocusEvent) => void;
}; Options for create_focus_trap.
Members
| Name | Type | Description |
|---|---|---|
active | () => boolean | Whether focus trapping is active. |
auto_focus? | boolean | (() => boolean) | Automatically move focus into the container when activated (default |
restore_focus? | boolean | (() => boolean) | Restore focus to the previously active element on close (default |
trap? | boolean | (() => boolean) | Keep Tab / focusin strictly contained inside the container (default |
modal? | boolean | (() => boolean) | Mark background siblings |
prevent_scroll? | boolean | (() => boolean) | Apply ref-counted document scroll lock while active (default |
topmost? | () => boolean | Optional predicate gating focus-trap listeners to only the topmost stacked layer. |
on_open_auto_focus? | (event: Event) => void | Cancelable hook invoked before initial autofocus runs. |
on_close_auto_focus? | (event: Event) => void | Cancelable hook invoked before focus returns to the previous element on close. |
on_focus_outside? | (event: FocusEvent) => void | Called when focus escapes outside the container while active. |
Source: packages/ui/src/behaviors/focus-trap.svelte.ts:24
GridCell type
type GridCell = {
readonly row: number;
readonly col: number;
}; Zero-based (row, col) coordinate in a 2D grid.
Members
| Name | Type | Description |
|---|---|---|
row | number | |
col | number |
Source: packages/ui/src/behaviors/grid.svelte.ts:9
GridFocus type
type GridFocus = ReturnType<typeof create_grid_focus>; Return value of create_grid_focus.
Members
| Name | Type | Description |
|---|---|---|
active | GridCell | null | |
focus | (cell: GridCell, shift?: boolean) => void | |
cell | (cell: GridCell) => Attachment<HTMLElement> | |
grid_attrs | () => { role: "grid"; "aria-rowcount": number; "aria-colcount": number; onkeydown: (event: KeyboardEvent) => void; } | |
cell_attrs | (cell: GridCell) => { role: "gridcell"; "aria-rowindex": number; "aria-colindex": number; "aria-disabled": true | undefined; "data-active": string | undefined; tabindex: number | undefined; onfocus: () => void; } |
Source: packages/ui/src/behaviors/grid.svelte.ts:41
GridFocusOptions type
type GridFocusOptions = {
/** Total row count. */
readonly rows: () => number;
/** Total column count. */
readonly cols: () => number;
/** Controlled active cell; omit for internal state. */
readonly active?: () => GridCell | null;
/** Called whenever the active cell moves. */
readonly on_move?: (cell: GridCell, details: {
readonly from: GridCell | null;
readonly shift: boolean;
}) => void;
/** Rows skipped by PageUp / PageDown (default `10`). */
readonly page_size?: number | (() => number);
/** Skip cells matching this predicate. */
readonly disabled?: (cell: GridCell) => boolean;
/** Scroll an unrendered virtualized cell into view before focusing. */
readonly reveal?: (cell: GridCell) => void;
}; Options for create_grid_focus.
Members
| Name | Type | Description |
|---|---|---|
rows | () => number | Total row count. |
cols | () => number | Total column count. |
active? | () => GridCell | null | Controlled active cell; omit for internal state. |
on_move? | (cell: GridCell, details: { readonly from: GridCell | null; readonly shift: boolean; }) => void | Called whenever the active cell moves. |
page_size? | number | (() => number) | Rows skipped by PageUp / PageDown (default |
disabled? | (cell: GridCell) => boolean | Skip cells matching this predicate. |
reveal? | (cell: GridCell) => void | Scroll an unrendered virtualized cell into view before focusing. |
Source: packages/ui/src/behaviors/grid.svelte.ts:23
HoldInput type
type HoldInput = 'mouse' | 'touch' | 'pen' | 'keyboard'; Input modality that started a hold gesture.
Source: packages/ui/src/behaviors/micro.svelte.ts:196
HoverCardBehavior type
type HoverCardBehavior = ReturnType<typeof create_hover_card>; Return value of create_hover_card.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
present | boolean | |
floating | { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; } | |
set_open | (next: boolean) => void | |
trigger | Attachment<HTMLElement> | |
content | Attachment<HTMLElement> | |
trigger_attrs | () => { "aria-expanded": boolean; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; onfocus: () => void; onblur: () => void; } | |
content_attrs | () => { "data-state": "open" | "closed"; style: string; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:686
HoverCardOptions type
type HoverCardOptions = {
readonly open?: () => boolean;
readonly on_open_change?: (open: boolean) => void;
readonly open_delay?: number;
readonly close_delay?: number;
readonly side?: FloatingSide;
readonly align?: FloatingAlign;
readonly group?: string;
}; Options for create_hover_card.
Members
| Name | Type | Description |
|---|---|---|
open? | () => boolean | |
on_open_change? | (open: boolean) => void | |
open_delay? | number | |
close_delay? | number | |
side? | FloatingSide | |
align? | FloatingAlign | |
group? | string |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:675
HoverIntent type
type HoverIntent = ReturnType<typeof create_hover_intent>; Return value of create_hover_intent.
Members
| Name | Type | Description |
|---|---|---|
enter | (event?: PointerEvent, isTrigger?: boolean) => void | |
leave | (event?: PointerEvent) => void | |
clear | () => void | |
open_now | () => void | |
close_now | () => void |
Source: packages/ui/src/behaviors/hover-intent.svelte.ts:116
HoverIntentOptions type
type HoverIntentOptions = {
/** Trigger element getter. */
readonly trigger: () => HTMLElement | null | undefined;
/** Popup element getter. */
readonly popup: () => HTMLElement | null | undefined;
/** Whether the popup is currently open. */
readonly open: () => boolean;
/** Opens the popup. */
readonly on_open: () => void;
/** Closes the popup. */
readonly on_close: () => void;
/** Open delay in ms when cold (default `120`). */
readonly open_delay?: number | (() => number);
/** Close delay in ms after leaving the safe corridor (default `80`). */
readonly close_delay?: number | (() => number);
/** Shared warm-group key (default `'tooltip'`; pass `null` to opt out). */
readonly group?: string | null;
/** Warm window in ms during which sibling hovers open immediately (default `250`). */
readonly warm_ms?: number;
/** Allow pointer to travel into popup content without closing (default `true`). */
readonly hoverable?: boolean | (() => boolean);
}; Options for create_hover_intent.
Members
| Name | Type | Description |
|---|---|---|
trigger | () => HTMLElement | null | undefined | Trigger element getter. |
popup | () => HTMLElement | null | undefined | Popup element getter. |
open | () => boolean | Whether the popup is currently open. |
on_open | () => void | Opens the popup. |
on_close | () => void | Closes the popup. |
open_delay? | number | (() => number) | Open delay in ms when cold (default |
close_delay? | number | (() => number) | Close delay in ms after leaving the safe corridor (default |
group? | string | null | Shared warm-group key (default |
warm_ms? | number | Warm window in ms during which sibling hovers open immediately (default |
hoverable? | boolean | (() => boolean) | Allow pointer to travel into popup content without closing (default |
Source: packages/ui/src/behaviors/hover-intent.svelte.ts:92
HslaColor type
type HslaColor = {
readonly h: number;
readonly s: number;
readonly l: number;
readonly a: number;
}; HSLA color representation (h in 0..360, s,l in 0..100, a in 0..1).
Members
| Name | Type | Description |
|---|---|---|
h | number | |
s | number | |
l | number | |
a | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:789
HsvaColor type
type HsvaColor = {
readonly h: number;
readonly s: number;
readonly v: number;
readonly a: number;
}; HSVA color representation (h in 0..360, s,v in 0..100, a in 0..1).
Members
| Name | Type | Description |
|---|---|---|
h | number | |
s | number | |
v | number | |
a | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:797
ImageCropperBehavior type
type ImageCropperBehavior = ReturnType<typeof create_image_cropper>; Return value of create_image_cropper.
Members
| Name | Type | Description |
|---|---|---|
crop | CropRect | |
zoom | number | |
rotation | number | |
mover | { readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; 'aria-label': string | undefined; 'data-dragging': string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } | |
resizer | { readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; 'aria-label': string | undefined; 'data-dragging': string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; } | |
set_crop | (next: CropRect) => void | |
set_zoom | (next: number) => void | |
rotate | (deg?: number) => void | |
pixel_crop | (naturalWidth: number, naturalHeight: number) => { x: number; y: number; width: number; height: number; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1104
ImageCropperOptions type
type ImageCropperOptions = {
readonly default_crop?: CropRect;
readonly aspect?: () => number | undefined;
readonly min_size?: number;
readonly on_change?: (crop: CropRect, meta: {
readonly zoom: number;
readonly rotation: number;
}) => void;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_image_cropper.
Members
| Name | Type | Description |
|---|---|---|
default_crop? | CropRect | |
aspect? | () => number | undefined | |
min_size? | number | |
on_change? | (crop: CropRect, meta: { readonly zoom: number; readonly rotation: number; }) => void | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1094
InertHandle type
type InertHandle = (() => void) & {
/** Exempts an additional element (e.g. a popover portaled into `document.body`) while active. */
readonly keep: (el: HTMLElement) => () => void;
}; Handle returned by inert_outside allowing portaled child popups to stay interactive.
Members
| Name | Type | Description |
|---|---|---|
keep | (el: HTMLElement) => () => void | Exempts an additional element (e.g. a popover portaled into |
Source: packages/ui/src/behaviors/modal.svelte.ts:95
InlineEdit type
type InlineEdit = ReturnType<typeof create_inline_edit>; Return value of create_inline_edit.
Members
| Name | Type | Description |
|---|---|---|
editing | string | null | |
draft | string | |
is_editing | (id: string) => boolean | |
begin | (id: string, reason: InlineEditReason, initial?: string, origin?: HTMLElement | null) => void | |
commit | (reason?: InlineEditReason) => boolean | |
cancel | (reason?: InlineEditReason) => void | |
input | Attachment<HTMLInputElement | HTMLTextAreaElement> | |
cell_attrs | (id: string) => { "data-editing": string | undefined; ondblclick: (event: MouseEvent) => void; onkeydown: (event: KeyboardEvent) => void; } | |
input_attrs | () => { value: string; oninput: (event: Event) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; } |
Source: packages/ui/src/behaviors/grid.svelte.ts:387
InlineEditOptions type
type InlineEditOptions = {
/** Reads the current text for `id` when editing starts. */
readonly value: (id: string) => string;
/** Persists the edited text; return `false` to keep editing (e.g. validation error). */
readonly commit: (id: string, text: string, reason: InlineEditReason) => boolean | void;
/** Optional disabled predicate per id. */
readonly disabled?: (id: string) => boolean;
/** Called when Tab commits so an enclosing grid can advance to the next/previous cell. */
readonly on_tab?: (id: string, direction: 1 | -1) => void;
}; Options for create_inline_edit.
Members
| Name | Type | Description |
|---|---|---|
value | (id: string) => string | Reads the current text for |
commit | (id: string, text: string, reason: InlineEditReason) => boolean | void | Persists the edited text; return |
disabled? | (id: string) => boolean | Optional disabled predicate per id. |
on_tab? | (id: string, direction: 1 | -1) => void | Called when Tab commits so an enclosing grid can advance to the next/previous cell. |
Source: packages/ui/src/behaviors/grid.svelte.ts:375
InlineEditReason type
type InlineEditReason = 'edit-key' | 'type' | 'double-click' | 'enter-key' | 'escape-key' | 'focus-out' | 'tab-key' | 'imperative'; Why an inline edit started or finished.
Source: packages/ui/src/behaviors/grid.svelte.ts:364
InputHintKind type
type InputHintKind = 'search' | 'email' | 'tel' | 'url' | 'one-time-code' | 'numeric' | 'decimal' | 'name' | 'username' | 'current-password' | 'new-password' | 'postal-code' | 'message'; Supported semantic input hint presets.
Source: packages/ui/src/behaviors/micro.svelte.ts:435
InputHints type
type InputHints = {
readonly inputmode?: 'search' | 'email' | 'tel' | 'url' | 'numeric' | 'decimal';
readonly enterkeyhint?: EnterKeyHint;
readonly autocomplete?: string;
readonly autocapitalize?: 'none' | 'sentences' | 'words' | 'characters';
readonly autocorrect?: 'on' | 'off';
readonly spellcheck?: boolean;
}; HTML input hint attributes returned by input_hints.
Members
| Name | Type | Description |
|---|---|---|
inputmode? | 'search' | 'email' | 'tel' | 'url' | 'numeric' | 'decimal' | |
enterkeyhint? | EnterKeyHint | |
autocomplete? | string | |
autocapitalize? | 'none' | 'sentences' | 'words' | 'characters' | |
autocorrect? | 'on' | 'off' | |
spellcheck? | boolean |
Source: packages/ui/src/behaviors/micro.svelte.ts:451
InputHistory type
type InputHistory<T = string> = ReturnType<typeof create_input_history<T>>; Return value of create_input_history.
Members
| Name | Type | Description |
|---|---|---|
index | number | null | |
browsing | boolean | |
onkeydown | (event: KeyboardEvent) => void | |
reset | () => void |
Source: packages/ui/src/behaviors/micro.svelte.ts:22
InputHistoryOptions type
type InputHistoryOptions<T = string> = {
/** Past entries, oldest first. */
readonly entries: () => readonly T[];
/** Reads the current composer value. */
readonly read: () => T;
/** Writes a recalled value into the composer; return `false` to cancel navigation. */
readonly write: (value: T, event: KeyboardEvent) => boolean | void;
/** Custom edge detector; defaults to first/last line of `<textarea>` or anywhere in `<input>`. */
readonly at_edge?: (direction: 'up' | 'down', event: KeyboardEvent) => boolean;
}; Options for create_input_history.
Members
| Name | Type | Description |
|---|---|---|
entries | () => readonly T[] | Past entries, oldest first. |
read | () => T | Reads the current composer value. |
write | (value: T, event: KeyboardEvent) => boolean | void | Writes a recalled value into the composer; return |
at_edge? | (direction: 'up' | 'down', event: KeyboardEvent) => boolean | Custom edge detector; defaults to first/last line of |
Source: packages/ui/src/behaviors/micro.svelte.ts:10
InputModality type
type InputModality = 'keyboard' | 'pointer'; Input interaction modality ('keyboard' vs 'pointer').
Source: packages/ui/src/behaviors/platform.svelte.ts:239
LassoBehavior type
type LassoBehavior = ReturnType<typeof create_lasso>; Return value of create_lasso.
Members
| Name | Type | Description |
|---|---|---|
rect | LassoRect | null | |
active | boolean | |
surface | Attachment<HTMLElement> | |
item | (key: string) => Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/canvas.svelte.ts:435
LassoOptions type
type LassoOptions = {
/** Called continuously as the marquee rectangle changes with intersecting item keys. */
readonly on_change: (keys: readonly string[], rect: LassoRect) => void;
/** Called when the marquee drag finishes. */
readonly on_commit?: (keys: readonly string[]) => void;
}; Options for create_lasso.
Members
| Name | Type | Description |
|---|---|---|
on_change | (keys: readonly string[], rect: LassoRect) => void | Called continuously as the marquee rectangle changes with intersecting item keys. |
on_commit? | (keys: readonly string[]) => void | Called when the marquee drag finishes. |
Source: packages/ui/src/behaviors/canvas.svelte.ts:427
LassoRect type
type LassoRect = {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}; Marquee rectangle in container-relative coordinates.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
width | number | |
height | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:424
Listbox type
type Listbox<T extends ListboxItem = ListboxItem> = ReturnType<typeof create_listbox<T>>; Return value of create_listbox.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
query | string | |
items | readonly T[] | |
active | string | |
active_id | string | undefined | |
selected | readonly string[] | |
count | number | |
is_selected | (key: string) => boolean | |
choose | (key: string) => void | |
toggle | (key: string) => void | |
toggle_all | () => void | |
clear | () => void | |
focus | (key: string) => void | |
highlight | (key: string) => void | |
activate_active | () => void | |
item | (key: string) => import("svelte/attachments").Attachment<HTMLElement> | |
input_attrs | (open?: boolean) => { role: "combobox"; "aria-autocomplete": "list"; "aria-expanded": boolean; "aria-controls": string; "aria-activedescendant": string | undefined; onkeydown: (event: KeyboardEvent) => void; } | Spread onto a search/combobox |
list_attrs | () => { id: string; role: "listbox"; "aria-multiselectable": true | undefined; onkeydown: (event: KeyboardEvent) => void; } | Spread onto the listbox container ( |
option_attrs | (value: string) => { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-highlighted": string | undefined; tabindex: number | undefined; onfocus: (() => void) | undefined; onpointerdown: ((event: PointerEvent) => void) | undefined; onpointermove: () => void; onclick: (event: MouseEvent) => void; } | Spread onto each option element ( |
Source: packages/ui/src/behaviors/listbox.svelte.ts:47
ListboxFocusMode type
type ListboxFocusMode = 'dom' | 'virtual'; Focus strategy: 'dom' moves real focus across options; 'virtual' keeps focus in a search input via aria-activedescendant.
Source: packages/ui/src/behaviors/listbox.svelte.ts:18
ListboxItem type
type ListboxItem = {
readonly value: string;
readonly label: string;
readonly keywords?: string;
readonly disabled?: boolean;
}; One selectable option inside create_listbox.
Members
| Name | Type | Description |
|---|---|---|
value | string | |
label | string | |
keywords? | string | |
disabled? | boolean |
Source: packages/ui/src/behaviors/listbox.svelte.ts:10
ListboxOptions type
type ListboxOptions<T extends ListboxItem = ListboxItem> = {
/** All items in visual order. */
readonly items: () => readonly T[];
/** Selection mode (default `'single'`). */
readonly mode?: SelectionMode | (() => SelectionMode);
/** Focus strategy: `'dom'` (default) or `'virtual'` (`aria-activedescendant`). */
readonly focus?: ListboxFocusMode;
/** Controlled selected values; omit for internal state. */
readonly selected?: () => readonly string[];
/** Initial selected values when uncontrolled. */
readonly default_selected?: readonly string[];
/** Called when selection changes. */
readonly on_change?: (values: readonly string[]) => void;
/** Called when an item is explicitly activated (Enter / click in single mode). */
readonly on_activate?: (item: T) => void;
/** Optional custom filter; defaults to case-insensitive substring match on label + keywords. Pass `false` for externally filtered/async lists. */
readonly filter?: false | ((item: T, query: string) => boolean);
/** Enable incremental typeahead when not typing in a search input (default `true` in `'dom'` mode, `false` in `'virtual'` mode). */
readonly typeahead?: boolean;
/** Wrap arrow navigation at list ends (default `true`). */
readonly loop?: boolean;
/** Optional stable id prefix for `aria-controls` / `aria-activedescendant`. */
readonly id?: string;
}; Options for create_listbox.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly T[] | All items in visual order. |
mode? | SelectionMode | (() => SelectionMode) | Selection mode (default |
focus? | ListboxFocusMode | Focus strategy: |
selected? | () => readonly string[] | Controlled selected values; omit for internal state. |
default_selected? | readonly string[] | Initial selected values when uncontrolled. |
on_change? | (values: readonly string[]) => void | Called when selection changes. |
on_activate? | (item: T) => void | Called when an item is explicitly activated (Enter / click in single mode). |
filter? | false | ((item: T, query: string) => boolean) | Optional custom filter; defaults to case-insensitive substring match on label + keywords. Pass |
typeahead? | boolean | Enable incremental typeahead when not typing in a search input (default |
loop? | boolean | Wrap arrow navigation at list ends (default |
id? | string | Optional stable id prefix for |
Source: packages/ui/src/behaviors/listbox.svelte.ts:21
LostFocus type
type LostFocus<T = unknown> = {
/** Stable key of the removed item. */
readonly key: string;
/** Optional caller metadata attached to the item. */
readonly data: T | undefined;
/** The removed DOM element. */
readonly element: HTMLElement;
}; Info about a bound element that left the DOM while holding focus.
Members
| Name | Type | Description |
|---|---|---|
key | string | Stable key of the removed item. |
data | T | undefined | Optional caller metadata attached to the item. |
element | HTMLElement | The removed DOM element. |
Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:7
MatchRange type
type MatchRange = {
readonly start: number;
readonly end: number;
}; Half-open character range [start, end) inside the original text string.
Members
| Name | Type | Description |
|---|---|---|
start | number | |
end | number |
Source: packages/ui/src/behaviors/text-match.ts:5
MatchSegment type
type MatchSegment = {
readonly text: string;
readonly matched: boolean;
}; One contiguous highlighted or plain text segment produced by match_segments.
Members
| Name | Type | Description |
|---|---|---|
text | string | |
matched | boolean |
Source: packages/ui/src/behaviors/text-match.ts:11
MatchShortcutOptions type
type MatchShortcutOptions = {
/** When `true`, `'mod'` only matches `Meta` on Apple platforms and `Control` elsewhere (default `false`). */
readonly strict_platform?: boolean;
}; Options for matches_shortcut.
Members
| Name | Type | Description |
|---|---|---|
strict_platform? | boolean | When |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:81
Menu type
type Menu<T extends MenuItem = MenuItem> = ReturnType<typeof create_menu<T>>; Return value of create_menu.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
active | string | |
floating | { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; } | |
open_at | (point: { x: number; y: number; }) => void | |
open_menu | () => void | |
close | () => void | |
toggle | () => void | |
trigger | Attachment<HTMLElement> | |
content | Attachment<HTMLElement> | |
context_area | Attachment<HTMLElement> | |
item | (key: string) => Attachment<HTMLElement> | |
trigger_attrs | () => { type: "button"; "aria-haspopup": "menu"; "aria-expanded": boolean; "aria-controls": string | undefined; "data-state": "open" | "closed"; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; } | |
menu_attrs | () => { id: string; role: "menu"; "aria-label": string | undefined; "data-state": "open" | "closed"; "data-side": FloatingSide; style: string; onkeydown: (event: KeyboardEvent) => void; } | |
item_attrs | (id: string) => { role: "menuitem" | "menuitemcheckbox" | "menuitemradio"; "aria-disabled": true | undefined; "aria-checked": boolean | undefined; "data-highlighted": string | undefined; "data-disabled": string | undefined; tabindex: number | undefined; onfocus: () => void; onpointermove: () => void; onclick: (event: MouseEvent) => void; } |
Source: packages/ui/src/behaviors/menu.svelte.ts:45
MenuItem type
type MenuItem = {
readonly id: string;
readonly label: string;
readonly disabled?: boolean;
readonly role?: 'menuitem' | 'menuitemcheckbox' | 'menuitemradio';
readonly checked?: boolean;
readonly on_select?: () => void;
}; One menu item descriptor for create_menu.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
disabled? | boolean | |
role? | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | |
checked? | boolean | |
on_select? | () => void |
Source: packages/ui/src/behaviors/menu.svelte.ts:13
MenuOptions type
type MenuOptions<T extends MenuItem = MenuItem> = {
/** Ordered menu items. */
readonly items: () => readonly T[];
/** Controlled open state; omit for internal state. */
readonly open?: () => boolean;
/** Called when open state changes. */
readonly on_open_change?: (open: boolean) => void;
/** Called when any enabled menu item is activated. */
readonly on_select?: (item: T) => void;
/** Close the menu after selecting a regular `menuitem` (default `true`). */
readonly close_on_select?: boolean;
/** Preferred side relative to trigger (default `'bottom'`). */
readonly side?: FloatingSide;
/** Cross-axis alignment relative to trigger (default `'start'`). */
readonly align?: FloatingAlign;
/** Accessible name for the menu. */
readonly label?: string;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_menu.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly T[] | Ordered menu items. |
open? | () => boolean | Controlled open state; omit for internal state. |
on_open_change? | (open: boolean) => void | Called when open state changes. |
on_select? | (item: T) => void | Called when any enabled menu item is activated. |
close_on_select? | boolean | Close the menu after selecting a regular |
side? | FloatingSide | Preferred side relative to trigger (default |
align? | FloatingAlign | Cross-axis alignment relative to trigger (default |
label? | string | Accessible name for the menu. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/menu.svelte.ts:23
MenubarBehavior type
type MenubarBehavior = ReturnType<typeof create_menubar>; Return value of create_menubar.
Members
| Name | Type | Description |
|---|---|---|
open_menu | string | null | |
is_open | (id: string) => boolean | |
open | (id: string) => void | |
close | () => void | |
root | Attachment<HTMLElement> | |
item | (key: string) => Attachment<HTMLElement> | |
root_attrs | () => { role: "menubar"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; } | |
trigger_attrs | (id: string) => { type: "button"; role: "menuitem"; "aria-haspopup": "menu"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:406
MenubarOptions type
type MenubarOptions = {
readonly menus: () => readonly string[];
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_menubar.
Members
| Name | Type | Description |
|---|---|---|
menus | () => readonly string[] | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:399
MoveBehavior type
type MoveBehavior = ReturnType<typeof create_move>; Return value of create_move.
Members
| Name | Type | Description |
|---|---|---|
dragging | boolean | |
handle | Attachment<HTMLElement> | |
handle_attrs | () => { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/canvas.svelte.ts:30
MoveOptions type
type MoveOptions = {
readonly position: () => MovePoint;
readonly on_change: (next: MovePoint) => void;
readonly on_commit?: (final: MovePoint) => void;
readonly step?: number;
readonly grid?: number;
readonly bounds?: () => {
readonly min_x: number;
readonly max_x: number;
readonly min_y: number;
readonly max_y: number;
};
readonly scale?: () => number;
readonly label?: string;
}; Options for create_move.
Members
| Name | Type | Description |
|---|---|---|
position | () => MovePoint | |
on_change | (next: MovePoint) => void | |
on_commit? | (final: MovePoint) => void | |
step? | number | |
grid? | number | |
bounds? | () => { readonly min_x: number; readonly max_x: number; readonly min_y: number; readonly max_y: number; } | |
scale? | () => number | |
label? | string |
Source: packages/ui/src/behaviors/canvas.svelte.ts:18
MovePoint type
type MovePoint = {
readonly x: number;
readonly y: number;
}; 2D coordinate point.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:15
NavigationMenuBehavior type
type NavigationMenuBehavior = ReturnType<typeof create_navigation_menu>; Return value of create_navigation_menu.
Members
| Name | Type | Description |
|---|---|---|
active | string | null | |
is_open | (id: string) => boolean | |
open | (id: string) => void | |
close | () => void | |
root | Attachment<HTMLElement> | |
item | (key: string) => Attachment<HTMLElement> | |
root_attrs | () => { "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; } | |
trigger_attrs | (id: string) => { type: "button"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; } | |
content_attrs | () => { onpointerenter: () => void; onpointerleave: () => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:529
NavigationMenuOptions type
type NavigationMenuOptions = {
readonly items: () => readonly string[];
readonly open_delay?: number;
readonly close_delay?: number;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_navigation_menu.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | |
open_delay? | number | |
close_delay? | number | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:520
NumberInputOptions type
type NumberInputOptions = {
readonly value?: () => number | null;
readonly default_value?: number | null;
readonly on_change?: (value: number | null) => void;
readonly min?: number;
readonly max?: number;
readonly step?: number;
readonly locale?: string;
readonly disabled?: () => boolean;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_number_input.
Members
| Name | Type | Description |
|---|---|---|
value? | () => number | null | |
default_value? | number | null | |
on_change? | (value: number | null) => void | |
min? | number | |
max? | number | |
step? | number | |
locale? | string | |
disabled? | () => boolean | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:261
Overflow type
type Overflow<T> = ReturnType<typeof create_overflow<T>>; Return value of create_overflow.
Members
| Name | Type | Description |
|---|---|---|
fit | number | |
visible | readonly T[] | |
hidden | readonly T[] | |
has_overflow | boolean | |
active_in_hidden | boolean | |
more_open | boolean | |
list | Attachment<HTMLElement> | |
measure | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/overflow.svelte.ts:18
OverflowOptions type
type OverflowOptions<T> = {
/** All items in display order. */
items: () => readonly T[];
/** Key extractor for checking whether the active item is currently inside the overflow menu. */
key?: (item: T) => string;
/** Currently active key (optional). */
active?: () => string | undefined;
}; Options for create_overflow.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly T[] | All items in display order. |
key? | (item: T) => string | Key extractor for checking whether the active item is currently inside the overflow menu. |
active? | () => string | undefined | Currently active key (optional). |
Source: packages/ui/src/behaviors/overflow.svelte.ts:8
OverlayEntry type
type OverlayEntry<Payload, Result = unknown> = {
readonly id: string;
readonly payload: Payload;
readonly resolve: (result: Result | undefined) => void;
}; One entry in an imperative create_overlay_stack.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
payload | Payload | |
resolve | (result: Result | undefined) => void |
Source: packages/ui/src/behaviors/platform.svelte.ts:448
PageControlsOptions type
type PageControlsOptions = {
/** Only return controls whose `element()` sits inside this container. */
readonly within?: Element | null;
/** Optional substring filter over id, kind, or label. */
readonly query?: string;
/** Maximum number of controls to return. */
readonly limit?: number;
}; Options for filtering page_controls.
Members
| Name | Type | Description |
|---|---|---|
within? | Element | null | Only return controls whose |
query? | string | Optional substring filter over id, kind, or label. |
limit? | number | Maximum number of controls to return. |
Source: packages/ui/src/behaviors/controls.svelte.ts:55
Pagination type
type Pagination = ReturnType<typeof create_pagination>; Return value of create_pagination.
Members
| Name | Type | Description |
|---|---|---|
page | number | |
pages | number | null | |
has_previous | boolean | |
has_next | boolean | |
range | PaginationEntry[] | |
go | (target: number) => void | |
previous | () => void | |
next | () => void | |
first | () => void | |
last | () => void |
Source: packages/ui/src/behaviors/pagination.svelte.ts:29
PaginationEntry type
type PaginationEntry = number | 'ellipsis'; One entry in a compact pagination window: a 1-based page number or 'ellipsis'.
Source: packages/ui/src/behaviors/pagination.svelte.ts:6
PaginationOptions type
type PaginationOptions = {
/** Current 1-based page number (controlled getter, or omit for internal state). */
page?: () => number;
/** Initial 1-based page when uncontrolled (default `1`). */
default_page?: number;
/** Total page count (`null` when unknown / keyset-paged). */
total_pages: () => number | null;
/** Explicit previous availability override (for cursor/keyset pagination). */
has_previous?: () => boolean;
/** Explicit next availability override (for cursor/keyset pagination). */
has_next?: () => boolean;
/** Called when the page changes. */
on_page_change?: (page: number) => void;
/** Sibling pages shown on each side of the current page in `range` (default `1`). */
siblings?: number;
/** Optional semantic control registration for Norbius's `page` bridge. */
control?: {
id: string;
label?: string;
};
}; Options for create_pagination.
Members
| Name | Type | Description |
|---|---|---|
page? | () => number | Current 1-based page number (controlled getter, or omit for internal state). |
default_page? | number | Initial 1-based page when uncontrolled (default |
total_pages | () => number | null | Total page count ( |
has_previous? | () => boolean | Explicit previous availability override (for cursor/keyset pagination). |
has_next? | () => boolean | Explicit next availability override (for cursor/keyset pagination). |
on_page_change? | (page: number) => void | Called when the page changes. |
siblings? | number | Sibling pages shown on each side of the current page in |
control? | { id: string; label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/pagination.svelte.ts:9
PanelGroup type
type PanelGroup = ReturnType<typeof create_panel_group>; Return value of create_panel_group.
Members
| Name | Type | Description |
|---|---|---|
sizes | readonly number[] | |
dragging | number | null | |
size_of | (index: number) => number | |
reset | () => void | |
container | Attachment<HTMLElement> | |
handle | (handleIndex: number) => Attachment<HTMLElement> | |
handle_attrs | (handleIndex: number) => { role: "separator"; tabindex: number; "aria-orientation": "horizontal" | "vertical"; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number; "data-dragging": string | undefined; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:42
PanelGroupOptions type
type PanelGroupOptions = {
readonly panels: readonly PanelSpec[];
readonly direction?: 'horizontal' | 'vertical';
readonly storage_key?: string;
readonly on_layout?: (sizes: readonly number[]) => void;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_panel_group.
Members
| Name | Type | Description |
|---|---|---|
panels | readonly PanelSpec[] | |
direction? | 'horizontal' | 'vertical' | |
storage_key? | string | |
on_layout? | (sizes: readonly number[]) => void | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:33
PanelSpec type
type PanelSpec = {
readonly id: string;
readonly default_size: number;
readonly min_size?: number;
readonly max_size?: number;
readonly collapsible?: boolean;
}; Configuration for one pane inside create_panel_group.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
default_size | number | |
min_size? | number | |
max_size? | number | |
collapsible? | boolean |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:24
PasswordInput type
type PasswordInput = ReturnType<typeof create_password_input>; Return value of create_password_input.
Members
| Name | Type | Description |
|---|---|---|
visible | boolean | |
caps_lock | boolean | |
toggle | () => void | |
set_visible | (next: boolean) => void | |
input | Attachment<HTMLInputElement> | |
input_attrs | () => { type: "text" | "password"; "data-agent-secret": string; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; onkeyup: (event: KeyboardEvent) => void; } | |
toggle_attrs | () => { type: "button"; "aria-pressed": boolean; "aria-label": string; onclick: () => void; } |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:882
PasswordInputOptions type
type PasswordInputOptions = {
/** Initial visibility (default `false`). */
readonly default_visible?: boolean;
/** Accessible label for the password input. */
readonly label?: string;
/** Optional semantic control registration (always marked `secret: true`). */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_password_input.
Members
| Name | Type | Description |
|---|---|---|
default_visible? | boolean | Initial visibility (default |
label? | string | Accessible label for the password input. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration (always marked |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:872
PatternViolation type
type PatternViolation = {
readonly rule: string;
readonly message: string;
readonly element?: Element;
}; One contract violation detected by check_pattern or check_direction.
Members
| Name | Type | Description |
|---|---|---|
rule | string | |
message | string | |
element? | Element |
Source: packages/ui/src/behaviors/testing.ts:21
PersistedState class
class PersistedState<T> {
#private;
constructor(key: string, initialValue: T, options?: PersistedStateOptions<T>);
/** Current persisted value. */
get current(): T;
set current(value: T);
} Reactive state synchronized with localStorage or sessionStorage with safe fallback when storage is unavailable or contains malformed JSON.
Members
| Name | Type | Description |
|---|---|---|
#private | any | |
current | T | Current persisted value. |
Source: packages/ui/src/behaviors/reactive.svelte.ts:213
PersistedStateOptions type
type PersistedStateOptions<T> = {
/** Browser storage backend (`'local'` default, or `'session'`). */
readonly storage?: 'local' | 'session';
/** Custom serializer; defaults to JSON. */
readonly serializer?: {
readonly serialize: (value: T) => string;
readonly deserialize: (raw: string) => T;
};
}; Storage options for PersistedState.
Members
| Name | Type | Description |
|---|---|---|
storage? | 'local' | 'session' | Browser storage backend ( |
serializer? | { readonly serialize: (value: T) => string; readonly deserialize: (raw: string) => T; } | Custom serializer; defaults to JSON. |
Source: packages/ui/src/behaviors/reactive.svelte.ts:195
PinCell type
type PinCell = {
/** Zero-based index of this cell. */
readonly index: number;
/** Character currently in this cell, or `null` when empty. */
readonly char: string | null;
/** Whether this cell holds the active caret position. */
readonly is_active: boolean;
/** Whether to draw a blinking caret inside this empty active cell. */
readonly has_fake_caret: boolean;
}; One visual cell of a PIN / OTP code.
Members
| Name | Type | Description |
|---|---|---|
index | number | Zero-based index of this cell. |
char | string | null | Character currently in this cell, or |
is_active | boolean | Whether this cell holds the active caret position. |
has_fake_caret | boolean | Whether to draw a blinking caret inside this empty active cell. |
Source: packages/ui/src/behaviors/pin.svelte.ts:6
PinInputBehavior type
type PinInputBehavior = ReturnType<typeof create_pin_input>; Return value of create_pin_input.
Members
| Name | Type | Description |
|---|---|---|
value | string | |
cells | readonly PinCell[] | |
focused | boolean | |
set_value | (raw: string) => void | |
input_attrs | () => { value: string; maxlength: number; disabled: true | undefined; onfocus: (event: FocusEvent) => void; onblur: () => void; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onselect: (event: Event) => void; } | Spread onto the underlying |
Source: packages/ui/src/behaviors/pin.svelte.ts:43
PinInputOptions type
type PinInputOptions = {
/** Number of cells (e.g. `6`). */
readonly length: number | (() => number);
/** Controlled value getter; omit for internal state. */
readonly value?: () => string;
/** Initial value when uncontrolled. */
readonly default_value?: string;
/** Called whenever the sanitized value changes. */
readonly on_value_change?: (value: string) => void;
/** Called when the value reaches `length` characters. */
readonly on_complete?: (value: string) => void;
/** Allowed character filter regex (default digits only `/^\d+$/`). */
readonly pattern?: RegExp;
/** Disabled state. */
readonly disabled?: () => boolean;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
readonly secret?: boolean;
readonly element?: () => HTMLElement | null;
};
}; Options for create_pin_input.
Members
| Name | Type | Description |
|---|---|---|
length | number | (() => number) | Number of cells (e.g. |
value? | () => string | Controlled value getter; omit for internal state. |
default_value? | string | Initial value when uncontrolled. |
on_value_change? | (value: string) => void | Called whenever the sanitized value changes. |
on_complete? | (value: string) => void | Called when the value reaches |
pattern? | RegExp | Allowed character filter regex (default digits only |
disabled? | () => boolean | Disabled state. |
control? | { readonly id: string; readonly label?: string; readonly secret?: boolean; readonly element?: () => HTMLElement | null; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/pin.svelte.ts:18
PointerKindState type
type PointerKindState = {
readonly precision: PointerPrecision;
readonly hover: boolean;
}; Current device pointer capabilities.
Members
| Name | Type | Description |
|---|---|---|
precision | PointerPrecision | |
hover | boolean |
Source: packages/ui/src/behaviors/platform.svelte.ts:104
PointerPrecision type
type PointerPrecision = 'coarse' | 'fine'; Primary pointer precision ('coarse' touch vs 'fine' mouse/trackpad).
Source: packages/ui/src/behaviors/platform.svelte.ts:101
PointerSample type
type PointerSample = {
readonly x: number;
readonly y: number;
readonly start_x: number;
readonly start_y: number;
readonly dx: number;
readonly dy: number;
readonly event: PointerEvent;
}; Live pointer position and delta reported by bind_drag.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
start_x | number | |
start_y | number | |
dx | number | |
dy | number | |
event | PointerEvent |
Source: packages/ui/src/behaviors/drag.svelte.ts:10
PortalOptions type
type PortalOptions = {
/** Mount element, CSS selector, or `null` to render in place. */
readonly to?: PortalTarget;
/** When `true`, keeps the element in place instead of teleporting it. */
readonly disabled?: boolean;
}; Options object accepted by portal(...).
Members
| Name | Type | Description |
|---|---|---|
to? | PortalTarget | Mount element, CSS selector, or |
disabled? | boolean | When |
Source: packages/ui/src/behaviors/portal.svelte.ts:13
PortalTarget type
type PortalTarget = HTMLElement | string | null | undefined; Target element, CSS selector or null to disable teleporting and render in place.
Source: packages/ui/src/behaviors/portal.svelte.ts:10
Presence type
type Presence = ReturnType<typeof create_presence>; Return value of create_presence.
Members
| Name | Type | Description |
|---|---|---|
present | boolean | |
state | PresenceState | |
exiting | boolean | |
attach | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/presence.svelte.ts:18
PresenceOptions type
type PresenceOptions = {
/** Reactive open getter. */
readonly open: () => boolean;
/** Called once enter or exit settles. */
readonly on_complete?: (open: boolean) => void;
}; Options for create_presence.
Members
| Name | Type | Description |
|---|---|---|
open | () => boolean | Reactive open getter. |
on_complete? | (open: boolean) => void | Called once enter or exit settles. |
Source: packages/ui/src/behaviors/presence.svelte.ts:10
PresenceState type
type PresenceState = 'entering' | 'open' | 'exiting' | 'closed'; Lifecycle phase of a presence-managed element.
Source: packages/ui/src/behaviors/presence.svelte.ts:7
PreviewOptions type
type PreviewOptions<T> = {
/** Committed authoritative value. */
readonly value: () => T;
/** Called when a preview is explicitly committed. */
readonly on_commit: (value: T) => void;
}; Options for create_preview.
Members
| Name | Type | Description |
|---|---|---|
value | () => T | Committed authoritative value. |
on_commit | (value: T) => void | Called when a preview is explicitly committed. |
Source: packages/ui/src/behaviors/platform.svelte.ts:325
PreviewState type
type PreviewState<T> = ReturnType<typeof create_preview<T>>; Return value of create_preview.
Members
| Name | Type | Description |
|---|---|---|
current | T | |
previewing | boolean | |
update | (next: T) => void | |
commit | (finalValue?: T) => void | |
cancel | () => void |
Source: packages/ui/src/behaviors/platform.svelte.ts:333
RadioGroupOptions type
type RadioGroupOptions = {
readonly items: () => readonly string[];
readonly value?: () => string | undefined;
readonly default_value?: string;
readonly on_change?: (value: string) => void;
readonly orientation?: RovingOrientation;
readonly disabled?: (value: string) => boolean;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_radio_group.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | |
value? | () => string | undefined | |
default_value? | string | |
on_change? | (value: string) => void | |
orientation? | RovingOrientation | |
disabled? | (value: string) => boolean | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:86
RatingOptions type
type RatingOptions = {
readonly max?: number;
readonly value?: () => number;
readonly default_value?: number;
readonly on_change?: (value: number) => void;
readonly disabled?: () => boolean;
readonly label?: string;
}; Options for create_rating.
Members
| Name | Type | Description |
|---|---|---|
max? | number | |
value? | () => number | |
default_value? | number | |
on_change? | (value: number) => void | |
disabled? | () => boolean | |
label? | string |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:414
RejectedFile type
type RejectedFile = {
readonly file: File;
readonly reason: 'type' | 'size' | 'count';
}; One rejected file from create_file_dropzone validation.
Members
| Name | Type | Description |
|---|---|---|
file | File | |
reason | 'type' | 'size' | 'count' |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:720
Reorder type
type Reorder = ReturnType<typeof create_reorder>; Return value of create_reorder.
Members
| Name | Type | Description |
|---|---|---|
dragging | string | null | |
over | string | null | |
move | (fromIndex: number, toIndex: number) => void | |
move_by | (key: string, delta: number) => void | |
item | (key: string) => Attachment<HTMLElement> | Optional pointer-capture drag attachment (works cleanly on touch & supports edge auto-scroll + Escape cancel). |
item_attrs | (key: string) => { draggable: boolean; "data-dragging": string | undefined; "data-drop-target": string | undefined; ondragstart: (event: DragEvent) => void; ondragover: (event: DragEvent) => void; ondragleave: () => void; ondrop: (event: DragEvent) => void; ondragend: () => void; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/reorder.svelte.ts:26
ReorderOptions type
type ReorderOptions = {
/** Ordered item keys. */
readonly items: () => readonly string[];
/** Invoked with `(fromIndex, toIndex, nextOrder)` when an item moves. */
readonly on_reorder: (from: number, to: number, next: readonly string[]) => void;
/** Axis for movement (default `'vertical'`). */
readonly orientation?: ReorderOrientation;
/** Disable reordering globally or for a specific key. */
readonly disabled?: boolean | ((key: string) => boolean);
/** Optional human-readable label per key for live announcements. */
readonly label?: (key: string) => string;
}; Options for create_reorder.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | Ordered item keys. |
on_reorder | (from: number, to: number, next: readonly string[]) => void | Invoked with |
orientation? | ReorderOrientation | Axis for movement (default |
disabled? | boolean | ((key: string) => boolean) | Disable reordering globally or for a specific key. |
label? | (key: string) => string | Optional human-readable label per key for live announcements. |
Source: packages/ui/src/behaviors/reorder.svelte.ts:12
ReorderOrientation type
type ReorderOrientation = 'vertical' | 'horizontal'; Axis for keyboard and pointer reordering ('vertical' or 'horizontal').
Source: packages/ui/src/behaviors/reorder.svelte.ts:9
Resize type
type Resize = ReturnType<typeof create_resize>; Return value of create_resize.
Members
| Name | Type | Description |
|---|---|---|
dragging | boolean | |
handle_attrs | () => { role: "separator"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number | undefined; tabindex: number; "data-dragging": string | undefined; onpointerdown: (event: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; } | Spread onto the resize handle element ( |
Source: packages/ui/src/behaviors/resize.svelte.ts:36
ResizeAxis type
type ResizeAxis = 'horizontal' | 'vertical' | 'both'; Axis of pointer/keyboard resizing ('horizontal', 'vertical', or 2D 'both').
Source: packages/ui/src/behaviors/resize.svelte.ts:6
ResizeBox type
type ResizeBox = {
readonly width: number;
readonly height: number;
}; 2D dimensions used when axis === 'both' or via create_resize_2d.
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number |
Source: packages/ui/src/behaviors/resize.svelte.ts:9
ResizeBoxOptions type
type ResizeBoxOptions = {
readonly size: () => ResizeBox;
readonly on_change: (next: ResizeBox) => void;
readonly on_commit?: (final: ResizeBox) => void;
readonly min_width?: number;
readonly max_width?: number;
readonly min_height?: number;
readonly max_height?: number;
readonly scale?: () => number;
readonly step?: number;
}; Options for 2D create_resize_box (edge & corner handles for preview frames, cards, canvases).
Members
| Name | Type | Description |
|---|---|---|
size | () => ResizeBox | |
on_change | (next: ResizeBox) => void | |
on_commit? | (final: ResizeBox) => void | |
min_width? | number | |
max_width? | number | |
min_height? | number | |
max_height? | number | |
scale? | () => number | |
step? | number |
Source: packages/ui/src/behaviors/resize.svelte.ts:147
ResizeOptions type
type ResizeOptions = {
/** Current size in pixels (reactive getter). */
readonly value: () => number;
/** Called with the clamped pixel size during drag and keyboard nudges. */
readonly on_change: (next: number) => void;
/** Called once when a pointer drag finishes. */
readonly on_commit?: (final: number) => void;
/** Axis of drag movement (default `'horizontal'`). */
readonly axis?: 'horizontal' | 'vertical';
/** Invert drag delta (e.g. dragging a right-docked sheet's left edge leftward widens it). */
readonly invert?: boolean;
/** Minimum size in pixels (default `120`). */
readonly min?: number | (() => number);
/** Maximum size in pixels (default `Infinity`). */
readonly max?: number | (() => number);
/** Optional zoom divisor for scaled canvases/preview frames (default `1`). */
readonly scale?: number | (() => number);
/** Keyboard Arrow nudge increment in pixels (default `24`). */
readonly step?: number;
/** Accessible label for the separator handle. */
readonly label?: string;
}; Options for create_resize.
Members
| Name | Type | Description |
|---|---|---|
value | () => number | Current size in pixels (reactive getter). |
on_change | (next: number) => void | Called with the clamped pixel size during drag and keyboard nudges. |
on_commit? | (final: number) => void | Called once when a pointer drag finishes. |
axis? | 'horizontal' | 'vertical' | Axis of drag movement (default |
invert? | boolean | Invert drag delta (e.g. dragging a right-docked sheet's left edge leftward widens it). |
min? | number | (() => number) | Minimum size in pixels (default |
max? | number | (() => number) | Maximum size in pixels (default |
scale? | number | (() => number) | Optional zoom divisor for scaled canvases/preview frames (default |
step? | number | Keyboard Arrow nudge increment in pixels (default |
label? | string | Accessible label for the separator handle. |
Source: packages/ui/src/behaviors/resize.svelte.ts:12
ResolvedColorScheme type
type ResolvedColorScheme = 'light' | 'dark'; Resolved concrete color scheme.
Source: packages/ui/src/behaviors/platform.svelte.ts:156
RgbaColor type
type RgbaColor = {
readonly r: number;
readonly g: number;
readonly b: number;
readonly a: number;
}; RGBA color representation with channels r,g,b in 0..255 and alpha a in 0..1.
Members
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:781
RovingFocus type
type RovingFocus = ReturnType<typeof create_roving_focus>; Return value of create_roving_focus.
Members
| Name | Type | Description |
|---|---|---|
active | string | |
focus | (key: string) => void | |
next | () => void | |
prev | () => void | |
item | (key: string) => Attachment<HTMLElement> | Attach to each focusable item for arrow focus & unmount focus recovery. |
root_attrs | () => { onkeydown: (event: KeyboardEvent) => void; } | Spread onto the container element to handle arrow/Home/End keyboard navigation. |
item_attrs | (key: string) => { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; } | Spread onto each item for roving |
Source: packages/ui/src/behaviors/roving-focus.svelte.ts:29
RovingFocusOptions type
type RovingFocusOptions = {
/** Keys in navigation order. */
readonly items: () => readonly string[];
/** Controlled active key; omit for internal focus tracking. */
readonly active?: () => string | undefined;
/** Called when keyboard navigation moves focus to a key. */
readonly on_active_change?: (key: string) => void;
/** Axis of arrow navigation (default `'horizontal'`). */
readonly orientation?: RovingOrientation | (() => RovingOrientation);
/** Wrap from last back to first and vice versa (default `true`). */
readonly loop?: boolean;
/** Skip disabled keys during keyboard movement. */
readonly disabled?: (key: string) => boolean;
/** Optional callback invoked when Space or Enter activates the focused item. */
readonly on_activate?: (key: string) => void;
}; Options for create_roving_focus.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | Keys in navigation order. |
active? | () => string | undefined | Controlled active key; omit for internal focus tracking. |
on_active_change? | (key: string) => void | Called when keyboard navigation moves focus to a key. |
orientation? | RovingOrientation | (() => RovingOrientation) | Axis of arrow navigation (default |
loop? | boolean | Wrap from last back to first and vice versa (default |
disabled? | (key: string) => boolean | Skip disabled keys during keyboard movement. |
on_activate? | (key: string) => void | Optional callback invoked when Space or Enter activates the focused item. |
Source: packages/ui/src/behaviors/roving-focus.svelte.ts:11
RovingOrientation type
type RovingOrientation = 'horizontal' | 'vertical' | 'both'; Arrow-key navigation axis ('horizontal', 'vertical', or 'both').
Source: packages/ui/src/behaviors/roving-focus.svelte.ts:8
ScrollPickerOptions type
type ScrollPickerOptions = {
/** Called when the centered option changes after scrolling settles. */
readonly on_select: (index: number) => void;
/** Scroll axis (default `'vertical'`). */
readonly orientation?: 'vertical' | 'horizontal';
}; Options for bind_scroll_picker.
Members
| Name | Type | Description |
|---|---|---|
on_select | (index: number) => void | Called when the centered option changes after scrolling settles. |
orientation? | 'vertical' | 'horizontal' | Scroll axis (default |
Source: packages/ui/src/behaviors/canvas.svelte.ts:835
SegmentPart type
type SegmentPart = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'literal'; Editable or literal segment kind inside a segmented date or time field.
Source: packages/ui/src/behaviors/date-time.svelte.ts:25
Selection type
type Selection = ReturnType<typeof create_selection>; Return value of create_selection.
Members
| Name | Type | Description |
|---|---|---|
selected | readonly string[] | |
count | number | |
all_selected | boolean | |
some_selected | boolean | |
is_selected | (key: string) => boolean | |
choose | (key: string) => void | |
toggle | (key: string) => void | |
extend | (to: string, opts?: { from?: string | null; additive?: boolean; }) => void | |
toggle_all | () => void | |
clear | () => void | |
item_attrs | (key: string) => { "aria-selected": boolean; "data-selected": string | undefined; "aria-disabled": true | undefined; onclick: (event: MouseEvent) => void; } | Spread onto each selectable item for |
Source: packages/ui/src/behaviors/selection.svelte.ts:24
SelectionMode type
type SelectionMode = 'single' | 'multiple'; Single or multiple item selection mode.
Source: packages/ui/src/behaviors/selection.svelte.ts:5
SelectionOptions type
type SelectionOptions = {
/** Keys in visual order (used for Shift ranges and select-all). */
order: () => readonly string[];
/** Single or multiple selection (default `'single'`). */
mode?: SelectionMode | (() => SelectionMode);
/** Controlled selected keys; omit for internal state. */
selected?: () => readonly string[];
/** Initial selected keys when uncontrolled. */
default_selected?: readonly string[];
/** Called with the next selection whenever it changes. */
on_change?: (keys: readonly string[]) => void;
/** Whether a key may be selected (default every key). */
selectable?: (key: string) => boolean;
}; Options for create_selection.
Members
| Name | Type | Description |
|---|---|---|
order | () => readonly string[] | Keys in visual order (used for Shift ranges and select-all). |
mode? | SelectionMode | (() => SelectionMode) | Single or multiple selection (default |
selected? | () => readonly string[] | Controlled selected keys; omit for internal state. |
default_selected? | readonly string[] | Initial selected keys when uncontrolled. |
on_change? | (keys: readonly string[]) => void | Called with the next selection whenever it changes. |
selectable? | (key: string) => boolean | Whether a key may be selected (default every key). |
Source: packages/ui/src/behaviors/selection.svelte.ts:8
ShortcutBinding type
type ShortcutBinding = {
/** Shortcut spec such as `'mod+k'`, `'escape'`, `'shift+alt+p'`, `'/'`, or chord `'g i'`. */
readonly keys: string;
/** Handler invoked when matched. */
readonly handler: (event: KeyboardEvent) => void;
/** Allow firing while focus is inside an input, textarea, select or contenteditable (default `false`). */
readonly allow_in_input?: boolean;
/** Call `event.preventDefault()` on match (default `true`). */
readonly prevent_default?: boolean;
/** Temporarily disable this shortcut. */
readonly enabled?: boolean | (() => boolean);
}; One declarative keyboard shortcut binding for create_shortcuts.
Members
| Name | Type | Description |
|---|---|---|
keys | string | Shortcut spec such as |
handler | (event: KeyboardEvent) => void | Handler invoked when matched. |
allow_in_input? | boolean | Allow firing while focus is inside an input, textarea, select or contenteditable (default |
prevent_default? | boolean | Call |
enabled? | boolean | (() => boolean) | Temporarily disable this shortcut. |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:6
Slider type
type Slider = ReturnType<typeof create_slider>; Return value of create_slider.
Members
| Name | Type | Description |
|---|---|---|
value | number | |
values | readonly number[] | |
percent | number | |
percents | number[] | |
dragging | boolean | |
active_thumb | number | |
set | (next: number, index?: number) => void | |
track | Attachment<HTMLElement> | |
thumb_attrs | (index?: number) => { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/slider.svelte.ts:42
SliderOptions type
type SliderOptions = {
/** Controlled numeric value (single-thumb mode); omit for internal state. */
readonly value?: () => number;
/** Initial value when uncontrolled (default `min`). */
readonly default_value?: number;
/** Called when the quantized value changes (single-thumb mode). */
readonly on_change?: (value: number) => void;
/** Called once when a drag or key adjustment settles (single-thumb mode). */
readonly on_commit?: (value: number) => void;
/** Controlled multi-thumb values (range slider mode). */
readonly values?: () => readonly number[];
/** Initial multi-thumb values when uncontrolled. */
readonly default_values?: readonly number[];
/** Called when multi-thumb values change. */
readonly on_values_change?: (values: readonly number[]) => void;
/** Called once when a multi-thumb drag or key adjustment settles. */
readonly on_values_commit?: (values: readonly number[]) => void;
/** Minimum value (default `0`). */
readonly min?: number | (() => number);
/** Maximum value (default `100`). */
readonly max?: number | (() => number);
/** Step increment (default `1`). */
readonly step?: number | (() => number);
/** Orientation (`'horizontal'` default, or `'vertical'`). */
readonly orientation?: 'horizontal' | 'vertical';
/** Disabled state. */
readonly disabled?: () => boolean;
/** Accessible label. */
readonly label?: string;
/** Optional semantic contr… Options for create_slider.
Members
| Name | Type | Description |
|---|---|---|
value? | () => number | Controlled numeric value (single-thumb mode); omit for internal state. |
default_value? | number | Initial value when uncontrolled (default |
on_change? | (value: number) => void | Called when the quantized value changes (single-thumb mode). |
on_commit? | (value: number) => void | Called once when a drag or key adjustment settles (single-thumb mode). |
values? | () => readonly number[] | Controlled multi-thumb values (range slider mode). |
default_values? | readonly number[] | Initial multi-thumb values when uncontrolled. |
on_values_change? | (values: readonly number[]) => void | Called when multi-thumb values change. |
on_values_commit? | (values: readonly number[]) => void | Called once when a multi-thumb drag or key adjustment settles. |
min? | number | (() => number) | Minimum value (default |
max? | number | (() => number) | Maximum value (default |
step? | number | (() => number) | Step increment (default |
orientation? | 'horizontal' | 'vertical' | Orientation ( |
disabled? | () => boolean | Disabled state. |
label? | string | Accessible label. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/slider.svelte.ts:8
Span type
type Span = {
readonly id: string;
readonly track: string;
readonly start: number;
readonly end: number;
}; A range placed on a named track (calendar event, Gantt bar, room booking).
Members
| Name | Type | Description |
|---|---|---|
id | string | |
track | string | |
start | number | |
end | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:263
SpansBehavior type
type SpansBehavior<S extends Span = Span> = ReturnType<typeof create_spans<S>>; Return value of create_spans.
Members
| Name | Type | Description |
|---|---|---|
spans | readonly S[] | |
active | string | null | |
update_span | (id: string, patch: Partial<Pick<Span, "track" | "start" | "end">>, action: "move" | "resize", commitNow?: boolean) => void | |
create | (track: string, start: number, end: number) => void | |
remove | (id: string) => void | |
cancel | () => void | |
span_attrs | (span: S) => { tabindex: number; 'data-span-id': string; 'data-dragging': string | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/canvas.svelte.ts:318
SpansOptions type
type SpansOptions<S extends Span = Span> = {
readonly tracks: () => readonly string[];
readonly spans: () => readonly S[];
readonly min: number;
readonly max: number;
readonly step?: number;
readonly min_duration?: number;
readonly on_commit: (next: readonly S[], action: 'draw' | 'move' | 'resize' | 'delete', id: string) => void;
readonly create_span?: (draft: Span) => S;
}; Options for create_spans.
Members
| Name | Type | Description |
|---|---|---|
tracks | () => readonly string[] | |
spans | () => readonly S[] | |
min | number | |
max | number | |
step? | number | |
min_duration? | number | |
on_commit | (next: readonly S[], action: 'draw' | 'move' | 'resize' | 'delete', id: string) => void | |
create_span? | (draft: Span) => S |
Source: packages/ui/src/behaviors/canvas.svelte.ts:306
SpatialDirection type
type SpatialDirection = 'up' | 'down' | 'left' | 'right'; Cardinal direction for nearest_in_direction / spatial_move.
Source: packages/ui/src/behaviors/micro.svelte.ts:493
SpatialRect type
type SpatialRect = {
readonly left: number;
readonly top: number;
readonly width: number;
readonly height: number;
}; Bounding box used by geometric spatial navigation.
Members
| Name | Type | Description |
|---|---|---|
left | number | |
top | number | |
width | number | |
height | number |
Source: packages/ui/src/behaviors/micro.svelte.ts:485
SpringState type
type SpringState = {
readonly position: number;
readonly velocity: number;
readonly settled: boolean;
}; Spring state for one-dimensional spring integration.
Members
| Name | Type | Description |
|---|---|---|
position | number | |
velocity | number | |
settled | boolean |
Source: packages/ui/src/behaviors/motion.svelte.ts:69
StickToBottom type
type StickToBottom = ReturnType<typeof create_stick_to_bottom>; Return value of create_stick_to_bottom.
Members
| Name | Type | Description |
|---|---|---|
stuck | boolean | |
scroll_to_bottom | (behavior?: ScrollBehavior) => void | |
viewport | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:15
StickToBottomOptions type
type StickToBottomOptions = {
/** Pixel distance from the bottom edge still considered latched (default `32`). */
threshold?: number;
/** Start latched to the bottom (default `true`). */
initial?: boolean;
}; Options for create_stick_to_bottom.
Members
| Name | Type | Description |
|---|---|---|
threshold? | number | Pixel distance from the bottom edge still considered latched (default |
initial? | boolean | Start latched to the bottom (default |
Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:7
SwipeActions type
type SwipeActions = ReturnType<typeof create_swipe_actions>; Return value of create_swipe_actions.
Members
| Name | Type | Description |
|---|---|---|
open | SwipeOpen | null | |
offset | { readonly key: string; readonly x: number; } | null | |
close | () => void | |
row | (key: string) => Attachment<HTMLElement> | |
row_attrs | (key: string) => { 'data-swipe-open': SwipeSide | undefined; style: string; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/canvas.svelte.ts:741
SwipeActionsOptions type
type SwipeActionsOptions = {
/** Width in px of revealed action tray (default `120`). */
readonly tray_width?: number;
/** Fraction of tray width needed to snap open (default `0.5`). */
readonly open_ratio?: number;
/** Distance in px triggering immediate full-swipe action (default `220`). */
readonly full_swipe_px?: number;
/** Optional full-swipe callback (e.g. archive/delete). */
readonly on_full_swipe?: (key: string, side: SwipeSide) => void;
}; Options for create_swipe_actions.
Members
| Name | Type | Description |
|---|---|---|
tray_width? | number | Width in px of revealed action tray (default |
open_ratio? | number | Fraction of tray width needed to snap open (default |
full_swipe_px? | number | Distance in px triggering immediate full-swipe action (default |
on_full_swipe? | (key: string, side: SwipeSide) => void | Optional full-swipe callback (e.g. archive/delete). |
Source: packages/ui/src/behaviors/canvas.svelte.ts:729
SwipeOpen type
type SwipeOpen = {
readonly key: string;
readonly side: SwipeSide;
}; Currently revealed swipe row.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
side | SwipeSide |
Source: packages/ui/src/behaviors/canvas.svelte.ts:726
SwipeSide type
type SwipeSide = 'start' | 'end'; Side on which row swipe actions sit.
Source: packages/ui/src/behaviors/canvas.svelte.ts:723
SwitchOptions type
type SwitchOptions = {
readonly checked?: () => boolean;
readonly default_checked?: boolean;
readonly on_change?: (checked: boolean) => void;
readonly disabled?: () => boolean;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_switch.
Members
| Name | Type | Description |
|---|---|---|
checked? | () => boolean | |
default_checked? | boolean | |
on_change? | (checked: boolean) => void | |
disabled? | () => boolean | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:13
TimeFieldBehavior type
type TimeFieldBehavior = ReturnType<typeof create_time_field>; Return value of create_time_field.
Members
| Name | Type | Description |
|---|---|---|
segments | readonly DateTimeSegment[] | |
segment_ref | (part: SegmentPart) => Attachment<HTMLElement> | |
segment_attrs | (seg: DateTimeSegment) => { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segmen… |
Source: packages/ui/src/behaviors/date-time.svelte.ts:71
TimeFieldOptions type
type TimeFieldOptions = {
/** Controlled `Time` getter. */
readonly value: () => Time | undefined;
/** Called when the time value changes (or clears to `undefined`). */
readonly on_change: (next: Time | undefined) => void;
/** Editing precision: `'hour'` or `'minute'` (default `'minute'`). */
readonly granularity?: () => 'hour' | 'minute';
/** Disabled state. */
readonly disabled?: () => boolean;
}; Options for create_time_field.
Members
| Name | Type | Description |
|---|---|---|
value | () => Time | undefined | Controlled |
on_change | (next: Time | undefined) => void | Called when the time value changes (or clears to |
granularity? | () => 'hour' | 'minute' | Editing precision: |
disabled? | () => boolean | Disabled state. |
Source: packages/ui/src/behaviors/date-time.svelte.ts:59
TimelineBehavior type
type TimelineBehavior = ReturnType<typeof create_timeline>; Return value of create_timeline.
Members
| Name | Type | Description |
|---|---|---|
expanded | readonly string[] | |
is_expanded | (id: string) => boolean | |
toggle | (id: string) => void | |
item | (key: string) => Attachment<HTMLElement> | |
root_attrs | () => { role: "feed"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; } | |
item_attrs | (id: string) => { role: "article"; "aria-expanded": boolean; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1344
TimelineOptions type
type TimelineOptions = {
readonly items: () => readonly string[];
readonly default_expanded?: readonly string[];
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_timeline.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | |
default_expanded? | readonly string[] | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1336
ToggleGroupOptions type
type ToggleGroupOptions = {
readonly items: () => readonly string[];
readonly mode?: 'single' | 'multiple';
readonly value?: () => readonly string[];
readonly default_value?: readonly string[];
readonly on_change?: (values: readonly string[]) => void;
readonly orientation?: RovingOrientation;
readonly disabled?: (key: string) => boolean;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_toggle_group.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | |
mode? | 'single' | 'multiple' | |
value? | () => readonly string[] | |
default_value? | readonly string[] | |
on_change? | (values: readonly string[]) => void | |
orientation? | RovingOrientation | |
disabled? | (key: string) => boolean | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:170
TokenInput type
type TokenInput = ReturnType<typeof create_token_input>; Return value of create_token_input.
Members
| Name | Type | Description |
|---|---|---|
values | readonly string[] | |
input_text | string | |
active_index | number | null | |
editing_index | number | null | |
editing_text | string | |
error | string | null | |
add | (raw: string) => boolean | |
remove_at | (index: number) => void | |
commit_input | () => void | |
start_edit | (index: number) => void | |
commit_edit | () => void | |
cancel_edit | () => void | |
input | Attachment<HTMLInputElement> | |
chip | (index: number) => Attachment<HTMLElement> | |
input_attrs | () => { value: string; disabled: true | undefined; "aria-label": string | undefined; onfocus: () => void; oninput: (event: Event) => void; onpaste: (event: ClipboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; } | |
chip_attrs | (index: number) => { tabindex: number; "data-active": string | undefined; "data-editing": string | undefined; onfocus: () => void; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:38
TokenInputOptions type
type TokenInputOptions = {
/** Controlled tokens; omit for internal state. */
readonly value?: () => readonly string[];
/** Initial tokens when uncontrolled. */
readonly default_value?: readonly string[];
/** Called whenever tokens change. */
readonly on_change?: (next: readonly string[]) => void;
/** Delimiter characters that split tokens (default `[',']`). */
readonly delimiters?: readonly string[];
/** Allow duplicate tokens (default `false`). */
readonly allow_duplicates?: boolean;
/** Maximum token count (optional). */
readonly max?: number;
/** Optional validator returning an error message string when rejected, or `null`/`undefined` if valid. */
readonly validate?: (token: string) => string | null | undefined;
/** Disabled state. */
readonly disabled?: () => boolean;
/** Accessible label. */
readonly label?: string;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_token_input.
Members
| Name | Type | Description |
|---|---|---|
value? | () => readonly string[] | Controlled tokens; omit for internal state. |
default_value? | readonly string[] | Initial tokens when uncontrolled. |
on_change? | (next: readonly string[]) => void | Called whenever tokens change. |
delimiters? | readonly string[] | Delimiter characters that split tokens (default |
allow_duplicates? | boolean | Allow duplicate tokens (default |
max? | number | Maximum token count (optional). |
validate? | (token: string) => string | null | undefined | Optional validator returning an error message string when rejected, or |
disabled? | () => boolean | Disabled state. |
label? | string | Accessible label. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:14
ToolbarOptions type
type ToolbarOptions = {
readonly items: () => readonly string[];
readonly orientation?: RovingOrientation;
readonly disabled?: (key: string) => boolean;
readonly label?: string;
}; Options for create_toolbar.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | |
orientation? | RovingOrientation | |
disabled? | (key: string) => boolean | |
label? | string |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:493
Transfer type
type Transfer = ReturnType<typeof create_transfer>; Return value of create_transfer.
Members
| Name | Type | Description |
|---|---|---|
lists | Readonly<Record<string, readonly string[]>> | |
draft | TransferDraft | null | |
dragging | string | null | |
move | (key: string, to: string, index: number, commitNow?: boolean) => void | |
container | (id: string) => Attachment<HTMLElement> | |
item | (key: string) => Attachment<HTMLElement> | |
item_attrs | (key: string) => { "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/drag.svelte.ts:281
TransferDraft type
type TransferDraft = {
readonly key: string;
readonly from: string;
readonly lists: TransferLists;
}; Live draft while an item is being transferred across containers.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
from | string | |
lists | TransferLists |
Source: packages/ui/src/behaviors/drag.svelte.ts:258
TransferLists type
type TransferLists = Readonly<Record<string, readonly string[]>>; Map of container keys to their ordered item keys.
Source: packages/ui/src/behaviors/drag.svelte.ts:255
TransferOptions type
type TransferOptions = {
/** Ordered container keys (e.g. Kanban lane ids). */
readonly containers: () => readonly string[];
/** Current lists per container. */
readonly lists: () => TransferLists;
/** Called once on drop or keyboard commit with the next container map. */
readonly on_commit: (next: TransferLists, move: {
readonly key: string;
readonly from: string;
readonly to: string;
readonly index: number;
}) => void;
/** Optional predicate rejecting moves into a container. */
readonly can_drop?: (key: string, toContainer: string) => boolean;
/** Human-readable item label for screen-reader announcements. */
readonly item_label?: (key: string) => string;
/** Human-readable container label for screen-reader announcements. */
readonly container_label?: (container: string) => string;
}; Options for create_transfer.
Members
| Name | Type | Description |
|---|---|---|
containers | () => readonly string[] | Ordered container keys (e.g. Kanban lane ids). |
lists | () => TransferLists | Current lists per container. |
on_commit | (next: TransferLists, move: { readonly key: string; readonly from: string; readonly to: string; readonly index: number; }) => void | Called once on drop or keyboard commit with the next container map. |
can_drop? | (key: string, toContainer: string) => boolean | Optional predicate rejecting moves into a container. |
item_label? | (key: string) => string | Human-readable item label for screen-reader announcements. |
container_label? | (container: string) => string | Human-readable container label for screen-reader announcements. |
Source: packages/ui/src/behaviors/drag.svelte.ts:265
Tree type
type Tree<T = unknown> = ReturnType<typeof create_tree<T>>; Return value of create_tree.
Members
| Name | Type | Description |
|---|---|---|
rows | FlatTreeRow<T>[] | |
expanded | readonly string[] | |
selected | readonly string[] | |
active | string | |
expand | (id: string) => void | |
collapse | (id: string) => void | |
toggle_expand | (id: string) => void | |
is_expanded | (id: string) => boolean | |
is_selected | (key: string) => boolean | |
item | (key: string) => import("svelte/attachments").Attachment<HTMLElement> | |
root_attrs | () => { role: "tree"; onkeydown: (event: KeyboardEvent) => void; } | |
item_attrs | (id: string) => { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; } |
Source: packages/ui/src/behaviors/tree.svelte.ts:57
TreeCheckStrategy type
type TreeCheckStrategy = 'leaf' | 'trunk' | 'branch' | 'independent'; Tri-state checkbox cascade strategy for hierarchical trees.
Source: packages/ui/src/behaviors/tree.svelte.ts:31
TreeCheckedState type
type TreeCheckedState = boolean | 'indeterminate'; Tri-state checkbox value for one tree node.
Source: packages/ui/src/behaviors/tree.svelte.ts:34
TreeNode type
type TreeNode<T = unknown> = {
readonly id: string;
readonly label: string;
readonly children?: readonly TreeNode<T>[];
readonly disabled?: boolean;
readonly data?: T;
}; One hierarchical node supplied to create_tree.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
children? | readonly TreeNode<T>[] | |
disabled? | boolean | |
data? | T |
Source: packages/ui/src/behaviors/tree.svelte.ts:10
TreeOptions type
type TreeOptions<T = unknown> = {
/** Root tree nodes. */
readonly nodes: () => readonly TreeNode<T>[];
/** Initial expanded node ids. */
readonly default_expanded?: readonly string[];
/** Controlled expanded node ids. */
readonly expanded?: () => readonly string[];
/** Called when expanded node ids change. */
readonly on_expanded_change?: (ids: readonly string[]) => void;
/** Selection mode (default `'single'`). */
readonly mode?: SelectionMode;
/** Controlled selected ids. */
readonly selected?: () => readonly string[];
/** Called when selection changes. */
readonly on_select?: (ids: readonly string[]) => void;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_tree.
Members
| Name | Type | Description |
|---|---|---|
nodes | () => readonly TreeNode<T>[] | Root tree nodes. |
default_expanded? | readonly string[] | Initial expanded node ids. |
expanded? | () => readonly string[] | Controlled expanded node ids. |
on_expanded_change? | (ids: readonly string[]) => void | Called when expanded node ids change. |
mode? | SelectionMode | Selection mode (default |
selected? | () => readonly string[] | Controlled selected ids. |
on_select? | (ids: readonly string[]) => void | Called when selection changes. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/tree.svelte.ts:37
TreePlace type
type TreePlace = {
readonly target: string;
readonly position: 'before' | 'inside' | 'after';
}; Drop placement relative to a target tree row.
Members
| Name | Type | Description |
|---|---|---|
target | string | |
position | 'before' | 'inside' | 'after' |
Source: packages/ui/src/behaviors/drag.svelte.ts:466
TreeReorder type
type TreeReorder = ReturnType<typeof create_tree_reorder>; Return value of create_tree_reorder.
Members
| Name | Type | Description |
|---|---|---|
dragging | string | null | |
drop | TreePlace | null | |
commit | (id: string, place: TreePlace) => void | |
item | (id: string) => Attachment<HTMLElement> | |
item_attrs | (id: string) => { "data-dragging": string | undefined; "data-drop-position": "before" | "inside" | "after" | undefined; onkeydown: (event: KeyboardEvent) => void; } |
Source: packages/ui/src/behaviors/drag.svelte.ts:491
TreeReorderOptions type
type TreeReorderOptions = {
/** Visible pre-order tree rows. */
readonly rows: () => readonly TreeReorderRow[];
/** Invoked when a node (with its subtree) moves to `place`. */
readonly on_move: (id: string, place: TreePlace) => void;
/** Optional predicate forbidding drops into/around a target. */
readonly can_drop?: (id: string, place: TreePlace) => boolean;
}; Options for create_tree_reorder.
Members
| Name | Type | Description |
|---|---|---|
rows | () => readonly TreeReorderRow[] | Visible pre-order tree rows. |
on_move | (id: string, place: TreePlace) => void | Invoked when a node (with its subtree) moves to |
can_drop? | (id: string, place: TreePlace) => boolean | Optional predicate forbidding drops into/around a target. |
Source: packages/ui/src/behaviors/drag.svelte.ts:481
TreeReorderRow type
type TreeReorderRow = {
readonly id: string;
readonly depth: number;
readonly parent: string | null;
readonly label?: string;
}; One flattened row accepted by create_tree_reorder.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
depth | number | |
parent | string | null | |
label? | string |
Source: packages/ui/src/behaviors/drag.svelte.ts:458
TriggerMatch type
type TriggerMatch = {
readonly trigger: string;
readonly query: string;
readonly start: number;
readonly end: number;
}; Active trigger match inside a text field.
Members
| Name | Type | Description |
|---|---|---|
trigger | string | |
query | string | |
start | number | |
end | number |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:348
TriggerMenu type
type TriggerMenu<T extends TriggerMenuItem = TriggerMenuItem> = ReturnType<typeof create_trigger_menu<T>>; Return value of create_trigger_menu.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
match | TriggerMatch | null | |
items | readonly T[] | |
path | readonly T[] | |
active_index | number | |
floating | { readonly x: number; readonly y: number; readonly side: import("./floating.svelte.js").FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Att… | |
close | () => void | |
select | (item: T) => void | |
pop_level | () => void | |
field | Attachment<HTMLInputElement | HTMLTextAreaElement> | |
content | Attachment<HTMLElement> | |
input_attrs | () => { "aria-expanded": boolean; "aria-haspopup": "listbox"; "aria-activedescendant": string | undefined; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; } | |
option_attrs | (item: T, index: number) => { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-highlighted": string | undefined; onpointerenter: () => void; onmousedown: (event: MouseEvent) => void; onclick: () => void; } |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:368
TriggerMenuItem type
type TriggerMenuItem = {
readonly id: string;
readonly label: string;
readonly keywords?: string;
readonly insert?: string;
readonly disabled?: boolean;
readonly children?: readonly TriggerMenuItem[];
}; One item offered by create_trigger_menu.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
keywords? | string | |
insert? | string | |
disabled? | boolean | |
children? | readonly TriggerMenuItem[] |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:338
TriggerMenuOptions type
type TriggerMenuOptions<T extends TriggerMenuItem = TriggerMenuItem> = {
/** Trigger prefixes that open the menu (e.g. `['@', '/']`). */
readonly triggers: readonly string[];
/** Returns items for the active trigger & nested level stack. */
readonly items: (trigger: string, query: string, path: readonly T[]) => readonly T[];
/** Called when a leaf item is picked (receives item and replacement range). */
readonly on_select: (item: T, match: TriggerMatch, insertText: string) => void;
/** Optional semantic control registration for Norbius's `page` bridge. */
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_trigger_menu.
Members
| Name | Type | Description |
|---|---|---|
triggers | readonly string[] | Trigger prefixes that open the menu (e.g. |
items | (trigger: string, query: string, path: readonly T[]) => readonly T[] | Returns items for the active trigger & nested level stack. |
on_select | (item: T, match: TriggerMatch, insertText: string) => void | Called when a leaf item is picked (receives item and replacement range). |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:356
Typeahead type
type Typeahead = ReturnType<typeof create_typeahead>; Return value of create_typeahead.
Members
| Name | Type | Description |
|---|---|---|
onkeydown | (event: KeyboardEvent) => void | |
reset | () => void | |
query | string |
Source: packages/ui/src/behaviors/typeahead.svelte.ts:20
TypeaheadItem type
type TypeaheadItem = {
key: string;
text: string;
disabled?: boolean;
}; One searchable item supplied to create_typeahead.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
text | string | |
disabled? | boolean |
Source: packages/ui/src/behaviors/typeahead.svelte.ts:5
TypeaheadOptions type
type TypeaheadOptions = {
/** Candidate items in visual order. */
items: () => readonly TypeaheadItem[];
/** Currently active key (search wraps starting after this item). */
active?: () => string | undefined;
/** Invoked with the matched item's key. */
on_match: (key: string) => void;
/** Buffer reset delay in ms (default `500`). */
timeout_ms?: number;
}; Options for create_typeahead.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly TypeaheadItem[] | Candidate items in visual order. |
active? | () => string | undefined | Currently active key (search wraps starting after this item). |
on_match | (key: string) => void | Invoked with the matched item's key. |
timeout_ms? | number | Buffer reset delay in ms (default |
Source: packages/ui/src/behaviors/typeahead.svelte.ts:8
UiHistory type
type UiHistory = ReturnType<typeof create_ui_history>; Return value of create_ui_history.
Members
| Name | Type | Description |
|---|---|---|
entries | readonly UiHistoryEntry[] | |
position | number | |
can_undo | boolean | |
can_redo | boolean | |
undo | () => boolean | |
redo | () => boolean | |
undo_source | (source: ChangeSource) => number | |
destroy | () => void |
Source: packages/ui/src/behaviors/controls.svelte.ts:420
UiHistoryEntry type
type UiHistoryEntry = ControlChange & {
readonly seq: number;
readonly reverted?: boolean;
}; Recorded entry inside create_ui_history.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
key | string | |
previous | unknown | |
value | unknown | |
source | ChangeSource | |
reason | string | |
redacted? | boolean | |
committed | boolean | |
seq | number | |
reverted? | boolean |
Source: packages/ui/src/behaviors/controls.svelte.ts:405
UiHistoryOptions type
type UiHistoryOptions = {
readonly within?: Element | (() => Element | null | undefined);
/** Only record state keys in this list (defaults to all keys). */
readonly keys?: readonly string[];
/** Coalesce consecutive edits to the same `(id, key, source)` within 500ms (default `true`). */
readonly coalesce?: boolean;
}; Options for create_ui_history.
Members
| Name | Type | Description |
|---|---|---|
within? | Element | (() => Element | null | undefined) | |
keys? | readonly string[] | Only record state keys in this list (defaults to all keys). |
coalesce? | boolean | Coalesce consecutive edits to the same |
Source: packages/ui/src/behaviors/controls.svelte.ts:411
UndoStack type
type UndoStack<T> = ReturnType<typeof create_undo_stack<T>>; Return value of create_undo_stack.
Members
| Name | Type | Description |
|---|---|---|
current | T | |
can_undo | boolean | |
can_redo | boolean | |
length | number | |
record | (next: T, opts?: { readonly group?: string; readonly time?: number; }) => void | |
undo | () => T | |
redo | () => T | |
reset | (value: T) => void |
Source: packages/ui/src/behaviors/micro.svelte.ts:109
UndoStackOptions type
type UndoStackOptions = {
/** Maximum history depth (default `100`). */
readonly limit?: number;
/** Coalescing window in ms for edits sharing the same `group` (default `500`). */
readonly group_delay_ms?: number;
}; Options for create_undo_stack.
Members
| Name | Type | Description |
|---|---|---|
limit? | number | Maximum history depth (default |
group_delay_ms? | number | Coalescing window in ms for edits sharing the same |
Source: packages/ui/src/behaviors/micro.svelte.ts:101
ViewportBehavior type
type ViewportBehavior = ReturnType<typeof create_viewport>; Return value of create_viewport.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
zoom | number | |
panning | boolean | |
transform | string | |
set_camera | (next: Partial<ViewportCamera>) => void | |
zoom_at | (factor: number, originX: number, originY: number) => void | |
reset | () => void | |
surface | Attachment<HTMLElement> |
Source: packages/ui/src/behaviors/canvas.svelte.ts:528
ViewportCamera type
type ViewportCamera = {
readonly x: number;
readonly y: number;
readonly zoom: number;
}; Camera state of a pan/zoom canvas viewport.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
zoom | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:517
ViewportOptions type
type ViewportOptions = {
readonly initial?: ViewportCamera;
readonly min_zoom?: number;
readonly max_zoom?: number;
readonly on_change?: (camera: ViewportCamera) => void;
}; Options for create_viewport.
Members
| Name | Type | Description |
|---|---|---|
initial? | ViewportCamera | |
min_zoom? | number | |
max_zoom? | number | |
on_change? | (camera: ViewportCamera) => void |
Source: packages/ui/src/behaviors/canvas.svelte.ts:520
ViewportState type
type ViewportState = {
readonly width: number;
readonly height: number;
readonly offset_top: number;
readonly offset_left: number;
readonly scale: number;
/** Estimated height in px occluded by an on-screen mobile keyboard (`0` on desktop). */
readonly keyboard_height: number;
}; Live visual viewport & software keyboard metrics from bind_viewport.
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
offset_top | number | |
offset_left | number | |
scale | number | |
keyboard_height | number | Estimated height in px occluded by an on-screen mobile keyboard ( |
Source: packages/ui/src/behaviors/platform.svelte.ts:8
primitives
Virtual type
type Virtual = ReturnType<typeof virtual_list>; A windowed list: the slice of items to render, the spacers around it and the measure attachment.
Members
| Name | Type | Description |
|---|---|---|
on | boolean | |
start | number | |
end | number | |
before | number | The top spacer's height. |
after | number | The bottom spacer's height. |
slice | <T>(items: readonly T[]) => readonly T[] | The rendered items; index |
anchor | (el: HTMLElement) => () => void | On the top spacer: finds the clipping ancestors and follows every scroll and resize (one read per frame). |
measure | (key: string) => Attachment<Element> | On each rendered item: its height, margins included, cached under |
reveal | (index: number) => void | Scrolls the nearest scrolling ancestor (else the window) so item |
Source: packages/ui/src/primitives/virtual/virtual.svelte.ts:29
behaviors
VirtualAnchor type
type VirtualAnchor = {
readonly x: number;
readonly y: number;
} | {
readonly getBoundingClientRect: () => VirtualRect;
}; Virtual anchor: either a { x, y } pointer coordinate or a getBoundingClientRect() provider.
Source: packages/ui/src/behaviors/floating.svelte.ts:23
primitives
VirtualOptions type
type VirtualOptions = {
count: () => number;
/** Stable identity of item `i` (its id): measured heights follow it. */
key: (index: number) => string;
/** An unmeasured item's height in px. */
estimate: number;
/** Render every item at or below this count (default 60). */
threshold?: number;
/** Items rendered beyond each edge of the visible band (default 8). */
overscan?: number;
/** Window the last visible rows while a bottom-origin viewport is latched to its tail. */
tail?: () => boolean;
}; What virtual_list windows: the item count, each item's stable key, the estimated height, the threshold and the overscan.
Members
| Name | Type | Description |
|---|---|---|
count | () => number | |
key | (index: number) => string | Stable identity of item |
estimate | number | An unmeasured item's height in px. |
threshold? | number | Render every item at or below this count (default 60). |
overscan? | number | Items rendered beyond each edge of the visible band (default 8). |
tail? | () => boolean | Window the last visible rows while a bottom-origin viewport is latched to its tail. |
Source: packages/ui/src/primitives/virtual/virtual.svelte.ts:15
behaviors
VirtualRect type
type VirtualRect = {
readonly left: number;
readonly top: number;
readonly right: number;
readonly bottom: number;
readonly width: number;
readonly height: number;
}; Rect subset needed to position against a non-element virtual anchor.
Members
| Name | Type | Description |
|---|---|---|
left | number | |
top | number | |
right | number | |
bottom | number | |
width | number | |
height | number |
Source: packages/ui/src/behaviors/floating.svelte.ts:13
WatchOptions type
type WatchOptions = {
/** Skip the initial effect run and only invoke on subsequent changes (default `false`). */
readonly lazy?: boolean;
/** Stop reacting after the first invocation (default `false`). */
readonly once?: boolean;
}; Options controlling whether watch skips its initial run (lazy) or only runs once (once).
Members
| Name | Type | Description |
|---|---|---|
lazy? | boolean | Skip the initial effect run and only invoke on subsequent changes (default |
once? | boolean | Stop reacting after the first invocation (default |
Source: packages/ui/src/behaviors/reactive.svelte.ts:6
WaterfallBehavior type
type WaterfallBehavior<T extends WaterfallItem = WaterfallItem> = ReturnType<typeof create_waterfall<T>>; Return value of create_waterfall.
Members
| Name | Type | Description |
|---|---|---|
rows | import("./tree.svelte.js").FlatTreeRow<T>[] | |
min | number | |
max | number | |
view_start | number | |
view_end | number | |
tree | { readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { … | |
bar_rect | (item: WaterfallItem) => { readonly left_pct: number; readonly width_pct: number; } | |
zoom | (start: number, end: number) => void | |
reset_zoom | () => void |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1238
WaterfallItem type
type WaterfallItem = {
readonly id: string;
readonly label: string;
readonly parent?: string | null;
readonly start: number;
readonly end: number;
}; One timed span item in create_waterfall.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
parent? | string | null | |
start | number | |
end | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1221
WaterfallOptions type
type WaterfallOptions<T extends WaterfallItem = WaterfallItem> = {
readonly items: () => readonly T[];
readonly on_select?: (id: string) => void;
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_waterfall.
Members
| Name | Type | Description |
|---|---|---|
items | () => readonly T[] | |
on_select? | (id: string) => void | |
label? | string | |
control? | { readonly id: string; readonly label?: string; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1230
act_on_control function
function act_on_control(id: string, action: string, args?: readonly unknown[]): boolean Invokes a named semantic action on a registered control by id or label; returns whether it ran.
Parameters
| Name | Type | Description |
|---|---|---|
id | string | |
action | string | |
args? | readonly unknown[] |
Source: packages/ui/src/behaviors/controls.svelte.ts:381
announce function
function announce(text: string, options?: AnnounceOptions): void Announces text to assistive technologies. Repeating identical text still triggers a fresh reading by clearing the region before writing.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | |
options? | AnnounceOptions |
Source: packages/ui/src/behaviors/announce.svelte.ts:61
aria_keyshortcuts function
function aria_keyshortcuts(spec: string, platform?: "mac" | "other"): string Converts a shortcut spec into a WAI-ARIA aria-keyshortcuts attribute value (e.g. 'Meta+K' or 'Control+K').
Parameters
| Name | Type | Description |
|---|---|---|
spec | string | |
platform? | 'mac' | 'other' |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:104
bind_avoid_keyboard function
function bind_avoid_keyboard(options?: { readonly mode?: "padding" | "translate"; }): Attachment<HTMLElement> Shifts a fixed bottom bar, composer or sheet above the mobile software keyboard using visualViewport keyboard-height measurements (padding-bottom or transform).
Parameters
| Name | Type | Description |
|---|---|---|
options? | { readonly mode?: 'padding' | 'translate'; } |
Source: packages/ui/src/behaviors/platform.svelte.ts:80
bind_drag function
function bind_drag(options: BindDragOptions): Attachment<HTMLElement> Pointer-capture drag attachment ({@attach bind_drag(...)}) with movement threshold, animation-frame batching and optional Escape cancellation.
Parameters
| Name | Type | Description |
|---|---|---|
options | BindDragOptions |
|
Source: packages/ui/src/behaviors/drag.svelte.ts:42
bind_drag_preview function
function bind_drag_preview(options: DragPreviewOptions): Attachment<HTMLElement> Positions a custom floating drag-ghost element under the pointer without HTML5 drag ghost clipping.
Parameters
| Name | Type | Description |
|---|---|---|
options | DragPreviewOptions |
|
Source: packages/ui/src/behaviors/platform.svelte.ts:304
bind_findable function
function bind_findable(options: FindableOptions): Attachment<HTMLElement> Attachment keeping a closed panel discoverable by browser find-in-page (hidden="until-found"). When the user searches text inside the closed panel, on_reveal fires so the panel opens cleanly.
Parameters
| Name | Type | Description |
|---|---|---|
options | FindableOptions |
|
Source: packages/ui/src/behaviors/presence.svelte.ts:230
bind_hold function
function bind_hold(options: BindHoldOptions): Attachment<HTMLElement> Long-press attachment ({@attach bind_hold(...)}) with movement tolerance, Escape/blur cancel and automatic click suppression after a completed hold.
Parameters
| Name | Type | Description |
|---|---|---|
options | BindHoldOptions |
|
Source: packages/ui/src/behaviors/micro.svelte.ts:220
bind_repeat function
function bind_repeat(options: BindRepeatOptions): Attachment<HTMLElement> Press-and-hold repeating attachment ({@attach bind_repeat(...)}) for number-input steppers and scrub buttons. Fires once immediately, waits delay, then repeats every interval.
Parameters
| Name | Type | Description |
|---|---|---|
options | BindRepeatOptions |
|
Source: packages/ui/src/behaviors/micro.svelte.ts:351
bind_scroll_picker function
function bind_scroll_picker(options: ScrollPickerOptions): Attachment<HTMLElement> Scroll-snap wheel picker attachment ({@attach bind_scroll_picker(...)}) that writes --picker-offset (-1..1 normalized distance from center) on each child option and reports the centered index on scroll settle.
Parameters
| Name | Type | Description |
|---|---|---|
options | ScrollPickerOptions |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:847
bind_viewport function
function bind_viewport(on_change?: (state: ViewportState) => void): Attachment<HTMLElement> Tracks window.visualViewport resize/scroll changes and writes --viewport-height, --keyboard-height and --keyboard-inset CSS custom properties onto the bound element (or document.documentElement).
Parameters
| Name | Type | Description |
|---|---|---|
on_change? | (state: ViewportState) => void |
Source: packages/ui/src/behaviors/platform.svelte.ts:49
bridge_between function
function bridge_between(trigger: Rect, popup: Rect, pad?: number): (x: number, y: number) => boolean Returns a point-in-corridor predicate spanning the convex hull of trigger and popup (padded slightly so hairline gaps never drop hover during diagonal transit).
Parameters
| Name | Type | Description |
|---|---|---|
trigger | Rect | |
popup | Rect | |
pad? | number |
Source: packages/ui/src/behaviors/hover-intent.svelte.ts:55
cell_bounds function
function cell_bounds(range: CellRange): CellBounds Normalizes any CellRange into { top, left, bottom, right } inclusive bounds.
Parameters
| Name | Type | Description |
|---|---|---|
range | CellRange |
|
Source: packages/ui/src/behaviors/grid.svelte.ts:207
cells_to_text function
function cells_to_text(bounds: CellBounds, read: (cell: GridCell) => string): string Serializes a 2D cell range to spreadsheet-compatible tab-separated text (TSV).
Parameters
| Name | Type | Description |
|---|---|---|
bounds | CellBounds |
|
read | (cell: GridCell) => string |
Source: packages/ui/src/behaviors/grid.svelte.ts:217
check_direction function
function check_direction(root: Element, expected: "ltr" | "rtl"): readonly PatternViolation[] Verifies that an element resolves to the expected writing direction ('ltr' or 'rtl') via inherited dir attribute / computed style.
Parameters
| Name | Type | Description |
|---|---|---|
root | Element | |
expected | 'ltr' | 'rtl' |
Source: packages/ui/src/behaviors/testing.ts:192
check_pattern function
function check_pattern(root: Element, pattern: AriaPattern): readonly PatternViolation[] Audits a rendered DOM subtree against WAI-ARIA APG structural, naming and keyboard focus requirements for pattern. Returns an array of violations (empty means compliant).
Parameters
| Name | Type | Description |
|---|---|---|
root | Element | |
pattern | AriaPattern |
Source: packages/ui/src/behaviors/testing.ts:59
color_scheme_of function
function color_scheme_of(): ResolvedColorScheme Reads the operating system's current preferred color scheme.
Source: packages/ui/src/behaviors/platform.svelte.ts:159
color_scheme_script function
function color_scheme_script(storageKey: string): string Generates a minimal inline script body to apply stored color scheme before first paint (no FOUC).
Parameters
| Name | Type | Description |
|---|---|---|
storageKey | string |
Source: packages/ui/src/behaviors/platform.svelte.ts:233
contrast_ratio function
function contrast_ratio(a: RgbaColor, b: RgbaColor): number Computes WCAG 2.1 contrast ratio (1..21) between two colors.
Parameters
| Name | Type | Description |
|---|---|---|
a | RgbaColor |
|
b | RgbaColor |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:957
create_accordion function
function create_accordion(options: AccordionOptions): { readonly open: readonly string[]; is_open(key: string): boolean; toggle: (key: string) => void; expand: (key: string) => void; collapse: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs: () => { onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(key: string): { type: "button"; id: string; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; content_attrs(key: string): { id: string; role: "region"; "aria-labelledby": string; hidden: boolean; "data-state": "open" | "closed"; }; } Headless composable accordion built on create_roving_focus + register_control.
Parameters
| Name | Type | Description |
|---|---|---|
options | AccordionOptions |
|
Source: packages/ui/src/behaviors/accordion.svelte.ts:37
create_area function
function create_area(options?: AreaOptions): { readonly value: AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless 2D XY slider plane (e.g. color saturation/lightness picker or 2D joystick control).
Parameters
| Name | Type | Description |
|---|---|---|
options? | AreaOptions |
Source: packages/ui/src/behaviors/canvas.svelte.ts:143
create_async_options function
function create_async_options<T>(options: AsyncOptionsOptions<T>): { query: string; readonly items: readonly T[]; readonly status: AsyncOptionsStatus; readonly loading: boolean; readonly error: unknown; readonly has_more: boolean; set_query: (next: string, opts?: { immediate?: boolean; }) => void; load_more: () => void; reload: () => void; reset: () => void; cancel: () => void; } Headless debounced, abortable, paginated async option loader.
Parameters
| Name | Type | Description |
|---|---|---|
options | AsyncOptionsOptions<T> |
|
Source: packages/ui/src/behaviors/async-options.svelte.ts:48
create_auto_scroll function
function create_auto_scroll(options?: AutoScrollOptions): { update: (x: number, y: number) => void; stop: () => void; } Scrolls the innermost scrollable container under a dragging pointer (falling back to the window) when the pointer approaches its edges.
Parameters
| Name | Type | Description |
|---|---|---|
options? | AutoScrollOptions |
Source: packages/ui/src/behaviors/drag.svelte.ts:184
create_calendar function
function create_calendar(options: CalendarOptions): { readonly placeholder: CalendarDate; readonly months: readonly CalendarMonth[]; readonly weekdays: readonly string[]; set_placeholder: (next: DateValue) => void; prev_month(): void; next_month(): void; reset_pending(): void; readonly focused: CalendarDate; focus_day: (target: CalendarDate) => void; day_ref(date: CalendarDate): Attachment<HTMLElement>; day_attrs(date: CalendarDate, month: CalendarDate): { role: "button"; tabindex: number; "data-value": string; "data-selected": string | undefined; "data-selection-start": string | undefined; "data-selection-end": string | undefined; "data-today": string | undefined; "data-outside-month": string | undefined; "data-disabled": string | undefined; "aria-disabled": true | undefined; "aria-selected": boolean; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (e: KeyboardEvent) => void; }; } Headless single-day and date-range calendar grid behavior over @internationalized/date. Builds localized month grids, weekday headers, prev/next month controls, range hover previews and keyboard Arrow/PageUp/PageDown day navigation.
Parameters
| Name | Type | Description |
|---|---|---|
options | CalendarOptions |
|
Source: packages/ui/src/behaviors/date-time.svelte.ts:648
create_carousel function
function create_carousel(options: CarouselOptions): { readonly index: number; readonly count: number; readonly can_prev: boolean; readonly can_next: boolean; readonly paused: boolean; go_to: (next: number) => void; next: () => void; prev: () => void; set_paused(p: boolean): void; root: Attachment<HTMLElement>; track: Attachment<HTMLElement>; root_attrs(): { role: "region"; "aria-roledescription": string; "aria-label": string; onpointerenter: () => boolean; onpointerleave: () => boolean; onfocusin: () => boolean; onfocusout: () => boolean; onkeydown: (event: KeyboardEvent) => void; }; slide_attrs(i: number): { role: "group"; "aria-roledescription": string; "aria-label": string; "aria-hidden": true | undefined; "data-active": string | undefined; }; dot_attrs(i: number): { type: "button"; "aria-label": string; "aria-current": "true" | undefined; "data-active": string | undefined; onclick: () => void; }; } Accessible slide carousel (aria-roledescription="carousel") with Arrow/Home/End navigation, optional looping, indicator dots, autoplay that pauses on hover/focus/reduced-motion, and control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options | CarouselOptions |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:246
create_cell_range function
function create_cell_range(options: CellRangeOptions): { readonly range: CellRange | null; readonly bounds: CellBounds | null; readonly dragging: boolean; start: (cell: GridCell) => void; extend: (to: GridCell, from?: GridCell, notify?: boolean) => void; select_row: (row: number) => void; select_col: (col: number) => void; clear: () => void; contains: (cell: GridCell) => boolean; to_text(read: (cell: GridCell) => string): string; cell_attrs(cell: GridCell): { "aria-selected": boolean; "data-in-range": string | undefined; onpointerdown: (event: PointerEvent) => void; onpointerenter: () => void; }; } Rectangular spreadsheet cell-range selection with pointer drag painting, Shift-click/arrow extension, Ctrl+Space column / Shift+Space row selection, TSV copy/paste and screen-reader announcements.
Parameters
| Name | Type | Description |
|---|---|---|
options | CellRangeOptions |
|
Source: packages/ui/src/behaviors/grid.svelte.ts:259
create_checkbox_group function
function create_checkbox_group(options: CheckboxGroupOptions): { readonly checked: readonly string[]; readonly all_state: boolean | "indeterminate"; is_checked(key: string): boolean; toggle: (key: string) => void; toggle_all: () => void; group_attrs(): { role: "group"; "aria-label": string | undefined; }; all_attrs(): { type: "checkbox"; checked: boolean; "aria-checked": boolean | "mixed"; onchange: () => void; }; item_attrs(key: string): { type: "checkbox"; checked: boolean; disabled: true | undefined; onchange: () => void; }; } Headless flat checkbox group with tri-state Select All parent (true | false | 'indeterminate') and Norbius control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options | CheckboxGroupOptions |
|
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:627
create_clipboard function
function create_clipboard(options: ClipboardOptions): { readonly copied: boolean; copy: (override?: string) => Promise<boolean>; reset(): void; } Headless clipboard copy behavior with transient copied indicator and embedded-frame fallback.
Parameters
| Name | Type | Description |
|---|---|---|
options | ClipboardOptions |
|
Source: packages/ui/src/behaviors/clipboard.svelte.ts:39
create_color_picker function
function create_color_picker(options?: ColorPickerOptions): { readonly value: string; readonly rgba: RgbaColor; readonly hsv: HsvaColor; readonly plane: { readonly value: import("./canvas.svelte.js").AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: import("./canvas.svelte.js").AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }; readonly hue: { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; }; readonly alpha: { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; }; set_text: (text: string) => boolean; set_rgba: (next: RgbaColor) => void; } Headless color picker composing 2D saturation/brightness create_area, hue & alpha create_slider, color parsing/formatting and Norbius control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options? | ColorPickerOptions |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:993
create_color_scheme function
function create_color_scheme(options?: ColorSchemeOptions): { readonly preference: ColorSchemePreference; readonly system: ResolvedColorScheme; readonly resolved: ResolvedColorScheme; set: (next: ColorSchemePreference) => void; } Reactive color-scheme preference ('light' | 'dark' | 'system') synced with OS and optional storage.
Parameters
| Name | Type | Description |
|---|---|---|
options? | ColorSchemeOptions |
Source: packages/ui/src/behaviors/platform.svelte.ts:172
create_connect function
function create_connect(options: ConnectOptions): { readonly draft: ConnectDraft | null; readonly pending_from: string | null; port: (id: string) => Attachment<HTMLElement>; port_attrs: (id: string) => { tabindex: number; "data-connecting": string | undefined; "data-connect-target": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless node-graph port wiring behavior (pointer drag from port to port + keyboard Enter pick/connect).
Parameters
| Name | Type | Description |
|---|---|---|
options | ConnectOptions |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:640
create_cookie_storage function
function create_cookie_storage(options?: CookieStorageOptions): { get: (name: string) => string | null; set: (name: string, value: string) => void; remove: (name: string) => void; } Simple browser cookie storage adapter (get, set, remove) for SSR-readable UI preferences.
Parameters
| Name | Type | Description |
|---|---|---|
options? | CookieStorageOptions |
Source: packages/ui/src/behaviors/platform.svelte.ts:406
create_date_field function
function create_date_field(options: DateFieldOptions): { readonly segments: readonly DateTimeSegment[]; segment_ref(part: SegmentPart): Attachment<HTMLElement>; segment_attrs(seg: DateTimeSegment): { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segment": "day" | "month" | "year" | "hour" | "minute"; "aria-label": "day" | "month" | "year" | "hour" | "minute"; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number | undefined; "aria-valuetext": string; "aria-disabled": true | undefined; onkeydown: (e: KeyboardEvent) => void; onblur: () => void; "aria-hidden"?: undefined; }; } Headless locale-aware segmented date/instant field behavior. Supports multi-digit buffered typing (waiting for the full digit count before committing), ArrowUp/Down stepping, ArrowLeft/Right segment focus and Backspace clearing.
Parameters
| Name | Type | Description |
|---|---|---|
options | DateFieldOptions |
|
Source: packages/ui/src/behaviors/date-time.svelte.ts:222
create_disclosure function
function create_disclosure(options?: DisclosureOptions): { readonly open: boolean; readonly disabled: boolean; readonly state: "open" | "closed"; set_open: (next: boolean) => void; toggle: () => void; show: () => void; hide: () => void; trigger_attrs(): { type: "button"; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; onclick: () => void; }; content_attrs(): { id: string; hidden: boolean; "data-state": "open" | "closed"; }; } Headless disclosure state + ARIA attribute getters (trigger_attrs, content_attrs). Composes directly onto any button/panel without wrapper elements.
Parameters
| Name | Type | Description |
|---|---|---|
options? | DisclosureOptions |
Source: packages/ui/src/behaviors/disclosure.svelte.ts:27
create_dismiss function
function create_dismiss(options: DismissOptions): { readonly depth: number; readonly topmost: boolean; surface: Attachment<HTMLElement>; } Headless LIFO overlay dismissal behavior. Attach surface to the floating/dialog element so nested overlays dismiss one layer at a time on Escape or outside click.
Parameters
| Name | Type | Description |
|---|---|---|
options | DismissOptions |
|
Source: packages/ui/src/behaviors/dismiss.svelte.ts:43
create_drawer function
function create_drawer(options?: DrawerOptions): { readonly open: boolean; readonly dragging: boolean; readonly offset: number; readonly snap_index: number; readonly snap_fraction: number; set_open: (next: boolean) => void; set_snap: (idx: number) => void; surface: Attachment<HTMLElement>; handle: Attachment<HTMLElement>; surface_attrs(): { role: "dialog"; "aria-modal": true | undefined; "aria-label": string | undefined; "data-side": DrawerSide; "data-dragging": string | undefined; "data-state": "open" | "closed"; style: string | undefined; }; } Swipeable snap-point drawer / mobile bottom sheet with rubber-band overdrag, velocity fling dismissal, LIFO Escape/backdrop dismiss, modal focus trap + inert background and control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options? | DrawerOptions |
Source: packages/ui/src/behaviors/motion.svelte.ts:128
create_field function
function create_field(options?: FieldBehaviorOptions): { readonly id: string; readonly invalid: boolean; readonly error: string | undefined; label_attrs(): { for: string; "data-required": string | undefined; "data-invalid": string | undefined; "data-disabled": string | undefined; }; control_attrs(): { id: string; "aria-describedby": string | undefined; "aria-invalid": true | undefined; "aria-required": true | undefined; disabled: true | undefined; readonly: true | undefined; }; description_attrs(): { id: string; }; error_attrs(): { id: string; role: "alert"; }; } Headless field ARIA wiring (label_attrs, control_attrs, description_attrs, error_attrs).
Parameters
| Name | Type | Description |
|---|---|---|
options? | FieldBehaviorOptions |
Source: packages/ui/src/behaviors/field.svelte.ts:28
create_file_dropzone function
function create_file_dropzone(options: FileDropzoneOptions): { readonly dragging: boolean; readonly disabled: boolean; open(): void; process: (list: FileList | readonly File[]) => void; zone: Attachment<HTMLElement>; input: Attachment<HTMLInputElement>; input_attrs(): { type: "file"; accept: string | undefined; multiple: boolean | undefined; disabled: true | undefined; onchange: (event: Event) => void; }; } Headless file dropzone & batch validator: depth-counted drag-over state (zero child flicker), accept MIME/extension, max size and max count filtering, and file-input bridge.
Parameters
| Name | Type | Description |
|---|---|---|
options | FileDropzoneOptions |
|
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:764
create_floating function
function create_floating(options: FloatingOptions): { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; } Headless anchor-relative floating behavior with flip/shift collision avoidance, virtual anchors, --available-height/--available-width CSS variables and LIFO dismiss.
Parameters
| Name | Type | Description |
|---|---|---|
options | FloatingOptions |
|
Source: packages/ui/src/behaviors/floating.svelte.ts:117
create_focus_recovery function
function create_focus_recovery<T = undefined>(options: FocusRecoveryOptions<T>): { item: (key: string, data?: T) => Attachment<HTMLElement>; } Tracks focus across dynamically mounted items ({@attach recovery.item(key, data)}). When the currently focused item unmounts, fallback runs after removal settles and restores keyboard focus.
Parameters
| Name | Type | Description |
|---|---|---|
options | FocusRecoveryOptions<T> |
|
Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:29
create_focus_trap function
function create_focus_trap(options: FocusTrapOptions): { container: Attachment<HTMLElement>; } Headless focus trap + focus restoration + optional modal inert_outside & ref-counted lock_scroll attachment ({@attach trap.container}).
Parameters
| Name | Type | Description |
|---|---|---|
options | FocusTrapOptions |
|
Source: packages/ui/src/behaviors/focus-trap.svelte.ts:57
create_grid_focus function
function create_grid_focus(options: GridFocusOptions): { readonly active: GridCell | null; focus: (cell: GridCell, shift?: boolean) => void; cell(cell: GridCell): Attachment<HTMLElement>; grid_attrs(): { role: "grid"; "aria-rowcount": number; "aria-colcount": number; onkeydown: (event: KeyboardEvent) => void; }; cell_attrs(cell: GridCell): { role: "gridcell"; "aria-rowindex": number; "aria-colindex": number; "aria-disabled": true | undefined; "data-active": string | undefined; tabindex: number | undefined; onfocus: () => void; }; } Headless WAI-ARIA 2D grid roving focus manager supporting Arrow keys (RTL-aware), Home/End, Ctrl/Cmd+Home/End, PageUp/PageDown and virtualized row reveal.
Parameters
| Name | Type | Description |
|---|---|---|
options | GridFocusOptions |
|
Source: packages/ui/src/behaviors/grid.svelte.ts:51
create_hover_card function
function create_hover_card(options?: HoverCardOptions): { readonly open: boolean; readonly present: boolean; readonly floating: { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; set_open: (next: boolean) => void; trigger: Attachment<HTMLElement>; content: Attachment<HTMLElement>; trigger_attrs(): { "aria-expanded": boolean; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; onfocus: () => void; onblur: () => void; }; content_attrs(): { "data-state": "open" | "closed"; style: string; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; }; } Rich non-modal hover preview card composing create_hover_intent, create_floating, create_presence and Escape dismissal (pointer safe-corridor keeps the card open while moving into it).
Parameters
| Name | Type | Description |
|---|---|---|
options? | HoverCardOptions |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:692
create_hover_intent function
function create_hover_intent(options: HoverIntentOptions): { enter: (event?: PointerEvent, isTrigger?: boolean) => void; leave: (event?: PointerEvent) => void; clear: () => void; open_now: () => void; close_now: () => void; } Headless hover-intent manager with safe-polygon pointer corridor and warm-group delay sharing.
Parameters
| Name | Type | Description |
|---|---|---|
options | HoverIntentOptions |
|
Source: packages/ui/src/behaviors/hover-intent.svelte.ts:121
create_image_cropper function
function create_image_cropper(options?: ImageCropperOptions): { readonly crop: CropRect; readonly zoom: number; readonly rotation: number; readonly mover: { readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }; readonly resizer: { readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; }; set_crop: (next: CropRect) => void; set_zoom: (next: number) => void; rotate: (deg?: number) => void; pixel_crop(naturalWidth: number, naturalHeight: number): { x: number; y: number; width: number; height: number; }; } Headless image cropper with aspect-locked move & resize, zoom, rotation, pixel-crop export and Norbius control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options? | ImageCropperOptions |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1110
create_inline_edit function
function create_inline_edit(options: InlineEditOptions): { readonly editing: string | null; draft: string; is_editing(id: string): boolean; begin: (id: string, reason: InlineEditReason, initial?: string, origin?: HTMLElement | null) => void; commit: (reason?: InlineEditReason) => boolean; cancel: (reason?: InlineEditReason) => void; input: Attachment<HTMLInputElement | HTMLTextAreaElement>; cell_attrs(id: string): { "data-editing": string | undefined; ondblclick: (event: MouseEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; input_attrs(): { value: string; oninput: (event: Event) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }; } Headless edit-in-place behavior for table cells, card titles and tree labels: Enter/F2/double-click edits preserving value, printable key replaces value, Enter/blur/Tab commits, Escape reverts and focus restores to the originating cell.
Parameters
| Name | Type | Description |
|---|---|---|
options | InlineEditOptions |
|
Source: packages/ui/src/behaviors/grid.svelte.ts:394
create_input_history function
function create_input_history<T = string>(options: InputHistoryOptions<T>): { readonly index: number | null; readonly browsing: boolean; onkeydown: (event: KeyboardEvent) => void; reset: () => void; } Terminal / chat-composer ArrowUp & ArrowDown history recall that preserves the user's unsent draft and only triggers when the caret sits on the first (ArrowUp) or last (ArrowDown) line.
Parameters
| Name | Type | Description |
|---|---|---|
options | InputHistoryOptions<T> |
|
Source: packages/ui/src/behaviors/micro.svelte.ts:40
create_lasso function
function create_lasso(options: LassoOptions): { readonly rect: LassoRect | null; readonly active: boolean; surface: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; } Headless marquee / rubber-band drag selection over spatially positioned items.
Parameters
| Name | Type | Description |
|---|---|---|
options | LassoOptions |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:440
create_listbox function
function create_listbox<T extends ListboxItem = ListboxItem>(options: ListboxOptions<T>): { readonly id: string; query: string; readonly items: readonly T[]; readonly active: string; readonly active_id: string | undefined; readonly selected: readonly string[]; readonly count: number; is_selected: (key: string) => boolean; choose: (key: string) => void; toggle: (key: string) => void; toggle_all: () => void; clear: () => void; focus: (key: string) => void; highlight: (key: string) => void; activate_active(): void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; input_attrs(open?: boolean): { role: "combobox"; "aria-autocomplete": "list"; "aria-expanded": boolean; "aria-controls": string; "aria-activedescendant": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; list_attrs(): { id: string; role: "listbox"; "aria-multiselectable": true | undefined; onkeydown: (event: KeyboardEvent) => void; }; option_attrs(value: string): { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-highlighted": string | undefined; tabindex: number | undefined; onfocus: (() => void) | undefined; onpointerdown: ((event: PointerEvent) => void) | undefined; onpointermove: () => void; onclick: (event: MouseEvent) => void; }; } Headless composable listbox combining create_selection, create_roving_focus (or virtual aria-activedescendant highlighting), create_typeahead and live query filtering.
Parameters
| Name | Type | Description |
|---|---|---|
options | ListboxOptions<T> |
|
Example
const lb = create_listbox({
items: () => items.map((i) => ({ value: i.id, label: i.title })),
on_activate: (item) => openItem(item.value)
});
// <input bind:value={lb.query} />
// <div {...lb.list_attrs()}>
// {#each lb.items as item (item.value)}
// <div {...lb.option_attrs(item.value)}>{item.label}</div>
// {/each}
// </div> Source: packages/ui/src/behaviors/listbox.svelte.ts:71
create_menu function
function create_menu<T extends MenuItem = MenuItem>(options: MenuOptions<T>): { readonly open: boolean; readonly active: string; readonly floating: { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; open_at: (point: { x: number; y: number; }) => void; open_menu: () => void; close: () => void; toggle: () => void; trigger: Attachment<HTMLElement>; content: Attachment<HTMLElement>; context_area: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; trigger_attrs(): { type: "button"; "aria-haspopup": "menu"; "aria-expanded": boolean; "aria-controls": string | undefined; "data-state": "open" | "closed"; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; menu_attrs(): { id: string; role: "menu"; "aria-label": string | undefined; "data-state": "open" | "closed"; "data-side": FloatingSide; style: string; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "menuitem" | "menuitemcheckbox" | "menuitemradio"; "aria-disabled": true | undefined; "aria-checked": boolean | undefined; "data-highlighted": string | undefined; "data-disabled": string | undefined; tabindex: number | undefined; onfocus: () => void; onpointermove: () => void; onclick: (event: MouseEvent) => void; }; } Headless WAI-ARIA menu & context-menu behavior built on create_floating, create_roving_focus and create_typeahead.
Parameters
| Name | Type | Description |
|---|---|---|
options | MenuOptions<T> |
|
Source: packages/ui/src/behaviors/menu.svelte.ts:51
create_menubar function
function create_menubar(options: MenubarOptions): { readonly open_menu: string | null; is_open(id: string): boolean; open(id: string): void; close(): void; root: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "menubar"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(id: string): { type: "button"; role: "menuitem"; "aria-haspopup": "menu"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Desktop application role="menubar" coordinator: horizontal roving focus across top-level menu triggers, hover-switch when any menu is open, cross-menu ArrowLeft/ArrowRight handoff and Escape close.
Parameters
| Name | Type | Description |
|---|---|---|
options | MenubarOptions |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:412
create_move function
function create_move(options: MoveOptions): { readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless 2D free-move behavior (pointer drag + Arrow keys, optional grid snap & bounds).
Parameters
| Name | Type | Description |
|---|---|---|
options | MoveOptions |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:40
create_navigation_menu function
function create_navigation_menu(options: NavigationMenuOptions): { readonly active: string | null; is_open(id: string): boolean; open(id: string): void; close(): void; root: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(id: string): { type: "button"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; }; content_attrs(): { onpointerenter: () => void; onpointerleave: () => void; }; } Site/app mega-menu navigation behavior: hover-intent opening with shared warm group, click toggle, keyboard roving focus across top-level triggers and Escape/outside dismissal.
Parameters
| Name | Type | Description |
|---|---|---|
options | NavigationMenuOptions |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:535
create_number_input function
function create_number_input(options?: NumberInputOptions): { readonly value: number | null; readonly text: string; set: (next: number | null) => void; increment: () => void; decrement: () => void; increment_button: import("svelte/attachments").Attachment<HTMLElement>; decrement_button: import("svelte/attachments").Attachment<HTMLElement>; input_attrs(): { role: "spinbutton"; inputmode: "decimal" | "numeric"; value: string; disabled: true | undefined; "aria-label": string | undefined; "aria-valuemin": number | undefined; "aria-valuemax": number | undefined; "aria-valuenow": number | undefined; oninput: (event: Event) => void; onblur: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless WAI-ARIA spinbutton number input with clamped stepping, Arrow/Page/Home/End keys, press-and-hold increment/decrement attachments (bind_repeat) and clean empty/numeric parsing.
Parameters
| Name | Type | Description |
|---|---|---|
options? | NumberInputOptions |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:278
create_overflow function
function create_overflow<T>(options: OverflowOptions<T>): { readonly fit: number; readonly visible: readonly T[]; readonly hidden: readonly T[]; readonly has_overflow: boolean; readonly active_in_hidden: boolean; more_open: boolean; list: Attachment<HTMLElement>; measure: Attachment<HTMLElement>; } Headless ResizeObserver-backed overflow behavior. Attach list to the visible strip and measure to an off-screen mirror containing every item plus the trailing overflow trigger; read visible, hidden and active_in_hidden reactively.
Parameters
| Name | Type | Description |
|---|---|---|
options | OverflowOptions<T> |
|
Source: packages/ui/src/behaviors/overflow.svelte.ts:25
create_overlay_stack function
function create_overlay_stack<Payload, Result = unknown>(): { readonly stack: readonly OverlayEntry<Payload, Result>[]; readonly top: OverlayEntry<Payload, Result> | null; readonly count: number; open: (payload: Payload) => { readonly id: string; readonly promise: Promise<Result | undefined>; }; close: (id: string, result?: Result) => void; close_top: (result?: Result) => void; close_all: () => void; } Imperative LIFO overlay/modal stack manager: open(payload) returns a Promise that settles when close(id, result) or Escape dismisses that overlay layer.
Source: packages/ui/src/behaviors/platform.svelte.ts:458
create_pagination function
function create_pagination(options: PaginationOptions): { readonly page: number; readonly pages: number | null; readonly has_previous: boolean; readonly has_next: boolean; readonly range: PaginationEntry[]; go: (target: number) => void; previous: () => void; next: () => void; first: () => void; last: () => void; } Headless pagination behavior supporting both offset (total_pages) and keyset (has_previous/has_next) views.
Parameters
| Name | Type | Description |
|---|---|---|
options | PaginationOptions |
|
Source: packages/ui/src/behaviors/pagination.svelte.ts:61
create_panel_group function
function create_panel_group(options: PanelGroupOptions): { readonly sizes: readonly number[]; readonly dragging: number | null; size_of(index: number): number; reset: () => void; container: Attachment<HTMLElement>; handle: (handleIndex: number) => Attachment<HTMLElement>; handle_attrs(handleIndex: number): { role: "separator"; tabindex: number; "aria-orientation": "horizontal" | "vertical"; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number; "data-dragging": string | undefined; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Multi-pane percentage resizable layout group (role="separator" handles between adjacent panes) with min/max clamping, collapsible snap-to-zero, double-click reset, keyboard stepping and optional persistence.
Parameters
| Name | Type | Description |
|---|---|---|
options | PanelGroupOptions |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:48
create_password_input function
function create_password_input(options?: PasswordInputOptions): { readonly visible: boolean; readonly caps_lock: boolean; toggle: () => void; set_visible(next: boolean): void; input: Attachment<HTMLInputElement>; input_attrs(): { type: "text" | "password"; "data-agent-secret": string; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; onkeyup: (event: KeyboardEvent) => void; }; toggle_attrs(): { type: "button"; "aria-pressed": boolean; "aria-label": string; onclick: () => void; }; } Headless password input behavior: visibility toggle, CapsLock warning detection and automatic data-agent-secret protection so secret values never leak into agent snapshots.
Parameters
| Name | Type | Description |
|---|---|---|
options? | PasswordInputOptions |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:888
create_pin_input function
function create_pin_input(options: PinInputOptions): { readonly value: string; readonly cells: readonly PinCell[]; readonly focused: boolean; set_value: (raw: string) => void; input_attrs(): { value: string; maxlength: number; disabled: true | undefined; onfocus: (event: FocusEvent) => void; onblur: () => void; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onselect: (event: Event) => void; }; } Headless PIN / OTP input behavior exposing reactive cells, value and native input_attrs().
Parameters
| Name | Type | Description |
|---|---|---|
options | PinInputOptions |
|
Source: packages/ui/src/behaviors/pin.svelte.ts:48
create_pointer_kind function
function create_pointer_kind(): { readonly precision: PointerPrecision; readonly hover: boolean; readonly coarse: boolean; } Reactive primary pointer precision (coarse/fine) and hover capability store.
Source: packages/ui/src/behaviors/platform.svelte.ts:120
create_presence function
function create_presence(options: PresenceOptions): { readonly present: boolean; readonly state: PresenceState; readonly exiting: boolean; attach: Attachment<HTMLElement>; } Keeps an element mounted while closing until its CSS/WAAPI exit animation finishes. Writes data-starting-style on the first frame after mount and data-ending-style during exit. In environments without animations (or under reduced motion), unmounts synchronously.
Parameters
| Name | Type | Description |
|---|---|---|
options | PresenceOptions |
|
Source: packages/ui/src/behaviors/presence.svelte.ts:115
create_preview function
function create_preview<T>(options: PreviewOptions<T>): { readonly current: T; readonly previewing: boolean; update: (next: T) => void; commit: (finalValue?: T) => void; cancel: () => void; } Holds a live transient pointer-drag/scrub preview value over an authoritative value, with clean commit() and cancel() transitions.
Parameters
| Name | Type | Description |
|---|---|---|
options | PreviewOptions<T> |
|
Source: packages/ui/src/behaviors/platform.svelte.ts:339
create_radio_group function
function create_radio_group(options: RadioGroupOptions): { readonly value: string | undefined; select: (next: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "radiogroup"; "aria-label": string | undefined; "aria-orientation": "horizontal" | "vertical"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { type: "button"; role: "radio"; "aria-checked": boolean; "aria-disabled": true | undefined; "data-state": "checked" | "unchecked"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; } Headless WAI-ARIA radiogroup (also powers Segmented Controls): single tab stop, arrow keys move focus and select simultaneously.
Parameters
| Name | Type | Description |
|---|---|---|
options | RadioGroupOptions |
|
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:101
create_rating function
function create_rating(options?: RatingOptions): { readonly value: number; readonly hovered: number | null; readonly display: number; items: number[]; rate: (next: number) => void; item: (score: number) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "radiogroup"; "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(score: number): { type: "button"; role: "radio"; "aria-checked": boolean; "aria-label": string; "data-filled": string | undefined; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; }; } Headless star/score rating picker (radiogroup, hover preview, Arrow/Home/End keys).
Parameters
| Name | Type | Description |
|---|---|---|
options? | RatingOptions |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:424
create_reorder function
function create_reorder(options: ReorderOptions): { readonly dragging: string | null; readonly over: string | null; move(fromIndex: number, toIndex: number): void; move_by: (key: string, delta: number) => void; item(key: string): Attachment<HTMLElement>; item_attrs(key: string): { draggable: boolean; "data-dragging": string | undefined; "data-drop-target": string | undefined; ondragstart: (event: DragEvent) => void; ondragover: (event: DragEvent) => void; ondragleave: () => void; ondrop: (event: DragEvent) => void; ondragend: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless pointer + keyboard reordering behavior for queues, lanes, checklists and columns.
Parameters
| Name | Type | Description |
|---|---|---|
options | ReorderOptions |
|
Source: packages/ui/src/behaviors/reorder.svelte.ts:42
create_resize function
function create_resize(options: ResizeOptions): { readonly dragging: boolean; handle_attrs(): { role: "separator"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number | undefined; tabindex: number; "data-dragging": string | undefined; onpointerdown: (event: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless 1D pointer + keyboard resize handle behavior (handle_attrs()).
Parameters
| Name | Type | Description |
|---|---|---|
options | ResizeOptions |
|
Source: packages/ui/src/behaviors/resize.svelte.ts:41
create_resize_box function
function create_resize_box(options: ResizeBoxOptions): { readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless 2D edge & corner resize behavior supporting 'x', 'y' and 'xy' handles with zoom scaling.
Parameters
| Name | Type | Description |
|---|---|---|
options | ResizeBoxOptions |
|
Source: packages/ui/src/behaviors/resize.svelte.ts:162
create_roving_focus function
function create_roving_focus(options: RovingFocusOptions): { readonly active: string; focus(key: string): void; next(): void; prev(): void; item(key: string): Attachment<HTMLElement>; root_attrs(): { onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; }; } Headless roving-tabindex focus manager with automatic focus recovery when items leave the DOM.
Parameters
| Name | Type | Description |
|---|---|---|
options | RovingFocusOptions |
|
Source: packages/ui/src/behaviors/roving-focus.svelte.ts:34
create_selection function
function create_selection(options: SelectionOptions): { readonly selected: readonly string[]; readonly count: number; readonly all_selected: boolean; readonly some_selected: boolean; is_selected(key: string): boolean; choose: (key: string) => void; toggle: (key: string) => void; extend: (to: string, opts?: { from?: string | null; additive?: boolean; }) => void; toggle_all: () => void; clear: () => void; item_attrs(key: string): { "aria-selected": boolean; "data-selected": string | undefined; "aria-disabled": true | undefined; onclick: (event: MouseEvent) => void; }; } Headless single/multi/range selection behavior for lists, tables, boards, timelines and pickers. Spread item_attrs(key) onto each item to get aria-selected, data-selected and native click / Shift+click / Cmd+click handling automatically.
Parameters
| Name | Type | Description |
|---|---|---|
options | SelectionOptions |
|
Source: packages/ui/src/behaviors/selection.svelte.ts:58
create_shortcuts function
function create_shortcuts(bindings: readonly ShortcutBinding[] | (() => readonly ShortcutBinding[]), options?: { readonly target?: () => EventTarget | null; readonly chord_timeout_ms?: number; }): void Binds one or more keyboard shortcuts (including multi-key chord sequences like 'g i') while mounted, cleaning up automatically when the enclosing component tears down.
Parameters
| Name | Type | Description |
|---|---|---|
bindings | readonly ShortcutBinding[] | (() => readonly ShortcutBinding[]) | |
options? | { readonly target?: () => EventTarget | null; readonly chord_timeout_ms?: number; } |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:153
create_slider function
function create_slider(options?: SliderOptions): { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless single- or multi-thumb slider behavior (track attachment + thumb_attrs(index?)).
Parameters
| Name | Type | Description |
|---|---|---|
options? | SliderOptions |
Source: packages/ui/src/behaviors/slider.svelte.ts:54
create_spans function
function create_spans<S extends Span = Span>(options: SpansOptions<S>): { readonly spans: readonly S[]; readonly active: string | null; update_span: (id: string, patch: Partial<Pick<Span, "track" | "start" | "end">>, action: "move" | "resize", commitNow?: boolean) => void; create: (track: string, start: number, end: number) => void; remove: (id: string) => void; cancel(): void; span_attrs: (span: S) => { tabindex: number; "data-span-id": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless track-span editor (week calendars, Gantt charts, room schedulers): move along or across tracks, resize start/end edges, draw new spans and delete — all snapped to step with keyboard support.
Parameters
| Name | Type | Description |
|---|---|---|
options | SpansOptions<S> |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:324
create_stick_to_bottom function
function create_stick_to_bottom(options?: StickToBottomOptions): { readonly stuck: boolean; scroll_to_bottom: (behavior?: ScrollBehavior) => void; viewport: Attachment<HTMLElement>; } Headless tail-latching scroll attachment ({@attach tail.viewport}).
Parameters
| Name | Type | Description |
|---|---|---|
options? | StickToBottomOptions |
Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:20
create_swipe_actions function
function create_swipe_actions(options?: SwipeActionsOptions): { readonly open: SwipeOpen | null; readonly offset: { readonly key: string; readonly x: number; } | null; close: () => void; row: (key: string) => Attachment<HTMLElement>; row_attrs: (key: string) => { "data-swipe-open": SwipeSide | undefined; style: string; onkeydown: (event: KeyboardEvent) => void; }; } Mail-style row swipe-to-reveal actions with rubber-band resistance, full-swipe trigger and ArrowLeft/ArrowRight/Escape keyboard parity.
Parameters
| Name | Type | Description |
|---|---|---|
options? | SwipeActionsOptions |
Source: packages/ui/src/behaviors/canvas.svelte.ts:747
create_switch function
function create_switch(options?: SwitchOptions): { readonly checked: boolean; readonly disabled: boolean; set_checked: (next: boolean) => void; toggle: () => void; attrs(): { type: "button"; role: "switch"; "aria-checked": boolean; "aria-label": string | undefined; "data-state": "checked" | "unchecked"; disabled: true | undefined; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless WAI-ARIA switch behavior (role="switch", aria-checked, Space/Enter toggle).
Parameters
| Name | Type | Description |
|---|---|---|
options? | SwitchOptions |
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:23
create_time_field function
function create_time_field(options: TimeFieldOptions): { readonly segments: readonly DateTimeSegment[]; segment_ref(part: SegmentPart): Attachment<HTMLElement>; segment_attrs(seg: DateTimeSegment): { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segment": "hour" | "minute"; "aria-label": "hour" | "minute"; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number | undefined; "aria-valuetext": string; "aria-disabled": true | undefined; onkeydown: (e: KeyboardEvent) => void; onblur: () => void; "aria-hidden"?: undefined; }; } Headless 24-hour segmented time-of-day field behavior (hour and optional minute).
Parameters
| Name | Type | Description |
|---|---|---|
options | TimeFieldOptions |
|
Source: packages/ui/src/behaviors/date-time.svelte.ts:437
create_timeline function
function create_timeline(options: TimelineOptions): { readonly expanded: readonly string[]; is_expanded(id: string): boolean; toggle: (id: string) => void; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "feed"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "article"; "aria-expanded": boolean; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; }; } Accessible activity timeline behavior (role="feed" / ordered expandable entries) with vertical keyboard navigation, per-entry expand/collapse and Norbius control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options | TimelineOptions |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1350
create_toggle_group function
function create_toggle_group(options: ToggleGroupOptions): { readonly pressed: readonly string[]; is_pressed(key: string): boolean; toggle: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "group"; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { type: "button"; "aria-pressed": boolean; "data-state": "on" | "off"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; } Headless toggle button group (aria-pressed, single or multi-select, roving focus).
Parameters
| Name | Type | Description |
|---|---|---|
options | ToggleGroupOptions |
|
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:183
create_token_input function
function create_token_input(options?: TokenInputOptions): { readonly values: readonly string[]; input_text: string; readonly active_index: number | null; readonly editing_index: number | null; editing_text: string; readonly error: string | null; add: (raw: string) => boolean; remove_at: (index: number) => void; commit_input: () => void; start_edit: (index: number) => void; commit_edit: () => void; cancel_edit: () => void; input: Attachment<HTMLInputElement>; chip: (index: number) => Attachment<HTMLElement>; input_attrs(): { value: string; disabled: true | undefined; "aria-label": string | undefined; onfocus: () => void; oninput: (event: Event) => void; onpaste: (event: ClipboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }; chip_attrs(index: number): { tabindex: number; "data-active": string | undefined; "data-editing": string | undefined; onfocus: () => void; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; } Headless chip/tag/recipient token input: splits on delimiters & paste, navigates chips with ArrowLeft/ArrowRight/Home/End, Backspace selects/deletes the last chip, supports inline chip editing and registers with Norbius's control bridge.
Parameters
| Name | Type | Description |
|---|---|---|
options? | TokenInputOptions |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:45
create_toolbar function
function create_toolbar(options: ToolbarOptions): { readonly active: string; focus: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "toolbar"; "aria-label": string | undefined; "aria-orientation": "horizontal" | "vertical"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs: (key: string) => { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; }; } Headless WAI-ARIA role="toolbar" single-tab-stop roving container.
Parameters
| Name | Type | Description |
|---|---|---|
options | ToolbarOptions |
|
Source: packages/ui/src/behaviors/controls-extra.svelte.ts:501
create_transfer function
function create_transfer(options: TransferOptions): { readonly lists: Readonly<Record<string, readonly string[]>>; readonly draft: TransferDraft | null; readonly dragging: string | null; move: (key: string, to: string, index: number, commitNow?: boolean) => void; container(id: string): Attachment<HTMLElement>; item(key: string): Attachment<HTMLElement>; item_attrs(key: string): { "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless cross-container drag-and-drop + keyboard transfer (Kanban boards, folder lists, team rosters) with live draft preview, edge auto-scrolling and screen-reader announcements.
Parameters
| Name | Type | Description |
|---|---|---|
options | TransferOptions |
|
Source: packages/ui/src/behaviors/drag.svelte.ts:299
create_tree function
function create_tree<T = unknown>(options: TreeOptions<T>): { readonly rows: FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "tree"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; }; } Headless WAI-ARIA tree behavior with ArrowRight expand/descend, ArrowLeft collapse/ascend, typeahead, roving tabindex, focus recovery on collapse, selection and optional agent control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options | TreeOptions<T> |
|
Source: packages/ui/src/behaviors/tree.svelte.ts:240
create_tree_reorder function
function create_tree_reorder(options: TreeReorderOptions): { readonly dragging: string | null; readonly drop: TreePlace | null; commit: (id: string, place: TreePlace) => void; item(id: string): Attachment<HTMLElement>; item_attrs(id: string): { "data-dragging": string | undefined; "data-drop-position": "before" | "inside" | "after" | undefined; onkeydown: (event: KeyboardEvent) => void; }; } Headless hierarchical tree reordering (pointer drop zones: top 25% before, middle 50% inside, bottom 25% after; plus Alt+ArrowUp/Down/Left/Right keyboard reparenting) with subtree cycle guard.
Parameters
| Name | Type | Description |
|---|---|---|
options | TreeReorderOptions |
|
Source: packages/ui/src/behaviors/drag.svelte.ts:497
create_trigger_menu function
function create_trigger_menu<T extends TriggerMenuItem = TriggerMenuItem>(options: TriggerMenuOptions<T>): { readonly open: boolean; readonly match: TriggerMatch | null; readonly items: readonly T[]; readonly path: readonly T[]; readonly active_index: number; readonly floating: { readonly x: number; readonly y: number; readonly side: import("./floating.svelte.js").FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; close: () => void; select: (item: T) => void; pop_level(): void; field: Attachment<HTMLInputElement | HTMLTextAreaElement>; content: Attachment<HTMLElement>; input_attrs(): { "aria-expanded": boolean; "aria-haspopup": "listbox"; "aria-activedescendant": string | undefined; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; option_attrs(item: T, index: number): { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-highlighted": string | undefined; onpointerenter: () => void; onmousedown: (event: MouseEvent) => void; onclick: () => void; }; } Inline @mention / / slash-command trigger menu for <input> and <textarea>: tracks caret trigger matches, fuzzy-filters items, supports nested sub-menus (children), keyboard navigation (ArrowUp/ArrowDown/Enter/Tab/Escape), floating anchor positioning and Norbius control registration.
Parameters
| Name | Type | Description |
|---|---|---|
options | TriggerMenuOptions<T> |
|
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:397
create_typeahead function
function create_typeahead(options: TypeaheadOptions): { onkeydown: (event: KeyboardEvent) => void; reset: () => void; readonly query: string; } Headless incremental typeahead behavior. Pass onkeydown to any listbox, menu, rail or tab strip (composes directly alongside create_roving_focus).
Parameters
| Name | Type | Description |
|---|---|---|
options | TypeaheadOptions |
|
Source: packages/ui/src/behaviors/typeahead.svelte.ts:28
create_ui_history function
function create_ui_history(options?: UiHistoryOptions): { readonly entries: readonly UiHistoryEntry[]; readonly position: number; readonly can_undo: boolean; readonly can_redo: boolean; undo: () => boolean; redo: () => boolean; undo_source: (source: ChangeSource) => number; destroy: () => void; } Records live control changes via observe_controls and supports stepping backward/forward or reverting every non-redacted change made by one source (e.g. history.undo_source('agent')).
Parameters
| Name | Type | Description |
|---|---|---|
options? | UiHistoryOptions |
Source: packages/ui/src/behaviors/controls.svelte.ts:436
create_undo_stack function
function create_undo_stack<T>(initial: T, options?: UndoStackOptions): { readonly current: T; readonly can_undo: boolean; readonly can_redo: boolean; readonly length: number; record: (next: T, opts?: { readonly group?: string; readonly time?: number; }) => void; undo: () => T; redo: () => T; reset: (value: T) => void; } Grouped undo/redo stack for any immutable state value. Consecutive edits with the same group arriving within group_delay_ms coalesce into one undo entry.
Parameters
| Name | Type | Description |
|---|---|---|
initial | T | |
options? | UndoStackOptions |
Source: packages/ui/src/behaviors/micro.svelte.ts:115
create_velocity_tracker function
function create_velocity_tracker(): { add(position: number, time?: number): void; velocity(): number; reset(): void; } Exponentially weighted pointer velocity tracker (pixels per millisecond).
Source: packages/ui/src/behaviors/motion.svelte.ts:18
create_viewport function
function create_viewport(options?: ViewportOptions): { readonly x: number; readonly y: number; readonly zoom: number; readonly panning: boolean; readonly transform: string; set_camera: (next: Partial<ViewportCamera>) => void; zoom_at: (factor: number, originX: number, originY: number) => void; reset(): void; surface: Attachment<HTMLElement>; } Headless pan/zoom canvas viewport with pointer panning, wheel-to-zoom around cursor, fit and reset.
Parameters
| Name | Type | Description |
|---|---|---|
options? | ViewportOptions |
Source: packages/ui/src/behaviors/canvas.svelte.ts:533
create_waterfall function
function create_waterfall<T extends WaterfallItem = WaterfallItem>(options: WaterfallOptions<T>): { readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly min: number; readonly max: number; readonly view_start: number; readonly view_end: number; readonly tree: { readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "tree"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; }; }; bar_rect: (item: WaterfallItem) => { readonly left_pct: number; readonly width_pct: number; }; zoom(start: number, end: number): void; reset_zoom(): void; } Hierarchical trace/Gantt waterfall behavior composing create_tree with automatic time-domain bounds, zoomable [view_start, view_end] window and percentage bar placement (bar_rect).
Parameters
| Name | Type | Description |
|---|---|---|
options | WaterfallOptions<T> |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1244
current_modality function
function current_modality(): InputModality Returns the current global input modality ('keyboard' or 'pointer').
Source: packages/ui/src/behaviors/platform.svelte.ts:270
current_source function
function current_source(): ChangeSource Returns the currently attributed change source ('pointer' | 'keyboard' | 'agent' | 'programmatic').
Source: packages/ui/src/behaviors/controls.svelte.ts:108
describe_controls function
function describe_controls(options?: PageControlsOptions): string Concise one-line summary of registered controls for Norbius's pageScreen() context.
Parameters
| Name | Type | Description |
|---|---|---|
options? | PageControlsOptions |
Source: packages/ui/src/behaviors/controls.svelte.ts:390
format_color function
function format_color(color: RgbaColor, format?: "hex" | "rgb" | "hsl"): string Formats an RgbaColor as 'hex', 'rgb' or 'hsl'.
Parameters
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
format? | 'hex' | 'rgb' | 'hsl' |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:929
format_shortcut function
function format_shortcut(spec: string, platform?: "mac" | "other"): string Formats a shortcut spec for human-readable UI badges (e.g. '⌘K' on macOS, 'Ctrl+K' elsewhere).
Parameters
| Name | Type | Description |
|---|---|---|
spec | string | |
platform? | 'mac' | 'other' |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:122
fuzzy_score function
function fuzzy_score(query: string, text: string): number Accent- and case-insensitive fuzzy match score for query against text. Returns 0 when query does not match, or a positive relevance score (higher is better).
Parameters
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
Source: packages/ui/src/behaviors/text-match.ts:125
get_portal_target function
function get_portal_target(): PortalTarget Reads the inherited portal target from context, if configured.
Source: packages/ui/src/behaviors/portal.svelte.ts:29
hsl_to_rgb function
function hsl_to_rgb(color: HslaColor): RgbaColor Converts HSL (h: 0..360, s: 0..100, l: 0..100) to RGBA (0..255).
Parameters
| Name | Type | Description |
|---|---|---|
color | HslaColor |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:828
hsv_to_rgb function
function hsv_to_rgb(color: HsvaColor): RgbaColor Converts HSV (h: 0..360, s: 0..100, v: 0..100) to RGBA (0..255).
Parameters
| Name | Type | Description |
|---|---|---|
color | HsvaColor |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:867
inert_outside function
function inert_outside(keep: HTMLElement | readonly HTMLElement[]): InertHandle Marks every sibling tree outside keep as inert (ref-counted across nested modals) while keeping live announcer regions active. Call .keep(el) to exempt a portaled overlay opened inside.
Parameters
| Name | Type | Description |
|---|---|---|
keep | HTMLElement | readonly HTMLElement[] |
Source: packages/ui/src/behaviors/modal.svelte.ts:145
input_hints function
function input_hints(kind: InputHintKind, overrides?: { readonly enterkeyhint?: EnterKeyHint; }): InputHints Returns consistent mobile keyboard, autocomplete and spellcheck attributes for a semantic field kind.
Parameters
| Name | Type | Description |
|---|---|---|
kind | InputHintKind | |
overrides? | { readonly enterkeyhint?: EnterKeyHint; } |
Source: packages/ui/src/behaviors/micro.svelte.ts:461
invoke_control function
function invoke_control(ref: string, action: string, args?: readonly unknown[], options?: { readonly within?: Element | null; readonly allow_confirm?: boolean; }): ControlInvokeResult Invokes a named semantic action on a registered control by id or accessible label, attributing the change to 'agent' and enforcing disabled/hidden/confirmation guards.
Parameters
| Name | Type | Description |
|---|---|---|
ref | string | |
action | string | |
args? | readonly unknown[] | |
options? | { readonly within?: Element | null; readonly allow_confirm?: boolean; } |
Source: packages/ui/src/behaviors/controls.svelte.ts:328
is_focus_from_keyboard function
function is_focus_from_keyboard(): boolean Returns whether the most recent user interaction was keyboard-driven (for focus-visible heuristics).
Source: packages/ui/src/behaviors/platform.svelte.ts:264
is_span_free function
function is_span_free(spans: readonly Span[], track: string, start: number, end: number, ignoreId?: string): boolean Returns whether [start, end) overlaps no existing span on track (excluding ignoreId).
Parameters
| Name | Type | Description |
|---|---|---|
spans | readonly Span[] | |
track | string | |
start | number | |
end | number | |
ignoreId? | string |
Source: packages/ui/src/behaviors/canvas.svelte.ts:271
keep_focus function
function keep_focus(): Attachment<HTMLElement> Attachment ({@attach keep_focus()}) that prevents pointerdown / mousedown on a button or toolbar control from stealing DOM focus away from an active text editor or input.
Source: packages/ui/src/behaviors/platform.svelte.ts:279
lock_scroll function
function lock_scroll(doc?: Document | undefined): () => void Reference-counted document scroll lock. The first holder freezes the scroller without horizontal gutter shift; only the last release restores styles. Safe to call release multiple times.
Parameters
| Name | Type | Description |
|---|---|---|
doc? | Document | undefined |
Source: packages/ui/src/behaviors/modal.svelte.ts:70
match_ranges function
function match_ranges(query: string, text: string): readonly MatchRange[] Returns sorted, non-overlapping [start, end) highlight spans where query matches text, or an empty array when query is blank or does not match.
Parameters
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
Source: packages/ui/src/behaviors/text-match.ts:133
match_segments function
function match_segments(query: string, text: string): readonly MatchSegment[] Splits text into alternating plain and matched segments for rendering search highlights without injecting raw HTML.
Parameters
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
Source: packages/ui/src/behaviors/text-match.ts:141
matches_shortcut function
function matches_shortcut(event: KeyboardEvent, spec: string, options?: MatchShortcutOptions): boolean Returns whether event matches a single-step shortcut string such as 'mod+k' or 'shift+escape'.
Parameters
| Name | Type | Description |
|---|---|---|
event | KeyboardEvent | |
spec | string | |
options? | MatchShortcutOptions |
Source: packages/ui/src/behaviors/shortcuts.svelte.ts:87
mix_colors function
function mix_colors(a: RgbaColor, b: RgbaColor, t: number): RgbaColor Linearly mixes two RGBA colors (t = 0 -> a, t = 1 -> b).
Parameters
| Name | Type | Description |
|---|---|---|
a | RgbaColor |
|
b | RgbaColor |
|
t | number |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:966
move_item function
function move_item<T>(list: readonly T[], from: number, to: number): T[] Returns a new array with the item at from moved to to.
Parameters
| Name | Type | Description |
|---|---|---|
list | readonly T[] | |
from | number | |
to | number |
Source: packages/ui/src/behaviors/reorder.svelte.ts:29
nearest_in_direction function
function nearest_in_direction(from: SpatialRect, candidates: readonly SpatialRect[], direction: SpatialDirection): number Returns the index of the nearest candidate rectangle strictly in direction from from, or -1.
Parameters
| Name | Type | Description |
|---|---|---|
from | SpatialRect |
|
candidates | readonly SpatialRect[] | |
direction | SpatialDirection |
Source: packages/ui/src/behaviors/micro.svelte.ts:496
nearest_snap_point function
function nearest_snap_point(position: number, velocity: number, points: readonly number[], options?: { readonly projection_ms?: number; }): number Projects a position using release velocity and returns the nearest snap point.
Parameters
| Name | Type | Description |
|---|---|---|
position | number | |
velocity | number | |
points | readonly number[] | |
options? | { readonly projection_ms?: number; } |
Source: packages/ui/src/behaviors/motion.svelte.ts:45
notify_control_change function
function notify_control_change(change: { readonly id: string; readonly kind?: string; readonly label?: string; readonly key: string; readonly previous: unknown; readonly value: unknown; readonly reason?: string; readonly source?: ChangeSource; readonly committed?: boolean; }): void Emits a structured UI state change to every matching observe_controls listener.
Parameters
| Name | Type | Description |
|---|---|---|
change | { readonly id: string; readonly kind?: string; readonly label?: string; readonly key: string; readonly previous: unknown; readonly value: unknown; readonly reason?: string; readonly source?: ChangeSource; readonly committed?: boolean; } |
|
Source: packages/ui/src/behaviors/controls.svelte.ts:207
observe_controls function
function observe_controls(listener: (change: ControlChange) => void, options?: { readonly within?: Element | (() => Element | null | undefined); readonly live?: boolean; }): () => void Subscribes to structured control state changes (settled commits by default; live: true for drag steps).
Parameters
| Name | Type | Description |
|---|---|---|
listener | (change: ControlChange) => void | |
options? | { readonly within?: Element | (() => Element | null | undefined); readonly live?: boolean; } |
Source: packages/ui/src/behaviors/controls.svelte.ts:250
page_controls function
function page_controls(options?: PageControlsOptions): ControlSnapshot[] Returns a deterministic snapshot of registered visible UI controls on the current page.
Parameters
| Name | Type | Description |
|---|---|---|
options? | PageControlsOptions |
Source: packages/ui/src/behaviors/controls.svelte.ts:263
page_range function
function page_range(current: number, total: number, siblings?: number): PaginationEntry[] Computes a compact 1-based page range with 'ellipsis' gaps.
Parameters
| Name | Type | Description |
|---|---|---|
current | number | |
total | number | |
siblings? | number |
Source: packages/ui/src/behaviors/pagination.svelte.ts:32
parse_color function
function parse_color(input: string): RgbaColor | null Parses CSS #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(...) or hsl(...) strings into RgbaColor.
Parameters
| Name | Type | Description |
|---|---|---|
input | string |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:887
pointer_kind_of function
function pointer_kind_of(): PointerKindState Reads current device pointer precision and hover support synchronously.
Source: packages/ui/src/behaviors/platform.svelte.ts:110
portal function
function portal(target?: PortalTarget | PortalOptions): Attachment<HTMLElement> Svelte attachment that moves the element into the resolved portal container while mounted and restores or removes it cleanly on teardown.
Parameters
| Name | Type | Description |
|---|---|---|
target? | PortalTarget | PortalOptions |
Source: packages/ui/src/behaviors/portal.svelte.ts:55
prepare_announcements function
function prepare_announcements(doc?: Document | undefined): void Pre-creates polite and assertive live regions so the very first announcement is never dropped.
Parameters
| Name | Type | Description |
|---|---|---|
doc? | Document | undefined |
Source: packages/ui/src/behaviors/announce.svelte.ts:49
register_control function
function register_control(descriptor: ControlDescriptor): () => void Registers a live UI control while mounted and returns its cleanup function. Designed for use inside $effect or Svelte attachments ({@attach ...}).
Parameters
| Name | Type | Description |
|---|---|---|
descriptor | ControlDescriptor |
|
Source: packages/ui/src/behaviors/controls.svelte.ts:197
reset_hover_group function
function reset_hover_group(group?: string): void Clears warm-group state (handy between tests).
Parameters
| Name | Type | Description |
|---|---|---|
group? | string |
Source: packages/ui/src/behaviors/hover-intent.svelte.ts:87
resolve_control function
function resolve_control(ref: string, options?: { readonly within?: Element | null; }): { readonly entry: ControlDescriptor; readonly snapshot: ControlSnapshot; } | { readonly error: string; } Resolves a registered control by exact id, exact label (case-insensitive), or unique label substring.
Parameters
| Name | Type | Description |
|---|---|---|
ref | string | |
options? | { readonly within?: Element | null; } |
Source: packages/ui/src/behaviors/controls.svelte.ts:284
rgb_to_hsl function
function rgb_to_hsl(color: RgbaColor): HslaColor Converts RGB (0..255) + alpha (0..1) to HSL (h: 0..360, s: 0..100, l: 0..100).
Parameters
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:808
rgb_to_hsv function
function rgb_to_hsv(color: RgbaColor): HsvaColor Converts RGB (0..255) to HSV (h: 0..360, s: 0..100, v: 0..100).
Parameters
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:848
rubber_band function
function rubber_band(offset: number, dimension: number, constant?: number): number Applies iOS-style asymptotic rubber-band resistance beyond [0, limit].
Parameters
| Name | Type | Description |
|---|---|---|
offset | number | |
dimension | number | |
constant? | number |
Source: packages/ui/src/behaviors/motion.svelte.ts:10
set_announcer function
function set_announcer(fn: CustomAnnouncer | undefined): void Replaces live-region output (useful in headless unit tests); pass undefined to restore.
Parameters
| Name | Type | Description |
|---|---|---|
fn | CustomAnnouncer | undefined |
Source: packages/ui/src/behaviors/announce.svelte.ts:23
set_portal_target function
function set_portal_target(target: PortalTarget | PortalGetter): void Sets the default portal mount target for every descendant overlay.
Parameters
| Name | Type | Description |
|---|---|---|
target | PortalTarget | PortalGetter |
Source: packages/ui/src/behaviors/portal.svelte.ts:23
settle_draft function
function settle_draft<T>(current: Readonly<Record<string, T>>, submitted: Readonly<Record<string, T>>, equals?: (a: T, b: T) => boolean): Record<string, T> Race-safe optimistic draft settler: removes keys whose current draft value still equals the snapshot that just committed, while preserving newer edits typed while the save was in flight.
Parameters
| Name | Type | Description |
|---|---|---|
current | Readonly<Record<string, T>> | |
submitted | Readonly<Record<string, T>> | |
equals? | (a: T, b: T) => boolean |
Source: packages/ui/src/behaviors/platform.svelte.ts:378
spatial_move function
function spatial_move(current: HTMLElement, elements: readonly HTMLElement[], direction: SpatialDirection): HTMLElement | null Finds the nearest focusable element in direction from current among elements.
Parameters
| Name | Type | Description |
|---|---|---|
current | HTMLElement | |
elements | readonly HTMLElement[] | |
direction | SpatialDirection |
Source: packages/ui/src/behaviors/micro.svelte.ts:529
stack_spans function
function stack_spans<S extends Span>(spans: readonly S[]): readonly (S & { readonly lane: number; readonly lanes: number; })[] Packs overlapping spans on one track into non-overlapping visual lanes (lane index & lanes total).
Parameters
| Name | Type | Description |
|---|---|---|
spans | readonly S[] |
Source: packages/ui/src/behaviors/canvas.svelte.ts:286
step_spring function
function step_spring(state: { readonly position: number; readonly velocity: number; }, target: number, config?: { readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly precision?: number; }, dt?: number): SpringState Advances a 1D damped harmonic spring by dt seconds toward target.
Parameters
| Name | Type | Description |
|---|---|---|
state | { readonly position: number; readonly velocity: number; } |
|
target | number | |
config? | { readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly precision?: number; } | |
dt? | number |
Source: packages/ui/src/behaviors/motion.svelte.ts:76
subtree_end function
function subtree_end(rows: readonly TreeReorderRow[], index: number): number Returns the exclusive index past the subtree rooted at index in a pre-order flat row array.
Parameters
| Name | Type | Description |
|---|---|---|
rows | readonly TreeReorderRow[] | |
index | number |
Source: packages/ui/src/behaviors/drag.svelte.ts:472
supports_hidden_until_found function
function supports_hidden_until_found(): boolean Whether this browser supports find-in-page revelation via hidden="until-found" and beforematch.
Source: packages/ui/src/behaviors/presence.svelte.ts:212
tabbable_elements function
function tabbable_elements(root: HTMLElement): HTMLElement[] Returns all visible, enabled tabbable descendants inside root.
Parameters
| Name | Type | Description |
|---|---|---|
root | HTMLElement |
Source: packages/ui/src/behaviors/focus-trap.svelte.ts:17
text_to_cells function
function text_to_cells(text: string): string[][] Parses tab-separated clipboard text (TSV) into a 2D matrix of strings.
Parameters
| Name | Type | Description |
|---|---|---|
text | string |
Source: packages/ui/src/behaviors/grid.svelte.ts:231
toggle_tree_checked function
function toggle_tree_checked<T>(nodes: readonly TreeNode<T>[], checked: readonly string[], id: string, strategy?: TreeCheckStrategy): string[] Toggles id in a hierarchical tree checkbox model and returns the normalized checked id array for strategy.
Parameters
| Name | Type | Description |
|---|---|---|
nodes | readonly TreeNode<T>[] | |
checked | readonly string[] | |
id | string | |
strategy? | TreeCheckStrategy |
Source: packages/ui/src/behaviors/tree.svelte.ts:168
tree_checked_states function
function tree_checked_states<T>(nodes: readonly TreeNode<T>[], checked: readonly string[], strategy?: TreeCheckStrategy): ReadonlyMap<string, TreeCheckedState> Computes checked / unchecked / 'indeterminate' state for every node in nodes.
Parameters
| Name | Type | Description |
|---|---|---|
nodes | readonly TreeNode<T>[] | |
checked | readonly string[] | |
strategy? | TreeCheckStrategy |
Source: packages/ui/src/behaviors/tree.svelte.ts:129
tree_from_paths function
function tree_from_paths(paths: readonly string[]): TreeNode<{ readonly dir: boolean; readonly path: string; }>[] Builds a sorted directory-first TreeNode[] from slash-delimited file paths (e.g. Studio files).
Parameters
| Name | Type | Description |
|---|---|---|
paths | readonly string[] |
Source: packages/ui/src/behaviors/tree.svelte.ts:60
use_debounce function
function use_debounce<A extends readonly unknown[]>(callback: (...args: A) => void, wait?: number | (() => number)): ((...args: A) => void) & { readonly cancel: () => void; } Debounced callback wrapper with .cancel() support for input-driven queries.
Parameters
| Name | Type | Description |
|---|---|---|
callback | (...args: A) => void | |
wait? | number | (() => number) |
Source: packages/ui/src/behaviors/reactive.svelte.ts:169
primitives
virtual_list function
function virtual_list(o: VirtualOptions): { readonly on: boolean; readonly start: number; readonly end: number; readonly before: number; readonly after: number; slice<T>(items: readonly T[]): readonly T[]; anchor: (el: HTMLElement) => () => void; measure(key: string): Attachment<Element>; reveal(index: number): void; } Windows a long list to the rows in view (measuring each row's height), so a page renders only what is visible; a short list renders whole.
Parameters
| Name | Type | Description |
|---|---|---|
o | VirtualOptions |
|
Source: packages/ui/src/primitives/virtual/virtual.svelte.ts:37
behaviors
watch const
const watch: typeof watch Reactively watches one or more getter sources and invokes callback(current, previous) without tracking reads inside callback. Supports { lazy: true } and watch.pre(...).
Members
| Name | Type | Description |
|---|---|---|
pre | { <T>(source: Getter<T>, callback: WatchCallback<T>, options?: WatchOptions): void; <const S extends readonly Getter<unknown>[]>(source: S, callback: WatchCallback<GetterValues<S>>, options?: WatchOptions): void; } |
Source: packages/ui/src/behaviors/reactive.svelte.ts:70
watch_pre function
function watch_pre<T>(source: Getter<T>, callback: WatchCallback<T>, options?: WatchOptions): void
function watch_pre<const S extends readonly Getter<unknown>[]>(source: S, callback: WatchCallback<GetterValues<S>>, options?: WatchOptions): void Pre-DOM variant of watch backed by $effect.pre.
Parameters
| Name | Type | Description |
|---|---|---|
source | Getter<T> | |
callback | WatchCallback<T> | |
options? | WatchOptions |
Source: packages/ui/src/behaviors/reactive.svelte.ts:89
with_source function
function with_source<T>(source: ChangeSource, fn: () => T): T Runs fn with source attributed to any UI control changes emitted synchronously inside it.
Parameters
| Name | Type | Description |
|---|---|---|
source | ChangeSource | |
fn | () => T |