# bref-ui ## button An action or navigation control with text or icon labels, theme colors, five sizes, three variants, and wide, rounded or disabled options. ```svelte ``` ```svelte
Content
``` Use as to choose a semantic div, section or span. Native attributes, events and children are forwarded. Choose orientation, spacing and dimensions for layout, then variant, color, glass, shadow and radius for appearance. Scroll regions need a constrained parent height and an accessible name. The surface helper provides typed props for reuse. Props: as?: 'div' | 'section' | 'span' = div — Native root element.; children?: Snippet = Omitted — Content rendered directly inside the root.; color?: Color = background — Theme color; the shared recipe supplies content color.; variant?: Variant = neutral — Lightly tinted neutral, opaque tinted soft, or opaque filled panel.; spacing?: Size = Omitted — Shared padding and gap; omitted means zero.; orientation?: Orientation = vertical — Column, or row with centered cross-axis alignment.; width?: Dimension = fill — fill uses 100%; fit hugs content.; height?: Dimension = fit — fit uses natural height; fill uses 100% of a sized parent.; radius?: Size | `${number}rem` | `${number}%` = Omitted (0) — Named corner scale or an explicit rem/percentage radius.; shadow?: BaseSize | boolean = false — Shadow strength; true selects medium.; hover?: BaseSize = Omitted — Optional hover/focus treatment; does not make the root interactive.; scroll?: boolean = false — true sets overflow to auto; otherwise overflow stays visible.; glass?: boolean = false — Enable translucent paint and backdrop blur. ## theme Set up semantic palettes, native styles, surfaces, glass and icon fonts at the app root. ```svelte ``` Render once at the app root. This component emits color-scheme metadata and has no visible control. Pass a reactive mode prop; auto allows the system preference, light and dark force a scheme. Build a labeled native control to update mode. The mode prop is not bindable. Props: mode?: 'light' | 'dark' | 'auto' = auto — light, dark or auto; controls color-scheme metadata. ## checkbox A compact checkbox with clear checked states and native form behavior. ```svelte ``` Wrap in a label or connect a label with for/id. Bind checked; pass indeterminate for a mixed state (not bindable). Native checkbox attributes, form submission, required, disabled and change/input events are preserved. Customize size; keep a visible keyboard focus indicator. Props: size?: Size = medium — Checkbox size from x-small through x-large.; checked?: boolean = false (bindable) — Bind to the checked state. Checkmark motion respects reduced motion and does not delay removing a parent. ## switch A checkbox-based on/off control with native form behavior. ```svelte ``` Use a visible label for the native checkbox. Bind checked for state; name, required, disabled and native events retain form semantics. Children are an optional decorative snippet; keep the control accessible independently of its icon. Customize with scoped CSS and existing theme tokens. Props: checked?: boolean = false (bindable) — Bindable on/off state.; size?: BaseSize = medium — small, medium or large.; children?: Snippet = Omitted — Decorative content rendered inside the thumb. ## progress Show determinate or indeterminate progress, with an optional controlled seek control. ```svelte value = next} label="Playback position" /> ``` Use normalized values from 0 to 1; omit value for indeterminate progress. Provide label for the accessible name. Supplying onSeek switches to a native range control and reports normalized values; update value in the handler. disabled affects seeking. Native attributes/events are forwarded. Customize size and inherited color with CSS. Props: label?: string = — — Optional accessible name of the indicator or seek control.; value?: number = Omitted — Normalized value from 0 to 1. Omit for indeterminate progress.; onSeek?: (value: number) => void = Omitted — Makes progress seekable and emits normalized values on edits.; disabled?: boolean = false — Disables the seek control when present.; size?: BaseSize = medium — Track thickness: small, medium, or large. ## spinner Show loading status or a decorative animated ring. ```svelte ``` ```svelte ``` Provide label to announce loading status; omit it for a decorative ring hidden from assistive technology. Size and color inherit by default. Only label and size are accepted. Customize size or inherited CSS color; motion respects reduced-motion preferences. Props: label?: string = — — Optional screen reader status text; omit for a decorative ring.; size?: Size = Inherited — Matches Icon sizes; omitted size inherits surrounding font size. ## dialog Present modal content with native focus and accessible naming. ```svelte