[]; weekDays: string[]; weekStartsOn: WeekStartsOn; locale: string; fixedWeeks: boolean; modelValue: DateValue \| DateValue[] \| undefined; }` |
### NwCalendarCell
Same component as `NwDatePickerCell`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `date` | `DateValue` | required | The date value for the cell |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCard
Part of [Actions & HUD](../families/actions.md).
`NwCard` and its parts render Reka `Primitive` for a composed content surface. The default card is a `div`, not a button.
```vue title="CardDemo.vue"
{{ plan.name }}
{{ plan.detail }}
{{ plan.price }}
{{ chosen === plan.id ? 'Selected' : 'Choose' }}
Popular
Glass card: blurred translucent fill.
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ------------- | ------------------------------------------------- | ----------- | --------------------------------------------------------- |
| `variant` | `'default' \| 'flat' \| 'glass' \| 'interactive'` | `'default'` | Panel, sunken, blurred translucent, or hover-lift surface |
| `selected` | `boolean` | `false` | Primary edge and glow, and `data-selected` |
| `cut`, `wire` | `boolean` | `false` | Chamfered corners / gradient edge |
| `glow` | `'sm' \| 'md' \| 'lg'` | unset | Primary bloom |
| `as` | `PrimitiveProps['as']` | `'div'` | Root element |
`NwCardTitle` defaults to `h3` and `NwCardDescription` to `p`; choose `as` to fit the document outline. `variant="interactive"` only changes styling and adds a focus ring: when the whole card is actionable, render it `as="a"` or `as="button"` and do not nest other controls. `selected` is visual plus a data attribute; expose the selection on the control that sets it, as the demo does with `aria-pressed`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCard
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"default" \| "flat" \| "glass" \| "interactive"` | | |
| `selected` | `boolean` | | |
| `cut` | `boolean` | | Cut corners on the top-right and bottom-left. |
| `wire` | `boolean` | | Wire gradient edge. |
| `glow` | `NwGlow` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCardContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCardDescription
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"p"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCardFooter
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCardHeader
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCardTitle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"h3"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCheckbox + NwCheckboxGroup
Part of [Forms](../families/forms.md).
`NwCheckbox` composes Reka `CheckboxRoot` and `CheckboxIndicator` in a chamfered box: a check when checked, a dash when indeterminate. `NwCheckboxGroup` wraps `CheckboxGroupRoot` for a collection of selected values.
```vue title="CheckboxDemo.vue"
Enabled: {{ enabled.join(', ') || 'none' }}
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------- | ----------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------- |
| Checkbox `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 16px, 18px or 22px box |
| Checkbox `intent` | `'primary' \| 'secondary' \| 'tertiary' \| 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Checked fill and glow |
| Checkbox `invalid` | `boolean` | `false` | `aria-invalid`, danger edge |
| Checkbox `label` | `string` | unset | Renders a visible label after the box, tied to it by `for` |
| Group `orientation` | `'horizontal' \| 'vertical'` | vertical | Column, or a wrapping row |
Checkbox uses Reka's `modelValue` and `defaultValue`, `'indeterminate'` included, announced as `aria-checked="mixed"`. The demo derives the parent's mixed state from the group: clicking it checks or clears every alert. The default slot replaces the mark and receives Reka's `state`.
Space toggles an enabled checkbox; clicking its label does too. Group items need distinct `value`s. A group's `aria-label` names the set, not each checkbox: give every box a `label`, a wrapping label or an `aria-label`. Disabled checkboxes cannot toggle and their label dims.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCheckbox
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `intent` | `"info" \| "primary" \| "secondary" \| "tertiary" \| "neutral" \| "success" \| "warning" \| "danger"` | | |
| `invalid` | `boolean` | | |
| `label` | `string` | | Renders a visible label after the box. |
| `defaultValue` | `boolean \| "indeterminate"` | | The value of the checkbox when it is initially rendered. |
| `modelValue` | `boolean \| "indeterminate" \| null` | | The controlled value of the checkbox. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the checkbox |
| `value` | `AcceptableValue` | | The value given as data when submitted with a `name`. |
| `id` | `string` | | Id of the element |
| `trueValue` | `boolean` | | The value used when the checkbox is checked. |
| `falseValue` | `boolean` | | The value used when the checkbox is unchecked. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: boolean \| "indeterminate"]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: boolean \| "indeterminate"; state: CheckedState; }` |
### NwCheckboxGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `AcceptableValue[]` | | The value of the checkbox when it is initially rendered. |
| `modelValue` | `AcceptableValue[]` | | The controlled value of the checkbox. |
| `rovingFocus` | `boolean` | | When `false`, navigating through the items using arrow keys will be disabled. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the checkboxes |
| `max` | `number \| null` | | The maximum number of values that can be selected. |
| `dir` | `Direction$5` | | The direction of navigation between items. |
| `orientation` | `Orientation$1` | | The orientation of the group. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | Whether keyboard navigation should loop around |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue[]]` | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwChip
Part of [Actions & HUD](../families/actions.md).
`NwChip` is a removable tag: a `span` with the badge face and, when `removeLabel` is set, a native remove button that emits `remove`.
```vue title="ChipDemo.vue"
item !== region)"
>{{ region }}
pinned
Reset
{{ regions.length }} regions selected
```
| Prop | Type | Default | Effect |
| ------------- | --------- | ----------------------------- | ------------------------------------------------------------ |
| Appearance | see above | `'neutral'`, `'soft'`, `'sm'` | Tone, surface, size and motifs |
| `removeLabel` | `string` | unset | Shows the remove button and names it (`aria-label`, `title`) |
| `disabled` | `boolean` | `false` | Disables the remove button |
The chip does not remove itself: handle `remove` and drop the item from your state. Tab reaches each remove button and Enter or Space activates it. Name each button after its chip (`Remove eu-west`), since several identical "Remove" buttons are ambiguous. For editable tag lists with keyboard entry, use `NwTagsInput` from [Forms](../families/forms.md).
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwChip
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | |
| `variant` | `NwVariant` | | |
| `size` | `NwSize` | | |
| `cut` | `boolean` | | |
| `wire` | `boolean` | | |
| `glow` | `NwGlow` | | |
| `removeLabel` | `string` | | |
| `disabled` | `boolean` | | |
| Event | Payload | Description |
| --- | --- | --- |
| `remove` | `[]` | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCode
Part of [Actions & HUD](../families/actions.md).
`NwCode` renders inline code, or with `block` a `pre` that keeps whitespace and scrolls horizontally.
```vue title="CodeDemo.vue"
Set RELAY_REGION before running nyxwire deploy .
{{ samples[format] }}
Show as {{ format === 'env' ? 'JSON' : '.env' }}
```
| Prop | Type | Default | Effect |
| ------- | --------- | ------- | ----------------------------------------------------------- |
| `block` | `boolean` | `false` | `` block instead of inline `` |
The block is a tab stop so keyboard users can scroll long lines. It does not highlight syntax; for highlighted listings in Astro, use Expressive Code like the source panels on this page.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCode
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `block` | `boolean` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCollapsible
Part of [Navigation](../families/navigation.md).
One section that shows and hides, wrapping Reka `Collapsible`. Use it for optional details; use `NwAccordion` for a set of sections.
```vue title="CollapsibleDemo.vue"
{{ open ? 'Hide' : 'Show' }} raw handshake
initiation 148 B · response 92 B · keepalive every 25 s
```
```text title="Anatomy"
NwCollapsible
├─ NwCollapsibleTrigger
└─ NwCollapsibleContent
```
| Prop | Type | Default | Effect |
| --------------- | --------- | ------- | ---------------------------------------------- |
| `open` | `boolean` | none | Controlled state, `v-model:open` (Reka) |
| `defaultOpen` | `boolean` | `false` | Uncontrolled initial state (Reka) |
| `disabled` | `boolean` | `false` | The trigger stops toggling (Reka) |
| `unmountOnHide` | `boolean` | `true` | Removes the closed content from the DOM (Reka) |
**Keyboard and accessibility.** The trigger is a button with `aria-expanded` and `aria-controls`; Enter or Space toggles it.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCollapsible
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the collapsible when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the collapsible. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the collapsible. |
| `unmountOnHide` | `boolean` | | When `true`, the element will be unmounted on closed state. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwCollapsibleContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `contentFound` | `[(void \| undefined)?]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwCollapsibleTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwColorArea
Part of [Color](../families/color.md).
`NwColorArea` is a two-dimensional picker over two channels of one color space. It wraps Reka `ColorAreaRoot`, `ColorAreaArea` and `ColorAreaThumb`. The default slot holds the thumb and renders `NwColorAreaThumb` when it is empty.
```vue title="ColorAreaDemo.vue"
```
```text title="Anatomy"
NwColorArea
└─ NwColorAreaThumb (default slot content)
```
| Prop | Type | Default | Effect |
| ---------------- | ------------------------- | -------------- | ----------------------------------------- |
| `modelValue` | `string \| Color` | none | Controlled color, `v-model` |
| `defaultValue` | `string \| Color` | `'#ff0000'` | Uncontrolled starting color (Reka) |
| `colorSpace` | `ColorSpace` | `'hsl'` | Color space the channels belong to (Reka) |
| `xChannel` | `ColorChannel` | `'hue'` | Channel on the horizontal axis (Reka) |
| `yChannel` | `ColorChannel` | `'saturation'` | Channel on the vertical axis (Reka) |
| `disabled` | `boolean` | `false` | Blocks interaction and dims the area |
| `xName`, `yName` | `string` | none | Input names for form submission (Reka) |
| `class` | `HTMLAttributes['class']` | none | Merged onto the root |
The other Reka `ColorAreaRoot` props and emits pass through. The area is 12rem tall and fills its container's width.
**Keyboard.** The thumb is the focusable control, and the arrow keys move it along both axes. Give the area an `aria-label` that names both channels.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorArea
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string \| Color` | | The color value (controlled). |
| `defaultValue` | `string \| Color` | | The default color value (uncontrolled). |
| `colorSpace` | `ColorSpace` | | The color space to operate in. |
| `xChannel` | `ColorChannel` | | Color channel for the horizontal (x) axis. |
| `yChannel` | `ColorChannel` | | Color channel for the vertical (y) axis. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the area. |
| `xName` | `string` | | The name of the x channel input element for form submission. |
| `yName` | `string` | | The name of the y channel input element for form submission. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| `update:color` | `[value: Color]` | |
| `change` | `[value: string]` | |
| `changeEnd` | `[value: string]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwColorAreaThumb
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwColorField
Part of [Color](../families/color.md).
`NwColorField` is a text input for a color, wrapping Reka `ColorFieldRoot` and `ColorFieldInput`. Without `channel` it edits the hex value. With `channel` it edits that one number. The text uses the mono font with tabular figures, and the field shows a wire edge when focused.
```vue title="ColorFieldDemo.vue"
Status light hue
{{ status }}
```
| Prop | Type | Default | Effect |
| ------------- | ------------------------- | --------------- | ------------------------------------------------ |
| `modelValue` | `string \| Color` | none | Controlled color, `v-model` |
| `channel` | `ColorChannel` | none | Edit one channel instead of the hex value (Reka) |
| `colorSpace` | `ColorSpace` | `'hsl'` | Space of `channel` (Reka) |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input height 2rem, 2.5rem or 3rem |
| `label` | `string` | `'Color value'` | `aria-label` of the input |
| `invalid` | `boolean` | `false` | Sets `aria-invalid` and the danger edge |
| `disabled` | `boolean` | `false` | Disables the input |
| `readonly` | `boolean` | `false` | Read-only input (Reka) |
| `placeholder` | `string` | none | Placeholder when empty (Reka) |
| `class` | `HTMLAttributes['class']` | none | Merged onto the input |
The other Reka `ColorFieldRoot` props and emits pass through. Other attributes, such as `id` or `aria-describedby`, go to the input, so an outer `` can target it.
**Keyboard and accessibility.** The value is parsed when the input commits, on Enter or blur. Invalid text is rejected and the previous color stays; channel values are clamped to their range. ArrowUp and ArrowDown step the value. Point an error message at the input with `aria-describedby` and set `invalid`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `label` | `string` | `"Color value"` | |
| `invalid` | `boolean` | | |
| `modelValue` | `string \| Color` | | The color value (controlled). |
| `defaultValue` | `string \| Color` | | The default color value (uncontrolled). |
| `colorSpace` | `ColorSpace` | | The color space to operate in when displaying a channel. |
| `channel` | `ColorChannel` | | The color channel to display. |
| `placeholder` | `string` | | Placeholder text when the field is empty. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the field. |
| `readonly` | `boolean` | | When `true`, the field is read-only. |
| `disableWheelChange` | `boolean` | | When `true`, prevents the value from changing on wheel scroll. |
| `locale` | `string` | | The locale to use for number formatting. |
| `step` | `number` | | Custom step value for increment/decrement. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| `update:color` | `[value: Color]` | |
# NwColorPicker
Part of [Color](../families/color.md).
`NwColorPicker` is a complete picker behind one button. The button opens a Reka `Popover` with a saturation and brightness area, hue and opacity sliders, a hex field and a row of presets. The button shows a swatch of the current color.
Without `presets`, the picker offers the twelve accents of the active flavor (indigo to steel), read from `@nyxwire/palette`, and the row follows the flavor scoped by the nearest `NwProvider`. The popover content carries that provider's `data-flavor` and `data-accent`, so a scoped island keeps its flavor even though the popover is portalled to ``.
```vue title="ColorPickerDemo.vue"
{{ signal }}
```
```text title="Anatomy (rendered for you)"
NwColorPicker
├─ trigger: NwColorSwatch + label (default slot, receives { value })
└─ popover content
├─ title + close button
├─ NwColorArea (hsb: saturation × brightness)
├─ NwColorSlider channel="hue"
├─ NwColorSlider channel="alpha"
├─ NwColorField (hex)
└─ NwColorSwatchPicker of presets (the flavor accents unless `presets` is set)
```
| Prop | Type | Default | Effect |
| -------------- | ------------------------------ | ---------------------- | ------------------------------------------------------------------------- |
| `modelValue` | `string \| Color` | none | Current color; `v-model` emits a string in `format` |
| `defaultValue` | `string \| Color` | pure red | Uncontrolled starting color; without it the picker starts at hsl 0 100 50 |
| `format` | `ColorFormat` | `'hex'` | Format of the emitted string, such as `'hex'` or `'hsl'` |
| `label` | `string` | `'Choose color'` | Trigger text, accessible name and popover title |
| `presets` | `readonly { value; label? }[]` | flavor accents | Swatches under the field; `[]` hides the row |
| `disabled` | `boolean` | `false` | Disables the trigger and every control |
| `open` | `boolean` | none | Controlled open state, `v-model:open` |
| `defaultOpen` | `boolean` | `false` | Uncontrolled initial open state |
| `closeLabel` | `string` | `'Close color picker'` | Accessible name of the close button |
| `class` | `HTMLAttributes['class']` | none | Merged onto the trigger |
Emits `update:modelValue` (a string) and `update:open` (a boolean). Other attributes go to the trigger button. `NwColorPreset` is exported as the type of one preset.
**Keyboard and accessibility.** The trigger is a button named by `label`. Opening the picker moves focus into the popover, which keeps a 16px collision padding from the viewport edge. Escape or the close button closes it and returns focus to the trigger. The area, sliders, field and presets work from the keyboard as described in the sections below.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorPicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string \| Color` | | |
| `defaultValue` | `string \| Color` | | |
| `format` | `ColorFormat` | `"hex"` | |
| `label` | `string` | `"Choose color"` | |
| `disabled` | `boolean` | | |
| `presets` | `readonly NwColorPreset[]` | | |
| `open` | `boolean` | `undefined` | |
| `defaultOpen` | `boolean` | | |
| `closeLabel` | `string` | `"Close color picker"` | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ value: string; }` |
# NwColorSlider
Part of [Color](../families/color.md).
`NwColorSlider` shows one channel of a color on a gradient track and wraps Reka `ColorSliderRoot` and `ColorSliderThumb`. The track paints the channel gradient over a checkerboard, so you can see the alpha channel.
```vue title="ColorSliderDemo.vue"
{{ trace }}
{{ item.label }}
```
| Prop | Type | Default | Effect |
| -------------- | ---------------------------- | -------------- | ------------------------------------------------------ |
| `channel` | `ColorChannel` | required | `'hue'`, `'saturation'`, `'lightness'`, `'alpha'`, … |
| `modelValue` | `string \| Color` | none | Controlled color, `v-model` |
| `defaultValue` | `string \| Color` | `'#000000'` | Uncontrolled starting color (Reka) |
| `colorSpace` | `ColorSpace` | `'hsl'` | Color space of `channel` (Reka) |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Vertical sliders are 10rem tall; the gradient follows |
| `inverted` | `boolean` | `false` | Reverses the axis (Reka) |
| `dir` | `'ltr' \| 'rtl'` | provider `dir` | Reading direction; the gradient flips in right-to-left |
| `step` | `number` | channel step | Keyboard step (Reka) |
| `label` | `string` | none | `aria-label` of the thumb, the focusable control |
| `disabled` | `boolean` | `false` | Blocks interaction and dims the slider |
| `class` | `HTMLAttributes['class']` | none | Merged onto the root |
The other Reka `ColorSliderRoot` props and emits pass through. Reka 2.11 always draws a left-to-right gradient. `NwColorSliderTrack` keeps Reka's colors and checkerboard but points the gradient along the slider's actual axis, so vertical, inverted and right-to-left sliders show the right colors under the thumb. It is exported for custom slider layouts.
**Keyboard.** Arrow keys change the channel by `step`, and Home and End jump to the ends. The thumb has the `slider` role and reports its orientation. Set `label` so it has a name.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorSlider
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | | |
| `modelValue` | `string \| Color` | | The color value (controlled). |
| `defaultValue` | `string \| Color` | | The default color value (uncontrolled). |
| `colorSpace` | `ColorSpace` | | The color space to operate in. |
| `channel` | `ColorChannel` | required | The color channel that this slider manipulates. |
| `orientation` | `DataOrientation` | | The orientation of the slider. |
| `dir` | `Direction` | | The reading direction of the slider. |
| `inverted` | `boolean` | | Whether the slider is visually inverted. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the slider. |
| `step` | `number` | | Custom step value for increment/decrement. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string \| Color]` | |
| `update:color` | `[value: Color]` | |
| `change` | `[value: string]` | |
| `changeEnd` | `[value: string]` | |
### NwColorSliderTrack
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `dir` | `Direction` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwColorSwatchPicker
Part of [Color](../families/color.md).
`NwColorSwatchPicker` is a grid of preset swatches with one selected. It wraps Reka `ColorSwatchPickerRoot` (a listbox) and `ColorSwatchPickerItem`. Each item is a 2.75rem cut-corner tile. Its chamfered edge lights up in the primary color and glows when the item is selected, and a check badge appears in the corner. The grid fits as many 2.75rem columns as its width allows.
```vue title="ColorSwatchPickerDemo.vue"
{{ teamLabel }} {{ team }}
```
```text title="Anatomy"
NwColorSwatchPicker
└─ NwColorSwatchPickerItem (one per preset)
```
| Part | Prop | Type | Default | Effect |
| ------------------------- | -------------- | ------------------------- | ----------- | -------------------------------------------- |
| `NwColorSwatchPicker` | `modelValue` | `string \| string[]` | none | Selected color, `v-model` |
| | `defaultValue` | `string \| string[]` | none | Uncontrolled selection |
| | `disabled` | `boolean` | `false` | Disables every item |
| | `class` | `HTMLAttributes['class']` | none | Merged onto the grid |
| `NwColorSwatchPickerItem` | `value` | `string` | required | The color, a hex string |
| | `label` | `string` | none | Accessible name of the option and its swatch |
| | `shape` | `'rounded' \| 'square'` | `'rounded'` | Swatch shape |
The picker accepts Reka's other listbox props (`multiple`, `orientation`, …), except `by`. An item's default slot receives `{ selected }` and replaces the swatch and the check.
**Keyboard and accessibility.** Give the picker an `aria-label`. Arrow keys move between swatches and select them, updating `v-model`. The grid shows a focus ring when it has focus, and the highlighted item takes the bright line color.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorSwatchPicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string \| string[]` | | The value of the listbox when initially rendered. |
| `modelValue` | `string \| string[]` | | The controlled value of the listbox. |
| `multiple` | `boolean` | | Whether multiple options can be selected or not. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with listbox |
| `dir` | `Direction` | | The reading direction of the listbox when applicable. |
| `orientation` | `DataOrientation` | | The orientation of the listbox. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `highlightOnHover` | `boolean` | | When `true`, hover over item will trigger highlight |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `selectionBehavior` | `"replace" \| "toggle"` | | How multiple selection should behave in the collection. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue]` | |
| `highlight` | `[payload: { ref: HTMLElement; value: AcceptableValue; } \| undefined]` | |
| `entryFocus` | `[event: CustomEvent]` | |
| `leave` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string \| string[] \| undefined; }` |
### NwColorSwatchPickerItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | | |
| `shape` | `"square" \| "rounded"` | | |
| `value` | `string` | required | The color to display in the swatch as a hex string. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent$3]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ selected: boolean; }` |
# NwColorSwatch
Part of [Color](../families/color.md).
`NwColorSwatch` previews one color over a checkerboard and cannot be interacted with. It wraps Reka `ColorSwatch`, which gives it `role="img"` and a name derived from the color unless you pass `label`.
```vue title="ColorSwatchDemo.vue"
```
| Prop | Type | Default | Effect |
| ------- | ------------------------- | ----------- | ------------------------------ |
| `color` | `string \| Color` | none | Color to show (Reka) |
| `label` | `string` | color name | Accessible name (Reka) |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 1.5rem, 2rem or 2.75rem square |
| `shape` | `'rounded' \| 'square'` | `'rounded'` | Corner radius |
| `class` | `HTMLAttributes['class']` | none | Merged onto the root |
The default slot renders over the color, for a badge or an icon.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwColorSwatch
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `shape` | `"square" \| "rounded"` | | |
| `color` | `string \| Color` | | The color to display in the swatch as a hex string or Color object. |
| `label` | `string` | | Optional accessible label for the color. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCombobox
Part of [Selection](../families/selection.md).
`NwCombobox` wraps Reka `ComboboxRoot` so the user can search item text to choose a value. The model holds the selected item, or the selected items with `multiple`. The search text in the input is separate.
```vue title="ComboboxDemo.vue"
Reachable
{{
node
}}
Offline
Ice relay
No matching endpoints.
Endpoint: {{ endpoint ?? 'None' }}
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| --------------------- | ---------------------------------- | ------------------- | -------------------------------------------------------- |
| Root `class` | `HTMLAttributes['class']` | unset | Merged root styling; other props are `ComboboxRootProps` |
| Input `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input height and padding |
| Input `invalid` | `boolean` | `false` | Danger edge and `aria-invalid` |
| Trigger `label` | `string` | `'Show options'` | Accessible name of the chevron button |
| Cancel `label` | `string` | `'Clear selection'` | Accessible name of the clear button |
| Content `position` | `ComboboxContentProps['position']` | `'popper'` | Popup positioning mode |
| Content `sideOffset` | `number` | `4` | Distance from the anchor |
| Content `align` | `ComboboxContentProps['align']` | `'start'` | Popup alignment |
| Content `portalProps` | `ComboboxPortalProps` | unset | Portal configuration |
For several selections, set `multiple` on the root and use an array model. Items filter on their text, and `NwComboboxEmpty` shows when nothing matches. Selected items show a check. Items under a disabled root carry `aria-disabled`.
**Keyboard and accessibility.** Label the input. When several comboboxes share a page, give each clear and show button its own name. ArrowDown opens the list and moves through it, and Enter selects the highlighted item. Escape closes the list and keeps focus on the input. The input exposes `aria-expanded`, and items expose their selected and disabled states.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCombobox
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` | | The controlled open state of the Combobox. |
| `defaultOpen` | `boolean` | | The open state of the combobox when it is initially rendered. |
| `resetSearchTermOnBlur` | `boolean` | | Whether to reset the searchTerm when the Combobox input blurred |
| `resetSearchTermOnSelect` | `boolean` | | Whether to reset the searchTerm when the Combobox value is selected |
| `openOnFocus` | `boolean` | | Whether to open the combobox when the input is focused |
| `openOnClick` | `boolean` | | Whether to open the combobox when the input is clicked |
| `ignoreFilter` | `boolean` | | When `true`, disable the default filters |
| `resetModelValueOnClear` | `boolean` | | When `true` the `modelValue` will be reset to `null` (or `[]` if `multiple`) |
| `unmountOnHide` | `boolean` | | When set to `false`, the Combobox content will not be unmounted when closed, but instead hidden with CSS. |
| `multiple` | `boolean` | | Whether multiple options can be selected or not. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with listbox |
| `dir` | `Direction` | | The reading direction of the listbox when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the listbox. |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The value of the listbox when initially rendered. |
| `name` | `string` | | The name of the field. |
| `by` | `string \| ((a: AcceptableValue, b: AcceptableValue) => boolean)` | | Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `highlightOnHover` | `boolean` | | When `true`, hover over item will trigger highlight |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue]` | |
| `update:open` | `[value: boolean]` | |
| `highlight` | `[payload: { ref: HTMLElement; value: AcceptableValue; } \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; modelValue: string \| number \| bigint \| Record \| (string \| number \| bigint \| Record \| null)[] \| null; }` |
### NwComboboxAnchor
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `reference` | `ReferenceElement` | | The reference (or anchor) element that is being referred to for positioning. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxCancel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Clear selection"` | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `portalProps` | `ComboboxPortalProps` | | |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `position` | `"popper" \| "inline"` | `"popper"` | The positioning mode to use, `inline` is the default and you can control the position using CSS. |
| `bodyLock` | `boolean` | | The document.body will be lock, and scrolling will be disabled. |
| `hideWhenEmpty` | `boolean` | | When `true`, hides the content when there are no items matching the filter. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | `"start"` | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `dir` | `Direction` | | The reading direction of the popper content when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxEmpty
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `displayValue` | `((val: any) => string)` | | The display value of input for selected item. |
| `modelValue` | `string` | | The controlled value of the filter. |
| `autoFocus` | `boolean` | | Focus on element when mounted. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[string]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `textValue` | `string` | | A string representation of the item contents. |
| `value` | `AcceptableValue` | required | The value given as data when submitted with a `name`. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent$3]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ selected: boolean; }` |
### NwComboboxLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `for` | `string` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwComboboxSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwComboboxTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Show options"` | |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwCommandPalette
Part of [Overlays & menus](../families/overlays.md).
A Nyxwire-only composite: a dialog with a search field over a filtered list of commands, built from `NwDialog` parts and Reka `Listbox`. Every word typed must match the command's label or one of its `keywords`. Picking a command closes the palette and emits `select` with its value.
```vue title="CommandPaletteDemo.vue"
command.value === $event)?.label ?? $event"
/>
Ran: {{ ran }}
```
```text title="Anatomy"
NwCommandPalette
├─ trigger (outline button from trigger-label, or the trigger slot)
└─ NwDialogContent
├─ NwDialogHeader (title, description)
└─ NwDialogBody
├─ search field (combobox)
├─ results (listbox of commands)
└─ empty status
```
| Prop | Type | Default | Effect |
| -------------- | ---------------------- | -------------------------------- | ---------------------------------------------------------------------- |
| `commands` | `readonly NwCommand[]` | required | `{ value, label, disabled?, keywords? }` entries |
| `open` | `boolean` | `false` | `v-model:open`; the query is cleared when the palette closes |
| `title` | `string` | `'Command palette'` | Dialog title, also the name of the results list |
| `description` | `string` | `'Search for a command to run.'` | Dialog description |
| `triggerLabel` | `string` | none | Renders an outline trigger button; without it and the slot, no trigger |
| `searchLabel` | `string` | `'Search commands'` | Accessible name and placeholder of the search field |
| `emptyText` | `string` | `'No matching commands'` | Status text when nothing matches |
Emits `select` with the chosen command's `value`. Without a trigger, open it from your own shortcut by binding `v-model:open`.
**Keyboard and accessibility.** The search field is a `combobox` that controls the results `listbox`. ArrowDown and ArrowUp move through the results, skipping disabled commands, and Enter runs the highlighted one. The empty message is a `status`, so screen readers announce it. Escape closes the dialog and returns focus to the trigger.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwCommandPalette
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `commands` | `readonly NwCommand[]` | required | |
| `title` | `string` | `"Command palette"` | |
| `description` | `string` | `"Search for a command to run."` | |
| `triggerLabel` | `string` | | Renders an outline trigger button with this label (or use the `trigger` slot). |
| `searchLabel` | `string` | `"Search commands"` | |
| `emptyText` | `string` | `"No matching commands"` | |
| `open` | `boolean` | `false` | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| `select` | `[value: string]` | |
| Slot | Props |
| --- | --- |
| `trigger` | |
# NwContextMenu
Part of [Overlays & menus](../families/overlays.md).
The same menu opened by a right-click (or a long press) on an area, wrapping Reka `ContextMenu`. Its parts mirror the dropdown's under `NwContextMenu*` names, with `NwContextMenuTrigger` as the area.
```vue title="ContextMenuDemo.vue"
Right-click this node tile
Node hel-01
Ping
P
Copy
Address
Key fingerprint
Mute alerts
Isolate
Last action: {{ last }} · muted: {{ muted }}
```
```text title="Anatomy"
NwContextMenu
├─ NwContextMenuTrigger (the area that listens for right-click)
└─ NwContextMenuContent
└─ same items as NwDropdownMenuContent, prefixed NwContextMenu
```
The props match the dropdown menu's: `modal` defaults to `false`; content and sub content take `variant`; items take `intent` and `inset`; labels and sub triggers take `inset`; sub content defaults to `sideOffset` 4 and `alignOffset` -5. The content itself opens at the pointer, so it has no `sideOffset` default.
**Keyboard.** The menu opens next to the pointer. ArrowDown focuses the first item, Enter selects, ArrowRight and ArrowLeft open and close submenus, Escape closes. A right-click has no keyboard equivalent on every platform, so offer every context action somewhere else as well.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwContextMenu
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pressOpenDelay` | `number` | | The duration from when the trigger is pressed until the menu opens. |
| `open` | `boolean` | | The controlled open state of the menu. |
| `dir` | `Direction$4` | | The reading direction of the combobox when applicable. |
| `modal` | `boolean` | `false` | The modality of the dropdown menu. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[payload: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuCheckboxItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `CheckedState` | | The controlled checked state of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: boolean]` | |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: CheckedState; modelValue: CheckedState; }` |
### NwContextMenuContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `"default" \| "danger"` | | `danger` paints destructive items in the danger ink. |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent to line up with checkbox and radio items. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuRadioGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `AcceptableValue` | | The value of the selected item in the group. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuRadioItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The unique value of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: boolean; }` |
### NwContextMenuSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwContextMenuShortcut
Same component as `NwDropdownMenuShortcut`, `NwMenubarShortcut`.
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuSub
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the submenu when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the menu. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[payload: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwContextMenuSubContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `alignOffset` | `number` | `-5` | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| `entryFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuSubTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `graceDuration` | `number` | | How long (in milliseconds) the pointer is given to reach the submenu after leaving the trigger. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwContextMenuTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | | When `true`, the context menu would not open when right-clicking. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwDataTable
Part of [Actions & HUD](../families/actions.md).
`NwDataTable` builds an `NwTable` from typed rows and column accessors and sorts them itself. Sortable headings become buttons; clicking one sorts ascending, then toggles the direction.
```vue title="DataTableDemo.vue"
{{
row.state
}}
{{ column.cell(row) }}
{{
sort ? `sorted by ${sort.key}, ${sort.direction}` : 'unsorted'
}}
```
| Prop | Type | Default | Effect |
| ----------------------------- | -------------------------------- | ----------- | -------------------------------------------------------- |
| `caption` | `string` | required | Caption and region name |
| `rows` | `readonly Row[]` | required | Data, never mutated |
| `columns` | `readonly NwColumn[]` | required | `key`, `label`, `cell(row)`, `sortable`, `compare(a, b)` |
| `rowKey` | `(row: Row) => string \| number` | required | Stable key of each row |
| `v-model:sort` | `NwSort` (`{ key, direction }`) | unset | Active sort; unset keeps the input order |
| `emptyText` | `string` | `'No rows'` | Single cell shown when `rows` is empty |
| `striped`, `hover`, `compact` | `boolean` | `false` | Forwarded to `NwTable` |
The `cell` slot receives `{ row, column }` to render rich cells, such as the demo's badges. Without `compare`, numbers sort numerically and strings with a numeric-aware `localeCompare`. Sorted headings carry `aria-sort`; unsorted sortable ones read `none`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDataTable
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `caption` | `string` | required | |
| `rows` | `readonly Row[]` | required | |
| `columns` | `readonly NwColumn[]` | required | |
| `rowKey` | `(row: Row) => string \| number` | required | |
| `emptyText` | `string` | `"No rows"` | |
| `striped` | `boolean` | | |
| `hover` | `boolean` | | |
| `compact` | `boolean` | | |
| `sort` | `NwSort` | | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:sort` | `[value: NwSort \| undefined]` | |
| Slot | Props |
| --- | --- |
| `cell` | `{ row: Row; column: NwColumn; }` |
# NwDateField
Part of [Date & time](../families/datetime.md).
`NwDateField` wraps Reka `DateFieldRoot` and renders one `NwDateFieldInput` per segment, in the order the provider's locale uses. The field gets a wire edge while one of its segments has focus.
```vue title="DateFieldDemo.vue"
Expiry: {{ value?.toString() ?? 'none' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------- | ---------------------- | ------- | ------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Invalid appearance and `aria-invalid` |
| `modelValue` | `DateValue \| null` | unset | Controlled date |
| `defaultValue` | `DateValue` | unset | Initial date |
| `minValue`, `maxValue` | `DateValue` | unset | Valid bounds |
| `disabled`, `readonly` | `boolean` | `false` | Prevent interaction / editing |
The other `DateFieldRootProps` and emits pass through. The value is emitted only when every segment is filled.
**Keyboard and accessibility.** Give the field an `aria-label` or connect a label. Tab and the arrow keys move between segments. ArrowUp and ArrowDown step the focused segment, typing digits replaces it, and Backspace clears it. The locale decides the segment order. Disabled and read-only fields cannot be edited.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDateField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `defaultValue` | `DateValue` | | The default value for the calendar |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what month to display when no date is selected. |
| `modelValue` | `DateValue \| null` | | The controlled value of the field. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `stepSnapping` | `boolean` | | Whether to enforce snapping the time value to the nearest step increment after input. |
| `granularity` | `Granularity` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether or not the date field is disabled |
| `readonly` | `boolean` | | Whether or not the date field is readonly |
| `isDateUnavailable` | `Matcher` | | A function that returns whether or not a date is unavailable |
| `id` | `string` | | Id of the element |
| `dir` | `Direction` | | The reading direction of the date field when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateValue \| undefined]` | |
| `update:placeholder` | `[date: DateValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: DateValue \| undefined; segments: { part: SegmentPart; value: string; }[]; isInvalid: boolean; }` |
# NwDatePicker
Part of [Date & time](../families/datetime.md).
`NwDatePicker` wraps Reka `DatePickerRoot`. It renders a segmented field with a calendar button and opens a portalled calendar dialog from that button.
```vue title="DatePickerDemo.vue"
Launch: {{ value?.toString() ?? 'none' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------------- | ---------------------- | ----------------- | ------------------------------------ |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Field `aria-invalid` and styling |
| `label` | `string` | `'Date'` | Field and dialog name |
| `triggerLabel` | `string` | `'Open calendar'` | Trigger name |
| `modelValue`, `defaultValue` | `DateValue` | unset | Controlled / initial selection |
| `closeOnSelect` | `boolean` | `false` | Close after selection |
| `defaultOpen`, `modal` | `boolean` | `false` | Initial popup state / modal behavior |
| `numberOfMonths` | `number` | `1` | Calendar month count |
The other `DatePickerRootProps` and emits pass through, including `v-model:open`, the bounds and the unavailable-date matchers. The popup calendar disables days outside its current view. `NwDatePickerContent` defaults to `align="start"` and an 8px `sideOffset`, and it takes its name from `label`. `NwDatePickerRoot`, `NwDatePickerArrow` and `NwDatePickerClose` (named "Close calendar") are exported for your own compositions.
**Keyboard and accessibility.** The field segments can be edited directly. The calendar button is named by `trigger-label` and opens a portalled `dialog` named by `label`. Inside it, the calendar keys apply. Escape closes the dialog and returns focus to the button. With `close-on-select`, picking a date emits it and closes the dialog.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDatePicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `label` | `string` | `"Date"` | |
| `triggerLabel` | `string` | `"Open calendar"` | |
| `disabled` | `boolean` | | Whether or not the date field is disabled |
| `dir` | `Direction` | | The reading direction of the date field when applicable. |
| `modelValue` | `DateValue \| null` | | The controlled value of the field. |
| `defaultValue` | `DateValue` | | The default value for the calendar |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what month to display when no date is selected. |
| `id` | `string` | | Id of the element |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `readonly` | `boolean` | | Whether or not the date field is readonly |
| `isDateUnavailable` | `Matcher` | | A function that returns whether or not a date is unavailable |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `stepSnapping` | `boolean` | | Whether to enforce snapping the time value to the nearest step increment after input. |
| `granularity` | `Granularity` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `defaultOpen` | `boolean` | | The open state of the popover when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the popover. |
| `modal` | `boolean` | | The modality of the popover. |
| `pagedNavigation` | `boolean` | | This property causes the previous and next buttons to navigate by the number of months displayed at once, rather than one month |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `weekStartsOn` | `WeekStartsOn` | | The day of the week to start the calendar on |
| `weekdayFormat` | `WeekDayFormat` | | The format to use for the weekday strings provided via the weekdays slot prop |
| `fixedWeeks` | `boolean` | | Whether or not to always display 6 weeks in the calendar |
| `numberOfMonths` | `number` | | The number of months to display at once |
| `isDateDisabled` | `Matcher` | | A function that returns whether or not a date is disabled |
| `closeOnSelect` | `boolean` | | Whether or not to close the popover on date select |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateValue \| undefined]` | |
| `update:open` | `[value: boolean]` | |
| `update:placeholder` | `[date: DateValue]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDatePickerCell
Same component as `NwCalendarCell`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `date` | `DateValue` | required | The date value for the cell |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwDateRangeField
Part of [Date & time](../families/datetime.md).
`NwDateRangeField` wraps Reka `DateRangeFieldRoot`. It renders the start segments, a decorative en dash, then the end segments.
```vue title="DateRangeFieldDemo.vue"
Lease: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------- | ---------------------- | ---------------------------------- | ------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Invalid appearance and `aria-invalid` |
| `modelValue` | `DateRange \| null` | uncontrolled | Controlled endpoints |
| `defaultValue` | `DateRange` | unset (empty endpoints internally) | Initial range |
| `minValue`, `maxValue` | `DateValue` | unset | Date bounds |
| `disabled`, `readonly` | `boolean` | `false` | Interaction / editing lock |
The other `DateRangeFieldRootProps` and emits pass through. You can edit each endpoint without touching the other.
**Keyboard and accessibility.** Name the range as a whole. If you compose the inputs yourself, keep `type="start"` and `type="end"` on them and let Reka move focus between segments. The dash is hidden from assistive technology.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDateRangeField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `defaultValue` | `DateRange` | | The default value for the calendar |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what month to display when no date is selected. |
| `modelValue` | `DateRange \| null` | | The controlled value of the field. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `granularity` | `Granularity` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether or not the date field is disabled |
| `readonly` | `boolean` | | Whether or not the date field is readonly |
| `isDateUnavailable` | `Matcher` | | A function that returns whether or not a date is unavailable |
| `id` | `string` | | Id of the element |
| `dir` | `Direction` | | The reading direction of the date field when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateRange]` | |
| `update:placeholder` | `[date: DateValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: DateRange \| null; segments: { start: { part: SegmentPart; value: string; }[]; end: { part: SegmentPart; value: string; }[]; }; isInvalid: boolean; }` |
# NwDateRangePicker
Part of [Date & time](../families/datetime.md).
`NwDateRangePicker` wraps Reka `DateRangePickerRoot`. It renders a field with both endpoints and opens a portalled range calendar.
```vue title="DateRangePickerDemo.vue"
Window: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------- | ---------------------- | -------------------------------------- | ------------------------------------ |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Field `aria-invalid` and styling |
| `label` | `string` | `'Date range'` | Field and dialog name |
| `triggerLabel` | `string` | `'Open calendar'` | Trigger name |
| `modelValue` | `DateRange` | uncontrolled | Selected endpoints |
| `defaultValue` | `DateRange` | `{ start: undefined, end: undefined }` | Initial endpoints |
| `closeOnSelect` | `boolean` | `false` | Close on completed selection |
| `numberOfMonths` | `number` | `1` | Visible months |
| `defaultOpen`, `modal` | `boolean` | `false` | Initial popup state / modal behavior |
The other `DateRangePickerRootProps` and emits pass through. The popup calendar disables days outside its current view, and its content defaults to `align="start"` and an 8px `sideOffset`. `NwDateRangePickerClose` adds an explicit close button for compositions that need one. On a narrow layout, keep `number-of-months` at 1.
**Keyboard and accessibility.** Each endpoint's segments can be edited directly. The trigger opens a portalled dialog named by `label`. Escape closes it and returns focus to the trigger. Keep `type="start"` and `type="end"` on the inputs when you compose them yourself.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDateRangePicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `label` | `string` | `"Date range"` | |
| `triggerLabel` | `string` | `"Open calendar"` | |
| `disabled` | `boolean` | | Whether or not the date field is disabled |
| `dir` | `Direction` | | The reading direction of the date field when applicable. |
| `modelValue` | `DateRange \| null` | | The controlled value of the field. |
| `defaultValue` | `DateRange` | | The default value for the calendar |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what month to display when no date is selected. |
| `id` | `string` | | Id of the element |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `readonly` | `boolean` | | Whether or not the date field is readonly |
| `isDateUnavailable` | `Matcher` | | A function that returns whether or not a date is unavailable |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `granularity` | `Granularity` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `defaultOpen` | `boolean` | | The open state of the popover when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the popover. |
| `modal` | `boolean` | | The modality of the popover. |
| `pagedNavigation` | `boolean` | | This property causes the previous and next buttons to navigate by the number of months displayed at once, rather than one month |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `weekStartsOn` | `WeekStartsOn` | | The day of the week to start the calendar on |
| `weekdayFormat` | `WeekDayFormat` | | The format to use for the weekday strings provided via the weekdays slot prop |
| `fixedWeeks` | `boolean` | | Whether or not to always display 6 weeks in the calendar |
| `numberOfMonths` | `number` | | The number of months to display at once |
| `isDateDisabled` | `Matcher` | | A function that returns whether or not a date is disabled |
| `isDateHighlightable` | `Matcher` | | A function that returns whether or not a date is hightable |
| `allowNonContiguousRanges` | `boolean` | | When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. |
| `fixedDate` | `"end" \| "start"` | | Which part of the range should be fixed |
| `maximumDays` | `number` | | The maximum number of days that can be selected in a range |
| `closeOnSelect` | `boolean` | | Whether or not to close the popover on range select |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateRange]` | |
| `update:open` | `[value: boolean]` | |
| `update:placeholder` | `[date: DateValue]` | |
| `update:startValue` | `[date: DateValue \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: DateRange; open: boolean; }` |
### NwDateRangePickerCell
Same component as `NwRangeCalendarCell`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `date` | `DateValue` | required | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwDialog
Part of [Overlays & menus](../families/overlays.md).
A modal window for a focused task, wrapping Reka `Dialog`. `NwDialogContent` renders the portal, a blurred backdrop and a cut-corner panel with a wire hairline along its top edge, plus a close button in the top-end corner.
```vue title="DialogDemo.vue"
Review failover
Fail over relay fra-02
Traffic moves to ams-01 while fra-02 drains its sessions.
312 sessions reconnect within 40 seconds. Latency for eu-central rises by about 9 ms
until fra-02 is back.
Postpone
Start failover
{{ answer }}
```
```text title="Anatomy"
NwDialog
├─ NwDialogTrigger
└─ NwDialogContent
├─ NwDialogHeader
│ ├─ NwDialogTitle
│ └─ NwDialogDescription
├─ NwDialogBody
└─ NwDialogFooter
└─ NwDialogClose
```
| `NwDialogContent` prop | Type | Default | Effect |
| ---------------------- | ---------------------------------------- | --------- | ---------------------------------------------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | Maximum width 24rem, 32rem, 48rem, 64rem, or the whole viewport without cuts |
| `showClose` | `boolean` | `true` | Renders the icon close button |
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
| `class` | `HTMLAttributes['class']` | none | Merged onto the panel |
`NwDialog` takes Reka's `open`, `defaultOpen` and `modal`. The other Reka `DialogContent` props and emits (`@escape-key-down`, `@pointer-down-outside`, …) pass through. The body scrolls on its own when the panel reaches the viewport height.
**Keyboard and accessibility.** The panel has `role="dialog"`, labelled by the title and described by the description. Opening focuses the first focusable element; Tab and Shift+Tab stay inside; Escape or a click on the backdrop closes it and returns focus to the trigger.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDialog
Same component as `NwSheet`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` | | The controlled open state of the dialog. |
| `defaultOpen` | `boolean` | | The open state of the dialog when it is initially rendered. |
| `modal` | `boolean` | | The modality of the dialog When set to `true`, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. |
| `unmountOnHide` | `boolean` | | When set to `false`, the dialog content will not be unmounted when closed, but instead hidden with CSS. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; close: () => void; }` |
### NwDialogBody
Same component as `NwDrawerBody`, `NwSheetBody`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogClose
Same component as `NwSheetClose`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg" \| "xl" \| "full"` | | Width preset: sm 24rem, md 32rem, lg 48rem, xl 64rem, full covers the viewport. |
| `showClose` | `boolean` | `true` | Render the close button in the top-end corner. |
| `closeLabel` | `string` | `"Close"` | Accessible name of the close button. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogDescription
Same component as `NwSheetDescription`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogFooter
Same component as `NwDrawerFooter`, `NwSheetFooter`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogHeader
Same component as `NwSheetHeader`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogTitle
Same component as `NwSheetTitle`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDialogTrigger
Same component as `NwSheetTrigger`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwDrawer
Part of [Overlays & menus](../families/overlays.md).
A swipeable panel, wrapping Reka `Drawer`. It slides from the bottom by default and follows the pointer while it is dragged. `NwDrawerBody` and `NwDrawerFooter` are the dialog's layout parts under drawer names.
```vue title="DrawerDemo.vue"
Open incident log
Incident log
Three open incidents. Swipe down or press Escape to close.
Packet loss on waw-03, a certificate expiring on hel-01, and a stalled config push.
Done
```
```text title="Anatomy"
NwDrawer
├─ NwDrawerTrigger
└─ NwDrawerContent
├─ NwDrawerHandle (rendered for you unless show-handle is false)
├─ NwDrawerHeader
│ ├─ NwDrawerTitle
│ └─ NwDrawerDescription
├─ NwDrawerBody
└─ NwDrawerFooter
└─ NwDrawerClose
```
| Part | Prop | Type | Default | Effect |
| ----------------- | ---------------- | ------------------------------------- | --------- | ----------------------------------------------------------------------------- |
| `NwDrawer` | `swipeDirection` | `'down' \| 'up' \| 'left' \| 'right'` | `'down'` | Edge and dismiss direction: bottom sheet, top sheet, side panels (Reka) |
| | `modal` | `boolean \| 'trap-focus'` | `true` | `'trap-focus'` keeps focus inside but lets the page take pointer input (Reka) |
| | `snapPoints` | `(number \| string)[]` | none | Snap positions: fractions, pixels, or CSS lengths (Reka) |
| `NwDrawerContent` | `showHandle` | `boolean` | `true` | Renders the grab bar on the edge facing the page |
| | `showClose` | `boolean` | `false` | Renders an icon close button, useful without touch input |
| | `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
The other Reka `DrawerRoot` props (`v-model:open`, `v-model:snapPoint`, `snapToSequentialPoints`) and `DrawerContent` emits pass through. The handle is decorative (`aria-hidden`).
**Keyboard and accessibility.** The drawer opens from its trigger as a described dialog; Escape closes it and restores focus. Swiping is pointer-only, so keep a close control (`show-close` or an `NwDrawerClose`) for keyboard users.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDrawer
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` | | v-model:open |
| `defaultOpen` | `boolean` | | |
| `modal` | `DrawerModal` | | Modality of the drawer. |
| `swipeDirection` | `SwipeDirection$1` | | Direction to swipe to dismiss. |
| `snapPoints` | `DrawerSnapPoint[]` | | Preset snap positions (fractions 0-1, pixels >1, or '148px'/'30rem' strings) |
| `snapPoint` | `DrawerSnapPoint \| null` | | v-model:snapPoint |
| `defaultSnapPoint` | `DrawerSnapPoint \| null` | | |
| `snapToSequentialPoints` | `boolean` | | When true, snaps to the next sequential snap point (one step at a time). |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean, details: DrawerOpenChangeDetails]` | |
| `update:openComplete` | `[value: boolean]` | |
| `update:snapPoint` | `[value: DrawerSnapPoint \| null]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; close: () => void; }` |
### NwDrawerBody
Same component as `NwDialogBody`, `NwSheetBody`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerClose
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `showHandle` | `boolean` | `true` | Render the grab handle on the edge facing the page. |
| `showClose` | `boolean` | `false` | Render a close button in the top-end corner (useful without touch input). |
| `closeLabel` | `string` | `"Close"` | Accessible name of the close button. |
| `forceMount` | `boolean` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| `initialFocus` | `boolean \| HTMLElement \| null` | | Initial focus target when the drawer opens. |
| `finalFocus` | `boolean \| HTMLElement \| null` | | Final focus target when the drawer closes. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerDescription
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerFooter
Same component as `NwDialogFooter`, `NwSheetFooter`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerHandle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerHeader
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerTitle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDrawerTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwDropdownMenu
Part of [Overlays & menus](../families/overlays.md).
A menu of actions opened from a button, wrapping Reka `DropdownMenu`, with items, checkbox and radio items, labels, groups, separators, shortcuts and submenus. A highlighted item gets the primary soft fill and a primary rail on its inline-start edge.
```vue title="DropdownMenuDemo.vue"
Relay actions
Relay fra-02
Restart
Ctrl+R
Promote to primary
Move to region
eu-west
eu-north
Monitoring
Tier
Standard
Priority
Drain
Last action: {{ last }} · monitoring: {{ monitored }} · tier: {{ tier }}
```
```text title="Anatomy"
NwDropdownMenu
├─ NwDropdownMenuTrigger
└─ NwDropdownMenuContent
├─ NwDropdownMenuLabel
├─ NwDropdownMenuGroup
│ ├─ NwDropdownMenuItem
│ │ └─ NwDropdownMenuShortcut
│ └─ NwDropdownMenuSub
│ ├─ NwDropdownMenuSubTrigger
│ └─ NwDropdownMenuSubContent
├─ NwDropdownMenuSeparator
├─ NwDropdownMenuCheckboxItem
└─ NwDropdownMenuRadioGroup
└─ NwDropdownMenuRadioItem
```
| Part | Prop | Type | Default | Effect |
| --------------------------------------------- | ------------- | ----------------------- | ----------- | ------------------------------------------------------------------------ |
| `NwDropdownMenu` | `modal` | `boolean` | `false` | `true` blocks outside interaction and hides the page from assistive tech |
| `NwDropdownMenuContent`, `…SubContent` | `variant` | `'solid' \| 'glass'` | `'solid'` | `glass` blurs what is behind the menu |
| | `sideOffset` | `number` | `4` | Distance from the trigger (Reka) |
| `NwDropdownMenuSubContent` | `alignOffset` | `number` | `-5` | Lines the first sub item up with its sub trigger (Reka) |
| `NwDropdownMenuItem` | `intent` | `'default' \| 'danger'` | `'default'` | `danger` paints a destructive item |
| `NwDropdownMenuItem`, `…Label`, `…SubTrigger` | `inset` | `boolean` | `false` | Indents the label to line up with checkbox and radio items |
Items emit `@select`; `NwDropdownMenuCheckboxItem` binds `v-model` (boolean) and `NwDropdownMenuRadioGroup` binds `v-model` (the selected value). The other Reka props and emits pass through.
`modal` defaults to `false` here, unlike in Reka: a modal menu sets `aria-hidden` on the rest of the page while its focusable trigger stays inside that hidden tree.
**Keyboard.** Enter, Space or ArrowDown on the trigger opens the menu on its first item. Arrow keys move between items and skip disabled ones; Enter selects. ArrowRight opens a submenu on its first item and ArrowLeft returns to the sub trigger. Escape or a pointer down outside closes the menu.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwDropdownMenu
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the dropdown menu when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the menu. |
| `dir` | `Direction$4` | | The reading direction of the combobox when applicable. |
| `modal` | `boolean` | `false` | The modality of the dropdown menu. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[payload: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwDropdownMenuCheckboxItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `CheckedState` | | The controlled checked state of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: boolean]` | |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: CheckedState; modelValue: CheckedState; }` |
### NwDropdownMenuContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `"default" \| "danger"` | | `danger` paints destructive items in the danger ink. |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent to line up with checkbox and radio items. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuRadioGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `AcceptableValue` | | The value of the selected item in the group. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuRadioItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The unique value of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: boolean; }` |
### NwDropdownMenuSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwDropdownMenuShortcut
Same component as `NwContextMenuShortcut`, `NwMenubarShortcut`.
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuSub
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the dropdown menu when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the menu. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[payload: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwDropdownMenuSubContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `alignOffset` | `number` | `-5` | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| `entryFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuSubTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `graceDuration` | `number` | | How long (in milliseconds) the pointer is given to reach the submenu after leaving the trigger. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwDropdownMenuTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwEditable
Part of [Forms](../families/forms.md).
`NwEditable` wraps Reka `EditableRoot` for an inline preview/edit cycle. Its exported area, preview, input and trigger parts make the edit and commit controls explicit.
```vue title="EditableDemo.vue"
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| -------------------------------------- | ------------------------------ | ---------------------------------- | -------------------------------------------------------- |
| Root `class` | `HTMLAttributes['class']` | unset | Root styling; `EditableRootProps` and emits pass through |
| Input `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Editor dimensions |
| Input `label` | `string` | `'Editable text'` | Input accessible name |
| Edit / Submit / Cancel trigger `label` | `string` | `'Edit'` / `'Submit'` / `'Cancel'` | Accessible name and fallback text |
The demo sets `activation-mode="none"` and `submit-mode="enter"`, so only the Edit button starts editing and Enter commits. Reka hides the parts that do not apply with the `hidden` attribute; the parts set their own `display`, so add `[&[hidden]]:hidden` as shown to keep them hidden. Edit starts entry and focuses the input, Submit or Enter commits, and Cancel or Escape restores the previous value. Name the editor after the record it changes.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwEditable
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string` | | The default value of the editable field |
| `modelValue` | `string \| null` | | The value of the editable field |
| `placeholder` | `string \| { edit: string; preview: string; }` | | The placeholder for the editable field |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `disabled` | `boolean` | | Whether the editable field is disabled |
| `readonly` | `boolean` | | Whether the editable field is read-only |
| `activationMode` | `ActivationMode` | | The activation event of the editable field |
| `selectOnFocus` | `boolean` | | Whether to select the text in the input when it is focused. |
| `submitMode` | `SubmitMode` | | The submit event of the editable field |
| `startWithEditMode` | `boolean` | | Whether to start with the edit mode active |
| `maxLength` | `number` | | The maximum number of characters allowed |
| `autoResize` | `boolean` | | Whether the editable field should auto resize |
| `id` | `string` | | The id of the field |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| `submit` | `[value: string \| null \| undefined]` | |
| `update:state` | `[state: "cancel" \| "submit" \| "edit"]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ isEditing: boolean; modelValue: string \| null \| undefined; isEmpty: boolean; submit: () => void; cancel: () => void; edit: () => void; }` |
### NwEditableArea
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwEditableCancelTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Cancel"` | Accessible name of the control. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwEditableEditTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Edit"` | Accessible name of the control. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwEditableInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `label` | `string` | `"Editable text"` | Accessible name of the text box. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwEditablePreview
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwEditableSubmitTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Submit"` | Accessible name of the control. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwEmpty
Part of [Actions & HUD](../families/actions.md).
`NwEmpty` is the placeholder for a collection with no items: a title, an optional description and a slot for the next action.
```vue title="EmptyDemo.vue"
Create key
Revoke all
```
| Prop | Type | Default | Effect |
| ------------- | -------- | -------- | ---------------------------- |
| `title` | `string` | required | Bold heading text (`strong`) |
| `description` | `string` | unset | Supporting paragraph |
Put the primary way forward in the slot, as a real button or link. The empty state is not a live region; when it replaces content after an action, announce the change separately if it matters.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwEmpty
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `string` | required | |
| `description` | `string` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwField
Part of [Forms](../families/forms.md).
`NwField` wraps Reka `FieldRoot`. It associates a label, a description and an error with one control, and carries `name`, `required`, `invalid` and `disabled` for the whole field. Two Nyxwire shortcuts sit on top of the parts: the `label`, `hint` and `error` props render the label, description and error for you, and the default slot's `control` binding wires a control that does not join the field by itself.
```vue title="FieldDemo.vue"
Arc
Circuit
Ice
```
The host field shows a validation message until the name is unique: clear it or change it and the error, its `aria-invalid` and its description id go away. The region select renders a Reka `SelectTrigger`, not a `FieldControl`, so it takes the field's id, name, label, description and invalid state from `v-bind="control"`.
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------- | ---------------------------- | ------------ | ----------------------------------------------------------------- |
| Field `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Column, or a wrapping row with the control beside its label |
| Field `label` | `string` | unset | Renders an `NwFieldLabel` before the control |
| Field `hint` | `string` | unset | Renders an `NwFieldDescription` after the control |
| Field `error` | `string` | unset | Marks the field invalid and renders the message in `NwFieldError` |
| Field `invalid` | `boolean` | `false` | Marks the field invalid without a message |
Remaining `FieldRootProps` pass through. `NwFieldLabel` appends a glowing `*` (hidden from assistive technology) when the field is `required`, and turns danger while it is invalid. `NwFieldError` lists every message when there are several and shows only while the field is invalid.
The default slot receives `{ invalid, errors, control }`. `control` holds `id`, `name`, `disabled`, `required`, `aria-labelledby`, `aria-describedby` and `aria-invalid`; it is empty outside a field. `NwInput` and `NwTextarea` join the field without it and drop a duplicate binding if you pass one. In your own components, `useNwFieldControl()` returns the same attributes as a computed ref:
```ts
import { useNwFieldControl } from '@nyxwire/vue'
const control = useNwFieldControl() // bind on the focusable element: v-bind="control"
```
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"vertical" \| "horizontal"` | | |
| `label` | `string` | | Renders an NwFieldLabel before the control. |
| `hint` | `string` | | Renders an NwFieldDescription after the control. |
| `error` | `string` | | Marks the field invalid and renders this message in an NwFieldError. |
| `name` | `string` | | The name of the field. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the field's control. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `invalid` | `boolean` | | When `true`, marks the field invalid regardless of its own validation. |
| `dirty` | `boolean` | | Whether the field's value has changed from its initial value. |
| `touched` | `boolean` | | Whether the field has been touched (its control blurred). |
| `validate` | `FieldValidateFn` | | Custom validation function. |
| `validationMode` | `FieldValidationMode` | | When the field (re-)runs validation. |
| `validationDebounceTime` | `number` | | How long to wait (in ms) between `validate` calls when validating on change. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `NwFieldSlotProps` |
### NwFieldDescription
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | | Id of the element. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwFieldError
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | | Id of the element. |
| `match` | `boolean \| keyof ValidityState` | | Restricts when this error renders: - a `ValidityState` key (e.g. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `{ errors: string[]; }` |
### NwFieldLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `nativeLabel` | `boolean` | | Whether the label renders a native `label` element. |
| `for` | `string` | | The id of the element the label is associated with. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwForm
Part of [Forms](../families/forms.md).
`NwForm` wraps Reka `FormRoot` to collect named fields, validate on submit and focus the first invalid control.
```vue title="FormDemo.vue"
Node name
Shown on the cluster map.
Register node
{{ saved }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| -------- | ------------------------------------ | ----------- | ------------------------------------------------------------------- |
| `layout` | `'stacked' \| 'inline' \| 'columns'` | `'stacked'` | One column, a wrapping row, or two columns from the `sm` breakpoint |
Remaining `FormRootProps` and declared form emits pass through. `formSubmit` receives the valid named values; listen with `@form-submit` as shown. Without a `@form-submit` listener the native submit goes through, so a plain `action` URL keeps working.
Submit the empty form: the node field turns invalid, its error appears, and focus moves to it. Typing a name clears the error. Disabled fields disable their native controls. This validation is feedback for the user; the server still owns acceptance of the data.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwForm
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `layout` | `"inline" \| "columns" \| "stacked"` | | |
| `errors` | `Record` | | A map of field `name` to server-side error message(s). |
| `validationMode` | `FieldValidationMode` | | When fields validate. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `submit` | `[event: SubmitEvent]` | |
| `formSubmit` | `[values: Record, event: SubmitEvent]` | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwHoverCard
Part of [Overlays & menus](../families/overlays.md).
A preview card for sighted pointer users, wrapping Reka `HoverCard`: it opens after the pointer rests on the trigger (700 ms) and closes 300 ms after it leaves.
```vue title="HoverCardDemo.vue"
Primary route through
relay ams-01
ams-01
Amsterdam edge, eu-west. 1,204 sessions, 38% load, uptime 41 days.
```
```text title="Anatomy"
NwHoverCard
├─ NwHoverCardTrigger (renders a link)
└─ NwHoverCardContent
```
| `NwHoverCardContent` prop | Type | Default | Effect |
| ------------------------- | ------------------------- | --------- | -------------------------------------- |
| `variant` | `'solid' \| 'glass'` | `'solid'` | `glass` blurs what is behind the card |
| `arrow` | `boolean` | `false` | Draws an arrow pointing at the trigger |
| `sideOffset` | `number` | `8` | Distance from the trigger in px (Reka) |
| `arrowPadding` | `number` | `12` | Keeps the arrow off the corners (Reka) |
| `class` | `HTMLAttributes['class']` | none | Merged onto the card |
`NwHoverCard` forwards Reka's `openDelay`, `closeDelay` and the other root props.
**Keyboard and accessibility.** Keyboard focus on the trigger opens the card too. The card is supplementary: put nothing in it that is not reachable elsewhere.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwHoverCard
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the hover card when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the hover card. |
| `openDelay` | `number` | | The duration from when the mouse enters the trigger until the hover card opens. |
| `closeDelay` | `number` | | The duration from when the mouse leaves the trigger or content until the hover card closes. |
| `enableTouch` | `boolean` | | When `true`, tapping the trigger on touch devices toggles the hover card open/closed. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwHoverCardContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the card. |
| `arrow` | `boolean` | `false` | Draw an arrow pointing at the trigger. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `8` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | `12` | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `dir` | `Direction` | | The reading direction of the popper content when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwHoverCardTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `reference` | `ReferenceElement` | | The reference (or anchor) element that is being referred to for positioning. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwHudPanel + NwStatBar + NwNeonText
Part of [Actions & HUD](../families/actions.md).
`NwHudPanel` renders Reka `Primitive` as a `section` with a cut-corner frame, a header label and a status readout; `NwNeonText` renders it as a `span`. `NwStatBar` is a native, labelled `role="meter"` with a segmented fill. This demo runs on the circuit grid to check legibility.
```vue title="HudDemo.vue"
Reset
{{
critical ? 'Shield failing' : 'Core online'
}}
Take a hit
NYXWIRE
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| --------------------------------------- | ------------------------------------------------------- | ------------------- | --------------------------------------------------------------------- |
| HudPanel `intent` | Intent | `'primary'` | Header and frame tone |
| HudPanel `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Padding of header, body and footer |
| HudPanel `title` | `string` | unset | Header title; also names the panel (`aria-labelledby`) |
| HudPanel `titleAs` | `'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6' \| 'p' \| 'span'` | `'h3'` | Title element |
| HudPanel `status` | `string` | unset | Status readout led by a diamond marker; the `status` slot replaces it |
| HudPanel `alarm` | `boolean` | `false` | Pulses the status marker; the text stays steady |
| HudPanel `cut` | `boolean` | `true` | Chamfered corners |
| HudPanel `wire`, `scanlines`, `solid` | `boolean` | `false` | Gradient edge / scanline overlay / opaque sunken fill |
| HudPanel `glow` | `'sm' \| 'md' \| 'lg'` | unset | Intent bloom |
| HudPanel `as` | `PrimitiveProps['as']` | `'section'` | Root element |
| StatBar `label`, `value` | `string`, `number` | required | Meter name and current value |
| StatBar `max`, `segments` | `number` | `100`, `10` | Maximum value and segment count |
| StatBar `intent`, `size` | Intent, `'sm' \| 'md' \| 'lg'` | `'primary'`, `'md'` | Tone and dimensions |
| StatBar `glow`, `critical`, `hideValue` | `boolean` | `false` | Glowing readout, pulsing danger readout, hidden number |
| StatBar `valueText` | `string` | unset | `aria-valuetext`, e.g. "42 percent shield" |
| NeonText `intent` | Intent | `'primary'` | Ink and glow color |
| NeonText `glow` | `'text' \| 'halo' \| 'none'` | `'text'` | Glyph glow, whole-word halo, or flat ink |
| NeonText `wire` | `boolean` | `false` | Fills the text with the wire gradient |
| NeonText `glitch` | `boolean` | `false` | Glitch burst on hover and focus |
| NeonText `as` | `PrimitiveProps['as']` | `'span'` | Text element |
The stat bar clamps `value` between zero and `max` and exposes `aria-valuemin`, `aria-valuemax` and `aria-valuenow`; its visible number is `aria-hidden` because the meter already carries it. These displays do not take focus or announce every update, and the panel's status marker is decorative, so keep the status in text. Pulses, flicker and glitch stop under `prefers-reduced-motion`. Use `solid` when the content behind the panel makes the translucent fill hard to read.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwHudPanel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | |
| `size` | `NwSize` | | Padding step of the header, body and footer. |
| `title` | `string` | | Header title; it also names the panel. |
| `titleAs` | `"h2" \| "h3" \| "p" \| "span" \| "h4" \| "h5" \| "h6"` | `"h3"` | |
| `status` | `string` | | Status readout after the title, led by a diamond marker. |
| `alarm` | `boolean` | | Pulses the status marker; the text stays steady. |
| `cut` | `boolean` | `true` | Cut corners (default on). |
| `wire` | `boolean` | | |
| `scanlines` | `boolean` | | |
| `solid` | `boolean` | | Sunken opaque fill instead of the panel surface. |
| `glow` | `NwGlow` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"section"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `header` | |
| `status` | |
| `actions` | |
| `default` | |
| `footer` | |
### NwStatBar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | required | Visible label and accessible name of the meter. |
| `value` | `number` | required | |
| `max` | `number` | `100` | |
| `segments` | `number` | `10` | Number of segments of the bar. |
| `intent` | `NwIntent` | | |
| `size` | `NwStatBarSize` | | |
| `glow` | `boolean` | | Glowing readout in the intent ink. |
| `critical` | `boolean` | | Pulsing danger readout. |
| `hideValue` | `boolean` | | Hides the numeric readout. |
| `valueText` | `string` | | Replaces the number in aria-valuetext, e.g. |
| Slot | Props |
| --- | --- |
| `icon` | |
### NwNeonText
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | |
| `glow` | `NwNeonTextGlow` | | `text` glows the glyphs, `halo` blooms the whole word, `none` keeps the ink flat. |
| `wire` | `boolean` | | Fills the text with the wire gradient; replaces the intent ink. |
| `glitch` | `boolean` | | Glitch burst on hover and focus; off under reduced motion. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"span"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwIconButton
Part of [Actions & HUD](../families/actions.md).
`NwIconButton` is an `NwButton` with `icon` set and a required `label`, which becomes both its `aria-label` and its tooltip-style `title`. Put a single icon in the default slot.
```vue title="IconButtonDemo.vue"
```
| Prop | Type | Default | Effect |
| --------------------- | --------- | ------------------------------ | ----------------------------------- |
| `label` | `string` | required | Accessible name and `title` |
| Appearance | see above | `'primary'`, `'solid'`, `'md'` | Same appearance props as `NwButton` |
| `disabled`, `loading` | `boolean` | `false` | Forwarded to `NwButton` |
Mark the icon itself decorative with `aria-hidden="true"` so the label is the only name. The square sizes are 1.75, 2, 2.5 and 3 rem for `xs` to `lg`, so `sm` and up meet the 24 px target size.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwIconButton
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | |
| `variant` | `NwVariant` | | |
| `size` | `NwSize` | | |
| `cut` | `boolean` | | |
| `wire` | `boolean` | | |
| `glow` | `NwGlow` | | |
| `label` | `string` | required | |
| `disabled` | `boolean` | | |
| `loading` | `boolean` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwInputGroup
Part of [Forms](../families/forms.md).
`NwInputGroup` wraps Reka `Primitive` to join inputs and `NwInputGroupAddon` text into one bar: inner corners square off, borders collapse and the focused input rises above its neighbours. It changes layout without replacing the input's semantics.
```vue title="InputGroupDemo.vue"
Relay endpoint
https://
:443
Monthly quota
GB
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ---------------- | ------------------------------ | -------- | -------------------------------------------------------------- |
| Group `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Height of every input in the group |
| Group `start` | slot | unset | Shorthand: rendered in an `NwInputGroupAddon` before the input |
| Group `end` | slot | unset | Shorthand: rendered in an `NwInputGroupAddon` after the input |
| Addon `as` | `PrimitiveProps['as']` | `'span'` | Element of the addon |
Remaining `PrimitiveProps` pass through. Addons use the mono uppercase label type. Give the input its own label: addon text is neither a label nor a description. The input stays keyboard editable.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwInputGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `start` | |
| `default` | |
| `end` | |
### NwInputGroupAddon
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"span"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwLabel + NwInput
Part of [Forms](../families/forms.md).
`NwLabel` wraps Reka `Label`. `NwInput` renders an input through `Primitive`, or through Reka `FieldControl` inside `NwField`, so labels, descriptions, validation and field values stay connected.
```vue title="InputDemo.vue"
Operator handle
@
Signed as: @{{ handle }}
```
| Component / prop | Type | Default | Effect |
| -------------------- | --------------------------------------------------------------------------- | ----------------------- | --------------------------------------------------------- |
| Label `class` | `HTMLAttributes['class']` | unset | Merged label styling; remaining `LabelProps` pass through |
| Input `modelValue` | `string \| number` | unset | Controlled value |
| Input `defaultValue` | `string \| number` | `''` effective fallback | Initial uncontrolled value |
| Input `type` | `'text' \| 'email' \| 'password' \| 'search' \| 'number' \| 'tel' \| 'url'` | `'text'` | Native input type |
| Input `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Height: 1.75rem, 2rem, 2.5rem or 3rem |
| Input `invalid` | `boolean` | `false` | Sets `aria-invalid`: danger edge and glow, no wire edge |
Native attributes such as `id`, `name`, `disabled`, `readonly`, `autocomplete` and `inputmode` reach the input. The `leading` and `trailing` slots pin a non-interactive icon or text inside the edge and pad the text around it. The model emits `update:modelValue` with a string or number; a native number input's text edits are still strings.
Connect `NwLabel`'s `for` to the input's `id`, or use `NwFieldLabel` in a field. Clicking the label focuses the input. Native text editing and Tab navigation stay available. The type union deliberately leaves out native date, time and color inputs: use the [date and time](../families/datetime.md) and [color](../families/color.md) components, which look the same in every browser.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `for` | `string` | | The id of the element the label is associated with. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string \| number` | | |
| `defaultValue` | `string \| number` | | |
| `type` | `"number" \| "search" \| "text" \| "email" \| "password" \| "tel" \| "url"` | `"text"` | |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string \| number]` | |
| Slot | Props |
| --- | --- |
| `leading` | |
| `trailing` | |
# NwKbd
Part of [Actions & HUD](../families/actions.md).
`NwKbd` is a native `kbd` keycap. It renders a key; it does not register a shortcut.
```vue title="KbdDemo.vue"
Ctrl K
Esc
Enter
Focus here and press a key:
{{ last }}
none yet
```
| Prop | Type | Default | Effect |
| ----------- | ---------------------- | ------- | ----------------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Keycap height and text size |
| `highlight` | `boolean` | `false` | Primary ink and glow for a bound or pressed key |
Write key names as users see them (`Ctrl`, `Esc`, `Enter`); screen readers read the text as is. The demo's key tester is a focusable group that records `keydown`; it lets Tab through so focus never gets stuck.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwKbd
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `NwKbdSize` | | |
| `highlight` | `boolean` | | Primary ink and glow for a bound or active key. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwKeyHint
Part of [Actions & HUD](../families/actions.md).
`NwKeyHint` composes keycaps joined by a decorative plus and an action label in a `span`. Like `NwKbd`, it only describes a shortcut.
```vue title="KeyHintDemo.vue"
{{ locked ? 'Unlock deploys' : 'Lock deploys' }}
```
| Prop | Type | Default | Effect |
| ----------- | ---------------------- | -------- | -------------------------------------------- |
| `keys` | `readonly string[]` | required | Key combination, e.g. `['Ctrl', 'K']` |
| `label` | `string` | unset | Action text; the default slot can replace it |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Keycap size |
| `highlight` | `boolean` | `false` | Highlighted keycaps, dropped while disabled |
| `disabled` | `boolean` | `false` | Muted state and `aria-disabled="true"` |
Bind the actual shortcut in your app, and keep `disabled` in sync with it. Avoid single-letter shortcuts that fire while the user types in a field.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwKeyHint
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `keys` | `readonly string[]` | required | Keys of the combination, e.g. |
| `label` | `string` | | Action the keys trigger. |
| `size` | `NwKbdSize` | | |
| `highlight` | `boolean` | | |
| `disabled` | `boolean` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwLayout
Part of [Actions & HUD](../families/actions.md).
`NwLayout` is a `div` that arranges its children with one of the four layout primitives of the CSS layer.
```vue title="LayoutDemo.vue"
Stack
Cluster
Grid
{{ name }}
```
| Prop | Type | Default | Effect |
| -------- | ----------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------- |
| `layout` | `'container' \| 'stack' \| 'cluster' \| 'grid'` | `'stack'` | Centered 72rem column, vertical stack, wrapping row, or auto-fit grid of 16rem minimum columns |
The arrangement changes only visual placement; DOM order stays the reading and tab order, so keep it meaningful. Every arrangement wraps or reflows down to 320 px.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwLayout
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `layout` | `"grid" \| "container" \| "stack" \| "cluster"` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwLink
Part of [Actions & HUD](../families/actions.md).
`NwLink` renders Reka `Primitive` as an anchor. External links add an arrow, a screen-reader hint and safe new-tab attributes.
```vue title="LinkDemo.vue"
Vue overview
Flavors
Class merging
Reka UI
Billing
{{ locked ? 'Enable billing link' : 'Disable billing link' }}
```
| Prop | Type | Default | Effect |
| --------------- | ---------------------------------- | ------------------------ | -------------------------------------------------- |
| `variant` | `'default' \| 'muted' \| 'subtle'` | `'default'` | Link ink (`link` role color) and underline |
| `href` | `string` | unset | Destination |
| `external` | `boolean` | `false` | `target="_blank"` with `rel="noopener noreferrer"` |
| `externalLabel` | `string` | `'(opens in a new tab)'` | Hidden external-link hint |
| `disabled` | `boolean` | `false` | Drops `href` and sets `aria-disabled` |
| `as` | `PrimitiveProps['as']` | `'a'` | Rendered element; use `as-child` for a router link |
Links activate with Enter. A disabled link has no `href`, so it leaves the tab order; explain nearby why it is unavailable. With `as-child`, the child owns its content and the external hint is not added.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwLink
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwLinkVariant` | | |
| `href` | `string` | | |
| `external` | `boolean` | | Opens in a new tab: adds the arrow icon, target="_blank" and rel="noopener noreferrer". |
| `disabled` | `boolean` | | Drops the href and marks the link aria-disabled. |
| `externalLabel` | `string` | `"(opens in a new tab)"` | Screen reader hint appended to external links. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"a"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwList
Part of [Actions & HUD](../families/actions.md).
`NwList` renders a styled `ul` or `ol`, from an `items` array or from your own `li` elements.
```vue title="ListDemo.vue"
Slot content works too: bold and links stay inline.
Numbered
```
| Prop | Type | Default | Effect |
| --------- | ------------------- | ------- | ---------------------------------------------- |
| `ordered` | `boolean` | `false` | `ol` with numbers instead of `ul` with markers |
| `items` | `readonly string[]` | unset | Text items; the default slot replaces them |
Lists keep their native semantics, so screen readers announce the item count. Use `ordered` only when the order matters, such as steps.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `ordered` | `boolean` | | |
| `items` | `readonly string[]` | | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwListbox
Part of [Selection](../families/selection.md).
`NwListbox` wraps Reka `ListboxRoot` for a list that stays visible. `NwListboxFilter` only holds the query text: you filter your own array with it, as this example does.
```vue title="ListboxDemo.vue"
Transports
{{
protocol
}}
No transports match.
Allowed: {{ summary }}
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ---------------- | ------------------------- | ------- | ------------------------------------------------------------ |
| Root `class` | `HTMLAttributes['class']` | unset | Root styling; other props/emits are `ListboxRootProps`/emits |
| Filter `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Filter height and padding |
| Filter `invalid` | `boolean` | `false` | Danger edge and `aria-invalid` |
The root's `v-model` holds the selected values and the filter's `v-model` holds the query. With `multiple`, the root model is an array, clicking an option toggles it, and the list exposes `aria-multiselectable`. A disabled root blocks selection and marks every item `aria-disabled`. Selected items show a check.
**Keyboard and accessibility.** Name the content and the filter separately. The options are always in the document, so there is no popup and no focus trap. Arrow keys move the highlight, Enter or Space selects it, and typing jumps to a match. Keep focus in the filter while the user types, and show a visible message when the filter matches nothing, as the example does.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwListbox
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the listbox. |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The value of the listbox when initially rendered. |
| `multiple` | `boolean` | | Whether multiple options can be selected or not. |
| `orientation` | `DataOrientation` | | The orientation of the listbox. |
| `dir` | `Direction` | | The reading direction of the listbox when applicable. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with listbox |
| `selectionBehavior` | `"replace" \| "toggle"` | | How multiple selection should behave in the collection. |
| `highlightOnHover` | `boolean` | | When `true`, hover over item will trigger highlight |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `by` | `string \| ((a: AcceptableValue, b: AcceptableValue) => boolean)` | | Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue]` | |
| `highlight` | `[payload: { ref: HTMLElement; value: AcceptableValue; } \| undefined]` | |
| `entryFocus` | `[event: CustomEvent]` | |
| `leave` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: AcceptableValue \| AcceptableValue[] \| undefined; }` |
### NwListboxContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwListboxFilter
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `modelValue` | `string` | | The controlled value of the filter. |
| `autoFocus` | `boolean` | | Focus on element when mounted. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[string]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwListboxGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwListboxGroupLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `for` | `string` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwListboxItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The value given as data when submitted with a `name`. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent$3]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ selected: boolean; }` |
# NwMenubar
Part of [Overlays & menus](../families/overlays.md).
A horizontal row of menus, as in a desktop application, wrapping Reka `Menubar`. Each `NwMenubarMenu` has a trigger and its content; `v-model` on `NwMenubar` holds the value of the open menu.
```vue title="MenubarDemo.vue"
Topology
New snapshot
Ctrl+N
Open recent
eu-west
eu-north
Export
View
Latency overlay
Time range
Last hour
Last 24 hours
Last action: {{ last }} · latency: {{ showLatency }} · range: {{ range }}
```
```text title="Anatomy"
NwMenubar
└─ NwMenubarMenu (value)
├─ NwMenubarTrigger
└─ NwMenubarContent
└─ same items as NwDropdownMenuContent, prefixed NwMenubar
```
| Part | Prop | Type | Default | Effect |
| ---------------------------------------- | --------------------------- | ------------------------------ | ----------- | ---------------------------------------------------- |
| `NwMenubar` | `class` | `HTMLAttributes['class']` | none | Merged onto the bar |
| `NwMenubarContent` | `variant` | `'solid' \| 'glass'` | `'solid'` | `glass` blurs what is behind the menu |
| | `sideOffset` | `number` | `6` | Distance from the trigger (Reka) |
| | `align` | `'start' \| 'center' \| 'end'` | `'start'` | Aligns the menu with the trigger's start edge (Reka) |
| `NwMenubarSubContent` | `sideOffset`, `alignOffset` | `number` | `4`, `-5` | Sub menu placement (Reka) |
| `NwMenubarItem` | `intent` | `'default' \| 'danger'` | `'default'` | `danger` paints a destructive item |
| `NwMenubarItem`, `…Label`, `…SubTrigger` | `inset` | `boolean` | `false` | Indents the label |
**Keyboard and accessibility.** The bar has the `menubar` role, and ArrowLeft and ArrowRight move between its triggers. Enter opens a menu on its first item; with a menu open, ArrowRight moves to the next menu. ArrowRight on a sub trigger opens its submenu, ArrowLeft closes it. Escape closes the open menu and returns focus to its trigger.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwMenubar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string` | | The controlled value of the menu to open. |
| `defaultValue` | `string` | | The value of the menu that should be open when initially rendered. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string; }` |
### NwMenubarCheckboxItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `CheckedState` | | The controlled checked state of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: boolean]` | |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: CheckedState; modelValue: CheckedState; }` |
### NwMenubarContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `6` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | `"start"` | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `"default" \| "danger"` | | `danger` paints destructive items in the danger ink. |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent to line up with checkbox and radio items. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarMenu
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | | A unique value that associates the item with an active value when the navigation menu is controlled. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarRadioGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `AcceptableValue` | | The value of the selected item in the group. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarRadioItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The unique value of the item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ checked: boolean; }` |
### NwMenubarSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwMenubarShortcut
Same component as `NwContextMenuShortcut`, `NwDropdownMenuShortcut`.
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarSub
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the submenu when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the menu. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[payload: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwMenubarSubContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the menu. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `alignOffset` | `number` | `-5` | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| `entryFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarSubTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | `false` | Indent the label so it lines up with checkbox and radio items. |
| `graceDuration` | `number` | | How long (in milliseconds) the pointer is given to reach the submenu after leaving the trigger. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwMenubarTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwMeter
Part of [Actions & HUD](../families/actions.md).
`NwMeter` is a native `` for a measurement within a known range (disk use, load), as opposed to task progress. The browser colors it from `low`, `high` and `optimum`.
```vue title="MeterDemo.vue"
CPU load
{{ load }}%
Add load
Reset
```
| Prop | Type | Default | Effect |
| ------------- | -------- | ---------- | -------------------------------------------------------------------------------------------------- |
| `label` | `string` | required | `aria-label` of the meter |
| `value` | `number` | required | Current measurement |
| `min`, `max` | `number` | `0`, `100` | Range |
| `low`, `high` | `number` | unset | Thresholds of the low and high regions |
| `optimum` | `number` | unset | Preferred value: the region holding it fills primary, the next one warning and the farthest danger |
Native meters expose `role="meter"` with their value. Show the number in text as well, as the demo does, because the bar's color alone does not tell the value.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwMeter
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | required | |
| `value` | `number` | required | |
| `min` | `number` | `0` | |
| `max` | `number` | `100` | |
| `low` | `number` | | |
| `high` | `number` | | |
| `optimum` | `number` | | |
# NwMonthPicker
Part of [Date & time](../families/datetime.md).
`NwMonthPicker` wraps Reka `MonthPickerRoot`. It shows the twelve months of one year, with previous and next year buttons.
```vue title="MonthPickerDemo.vue"
Billing month:
{{ value ? `${value.year}-${String(value.month).padStart(2, '0')}` : 'none' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| --------------------------------------- | ---------------------------------- | ------- | --------------------------------------------- |
| `modelValue` | `DateValue \| DateValue[] \| null` | unset | Selected month(s) |
| `defaultValue` | `DateValue` | unset | Initial selection |
| `calendarLabel` | `string` | unset | Accessible calendar name |
| `multiple`, `preventDeselect` | `boolean` | `false` | Multiple selection / prevent deselection |
| `minValue`, `maxValue` | `DateValue` | unset | Selection bounds |
| `isMonthDisabled`, `isMonthUnavailable` | `(date: DateValue) => boolean` | unset | Month restrictions |
| `disabled`, `readonly`, `initialFocus` | `boolean` | `false` | Interaction lock / read-only / focus on mount |
The other `MonthPickerRootProps` and emits pass through. Selecting a month emits a date value in that month. Its day comes from the placeholder (today's day by default), so read only `year` and `month`, as the demo does. The cells show short month names ("Jan"). Nyxwire names each cell with the short month and the year ("Jan 2026"), so the accessible name contains the visible word, as WCAG's label-in-name rule requires. Reka would name it with the long month.
**Keyboard and accessibility.** Arrow keys move between months, and Enter or Space selects. The previous and next buttons are named "Previous year" and "Next year". The grid is always on screen, so there is no Escape behavior. Name it with `calendar-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwMonthPicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `DateValue` | | The default value for the month picker |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what year to display when no date is selected |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `calendarLabel` | `string` | | The accessible label for the month picker |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether the month picker is disabled |
| `readonly` | `boolean` | | Whether the month picker is readonly |
| `initialFocus` | `boolean` | | If true, the month picker will focus the selected month, today, or the first month of the year on mount |
| `isMonthDisabled` | `Matcher` | | A function that returns whether or not a month is disabled |
| `isMonthUnavailable` | `Matcher` | | A function that returns whether or not a month is unavailable |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `nextPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the next page of the month picker. |
| `prevPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the previous page of the month picker. |
| `modelValue` | `DateValue \| DateValue[] \| null` | | The controlled selected month value of the month picker. |
| `multiple` | `boolean` | | Whether multiple months can be selected |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateValue \| DateValue[] \| undefined]` | |
| `update:placeholder` | `[date: DateValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ date: DateValue; grid: Grid; locale: string; modelValue: DateValue \| DateValue[] \| undefined; }` |
# NwMonthRangePicker
Part of [Date & time](../families/datetime.md).
`NwMonthRangePicker` wraps Reka `MonthRangePickerRoot` and selects a start month and an end month.
```vue title="MonthRangePickerDemo.vue"
Retention: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| --------------------------------------------- | ------------------- | -------------------------------------- | --------------------------------------------- |
| `modelValue` | `DateRange \| null` | uncontrolled | Selected month endpoints |
| `defaultValue` | `DateRange` | `{ start: undefined, end: undefined }` | Initial endpoints |
| `calendarLabel` | `string` | unset | Accessible name |
| `maximumMonths` | `number` | unset | Range length limit |
| `allowNonContiguousRanges`, `preventDeselect` | `boolean` | `false` | Unavailable-month ranges / deselection policy |
| `fixedDate` | `'start' \| 'end'` | unset | Fixed endpoint |
| `disabled`, `readonly`, `initialFocus` | `boolean` | `false` | Interaction lock / read-only / focus on mount |
The other `MonthRangePickerRootProps` and emits pass through, including the month matchers and bounds. The first selection sets the start month and the second sets the end. The cells use the same short-month names as `NwMonthPicker`.
**Keyboard and accessibility.** Keep Reka's cell triggers when you customize the grid, because they carry focus and selection. Name the grid with `calendar-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwMonthRangePicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `defaultValue` | `DateRange` | | The default value for the calendar |
| `modelValue` | `DateRange \| null` | | The controlled selected month range of the month range picker. |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what year to display when no date is selected. |
| `allowNonContiguousRanges` | `boolean` | | When combined with `isMonthUnavailable`, determines whether non-contiguous ranges may be selected. |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `maximumMonths` | `number` | | The maximum number of months that can be selected in a range |
| `calendarLabel` | `string` | | The accessible label for the calendar |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether or not the calendar is disabled |
| `readonly` | `boolean` | | Whether or not the calendar is readonly |
| `initialFocus` | `boolean` | | If true, the calendar will focus the selected month on mount |
| `isMonthDisabled` | `Matcher` | | A function that returns whether or not a month is disabled |
| `isMonthUnavailable` | `Matcher` | | A function that returns whether or not a month is unavailable |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `nextPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the next page of the calendar. |
| `prevPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the previous page of the calendar. |
| `fixedDate` | `"end" \| "start"` | | Which part of the range should be fixed |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateRange]` | |
| `update:placeholder` | `[date: DateValue]` | |
| `update:startValue` | `[date: DateValue \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ date: DateValue; grid: Grid; locale: string; modelValue: DateRange; }` |
# NwNavbar
Part of [Navigation](../families/navigation.md).
A Nyxwire-only application bar: a `` landmark with a brand, a row of links and an actions area, underlined by a wire hairline. It is plain markup with no state; the current link gets a wire underline.
```vue title="NavbarDemo.vue"
Relay console
{{ section }}
Sign out
```
```text title="Anatomy"
NwNavbar (nav)
├─ #brand slot → NwNavbarBrand (a)
├─ default slot → NwNavbarLink (a, current)
└─ #actions slot → NwNavbarActions (div)
```
| Part | Prop | Type | Default | Effect |
| --------------- | --------- | --------- | ------------------- | -------------------------------------------------- |
| `NwNavbar` | `label` | `string` | `'Main navigation'` | `aria-label` of the navigation landmark |
| `NwNavbarBrand` | `href` | `string` | none | Link target, usually the home page |
| `NwNavbarLink` | `href` | `string` | none | Link target |
| | `current` | `boolean` | `false` | Sets `aria-current="page"` and draws the underline |
`NwNavbarBrand`, `NwNavbarLink` and `NwNavbarActions` take `as` and `as-child`, so a router link can render them. The bar wraps onto several rows on narrow screens.
**Accessibility.** Give each navbar a distinct `label` when a page has several landmarks. Links are ordinary anchors: Tab moves through them and every one shows the focus ring.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwNavbar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Main navigation"` | |
| Slot | Props |
| --- | --- |
| `brand` | |
| `default` | |
| `actions` | |
### NwNavbarActions
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavbarBrand
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"a"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavbarLink
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` | | |
| `current` | `boolean` | | Marks the link as the current page. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"a"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwNavigationMenu
Part of [Navigation](../families/navigation.md).
Site navigation with dropdown panels, wrapping Reka `NavigationMenu`. Triggers open their content on hover or click; `NwNavigationMenuViewport` hosts the open panel and `NwNavigationMenuIndicator` points at its trigger. `NwNavigationMenuSub` nests a second level inside a panel.
```vue title="NavigationMenuDemo.vue"
Network
Relays
Routes
Peering
Security
Keys
Audit log
```
```text title="Anatomy"
NwNavigationMenu
├─ NwNavigationMenuList
│ ├─ NwNavigationMenuItem (value)
│ │ ├─ NwNavigationMenuTrigger
│ │ └─ NwNavigationMenuContent
│ │ ├─ NwNavigationMenuLink (href, active)
│ │ └─ NwNavigationMenuSub (optional second level)
│ └─ NwNavigationMenuIndicator
└─ NwNavigationMenuViewport
```
`NwNavigationMenu` forwards Reka's root props (`v-model`, `delayDuration`, `orientation`, …). `NwNavigationMenuLink` adds an `href` prop and takes Reka's `active`, which sets `aria-current="page"`. The trigger draws a chevron unless it is rendered `as-child`.
**Keyboard.** Tab reaches each trigger; Enter, Space or ArrowDown opens its panel and moves into the links. Escape closes the panel and returns focus to its trigger. Name the menu with `aria-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwNavigationMenu
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string` | | The controlled value of the menu item to activate. |
| `defaultValue` | `string` | | The value of the menu item that should be active when initially rendered. |
| `dir` | `Direction$3` | | The reading direction of the combobox when applicable. |
| `orientation` | `Orientation` | | The orientation of the menu. |
| `delayDuration` | `number` | | The duration from when the pointer enters the trigger until the tooltip gets opened. |
| `skipDelayDuration` | `number` | | How much time a user has to enter another trigger without incurring a delay again. |
| `disableClickTrigger` | `boolean` | | If `true`, menu cannot be open by click on trigger |
| `disableHoverTrigger` | `boolean` | | If `true`, menu cannot be open by hover on trigger |
| `disablePointerLeaveClose` | `boolean` | | If `true`, menu will not close during pointer leave event |
| `unmountOnHide` | `boolean` | | When `true`, the element will be unmounted on closed state. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string; }` |
### NwNavigationMenuContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuIndicator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | | A unique value that associates the item with an active value when the navigation menu is controlled. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuLink
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` | | |
| `active` | `boolean` | | Used to identify the link as the currently active page. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[payload: CustomEvent<{ originalEvent: Event; }>]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuSub
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string` | | The controlled value of the sub menu item to activate. |
| `defaultValue` | `string` | | The value of the menu item that should be active when initially rendered. |
| `orientation` | `Orientation` | | The orientation of the menu. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string; }` |
### NwNavigationMenuTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNavigationMenuViewport
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `align` | `"end" \| "start" \| "center"` | | Placement of the viewport for css variables `(--reka-navigation-menu-viewport-left, --reka-navigation-menu-viewport-top)`. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwNumberField
Part of [Forms](../families/forms.md).
`NwNumberField` wraps Reka `NumberFieldRoot` and supplies decrement, input and increment parts by default. Compose the exported parts yourself when their order or labels need to change; a nested input inherits the root's `size`.
```vue title="NumberFieldDemo.vue"
{{ replicas }} of 9 replicas
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ----------------------------- | ------------------------------ | --------------------------- | ----------------------------------------- |
| Root `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Input height, inherited by a nested input |
| Root `label` | `string` | `'Value'` | Group and default input accessible name |
| Root `invalid` | `boolean` | `false` | `aria-invalid` on the default input |
| Decrement / Increment `label` | `string` | `'Decrease'` / `'Increase'` | Button accessible names |
Remaining `NumberFieldRootProps` and emits pass through, bounds, `step`, `formatOptions` and the numeric `v-model` included. The input uses tabular mono digits and the spinbutton role. ArrowUp and ArrowDown step the value, Home and End use the configured `min` and `max`, and a button disables itself at its bound. With a custom composition, label the input and carry its invalid state yourself.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwNumberField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `label` | `string` | `"Value"` | Accessible name of the group and of its default input. |
| `invalid` | `boolean` | | |
| `defaultValue` | `number` | | |
| `modelValue` | `number \| null` | | |
| `min` | `number` | | The smallest value allowed for the input. |
| `max` | `number` | | The largest value allowed for the input. |
| `step` | `number` | | The amount that the input value changes with each increment or decrement "tick". |
| `stepSnapping` | `boolean` | | When `false`, prevents the value from snapping to the nearest increment of the step value |
| `allowInvalid` | `boolean` | | When `true`, a typed value is kept as-is even if invalid (out of `min`/`max` range or off the step grid); step interactions still clamp and snap. |
| `focusOnChange` | `boolean` | | When `true`, the input will be focused when the value changes. |
| `formatOptions` | `Intl.NumberFormatOptions` | | Formatting options for the value displayed in the number field. |
| `locale` | `string` | | The locale to use for formatting and currencies |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the Number Field. |
| `readonly` | `boolean` | | When `true`, the Number Field is read-only. |
| `disableWheelChange` | `boolean` | | When `true`, prevents the value from changing on wheel scroll. |
| `invertWheelChange` | `boolean` | | When `true`, inverts the direction of the wheel change. |
| `id` | `string` | | Id of the element |
| `startingValue` | `number` | | The value the first increment or decrement sets when the field is empty. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[val: number \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: number \| undefined; textValue: string; readonly: boolean; }` |
### NwNumberFieldDecrement
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Decrease"` | Accessible name of the control. |
| `disabled` | `boolean` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNumberFieldIncrement
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Increase"` | Accessible name of the control. |
| `disabled` | `boolean` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwNumberFieldInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwPagination
Part of [Navigation](../families/navigation.md).
Page controls for a long list, wrapping Reka `Pagination`. Without a default slot it renders the full control set for you; with one, the list's slot provides the page items, including ellipses, so you render numbers and gaps yourself.
```vue title="PaginationDemo.vue"
```
```text title="Anatomy"
NwPagination
└─ NwPaginationList (slot: { items })
├─ NwPaginationFirst
├─ NwPaginationPrev
├─ NwPaginationListItem (value) | NwPaginationEllipsis
├─ NwPaginationNext
└─ NwPaginationLast
```
| Part | Prop | Type | Default | Effect |
| ------------------- | -------------- | ---------------------- | ----------------- | -------------------------------------------------- |
| `NwPagination` | `itemsPerPage` | `number` | `10` | Items on one page |
| | `total` | `number` | `0` | Number of items (Reka) |
| | `page` | `number` | none | Current page, `v-model:page` (Reka) |
| | `defaultPage` | `number` | `1` | Uncontrolled initial page (Reka) |
| | `siblingCount` | `number` | `2` | Pages shown on each side of the current one (Reka) |
| | `showEdges` | `boolean` | `false` | Always shows the first and last page (Reka) |
| | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size of every button |
| | `intent` | `NwIntent` | `'primary'` | Color of the current page |
| | `label` | `string` | `'Pagination'` | `aria-label` of the navigation landmark |
| | `disabled` | `boolean` | `false` | Disables every control (Reka) |
| `NwPaginationFirst` | `label` | `string` | `'First page'` | Accessible name of the icon button |
| `NwPaginationPrev` | `label` | `string` | `'Previous page'` | Accessible name of the icon button |
| `NwPaginationNext` | `label` | `string` | `'Next page'` | Accessible name of the icon button |
| `NwPaginationLast` | `label` | `string` | `'Last page'` | Accessible name of the icon button |
**Accessibility.** The root renders a `` named by `label`; name it after its list when a page has several. The current page carries `aria-current="page"`, and First and Previous are disabled on page 1 (Next and Last on the final page). Ellipses are `aria-hidden`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwPagination
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `itemsPerPage` | `number` | `10` | |
| `size` | `NavigationSize` | `"md"` | |
| `intent` | `NwIntent` | `"primary"` | |
| `label` | `string` | `"Pagination"` | |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with item |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `page` | `number` | | The controlled value of the current page. |
| `defaultPage` | `number` | | The value of the page that should be active when initially rendered. |
| `total` | `number` | | Number of items in your list |
| `siblingCount` | `number` | | Number of sibling should be shown around the current page |
| `showEdges` | `boolean` | | When `true`, always show first page, last page, and ellipsis |
| Event | Payload | Description |
| --- | --- | --- |
| `update:page` | `[value: number]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ page: number; pageCount: number; }` |
### NwPaginationEllipsis
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPaginationFirst
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"First page"` | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPaginationLast
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Last page"` | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPaginationList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `{ items: ({ type: "ellipsis"; } \| { type: "page"; value: number; })[]; }` |
### NwPaginationListItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number` | required | Value for the page |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPaginationNext
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Next page"` | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPaginationPrev
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Previous page"` | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwPinInput
Part of [Forms](../families/forms.md).
`NwPinInput` wraps Reka `PinInputRoot`. Add one `NwPinInputInput` per character, with zero-based indexes; a filled cell keeps a primary edge.
```vue title="PinInputDemo.vue"
{{
complete ? `Pairing with code ${code.join('')}` : 'Enter the code shown on the device.'
}}
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ---------------- | ------------------------------ | ------- | -------------------------------------------------------- |
| Root `class` | `HTMLAttributes['class']` | unset | Root styling; `PinInputRootProps` and emits pass through |
| Input `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Character cell dimensions |
Entering a character moves focus to the next cell, Backspace goes back, and pasting fills every cell. The root's `complete` event fires when the last cell is filled, as the demo shows. `mask` switches to password inputs, `type="number"` accepts digits only, `otp` enables one-time-code autofill, and `disabled` reaches every cell. Name the group and each cell. A PIN UI is not an authentication boundary on its own.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwPinInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `PinInputValue \| null` | | The controlled checked state of the pin input. |
| `defaultValue` | `PinInputValue` | | The default value of the pin inputs when it is initially rendered. |
| `placeholder` | `string` | | The placeholder character to use for empty pin-inputs. |
| `mask` | `boolean` | | When `true`, pin inputs will be treated as password. |
| `otp` | `boolean` | | When `true`, mobile devices will autodetect the OTP from messages or clipboard, and enable the autocomplete field. |
| `type` | `Type` | | Input type for the inputs. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the pin input |
| `id` | `string` | | Id of the element |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: PinInputValue]` | |
| `complete` | `[value: PinInputValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: PinInputValue; }` |
### NwPinInputInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `index` | `number` | required | Position of the value this input binds to. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the pin input |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwPopover
Part of [Overlays & menus](../families/overlays.md).
A non-modal, cut-corner panel anchored to its trigger, wrapping Reka `Popover`. Use it for small forms and details that do not need a dialog. It sits on the popover layer, so it also opens above a dialog.
```vue title="PopoverDemo.vue"
Route details
ams-01 to hel-01
Four hops, 23 ms round trip, MTU 1500.
Pin route
{{
pinned ? 'Route pinned' : 'Route not pinned'
}}
```
```text title="Anatomy"
NwPopover
├─ NwPopoverAnchor (optional: position against another element)
├─ NwPopoverTrigger
└─ NwPopoverContent
└─ NwPopoverClose (optional)
```
| `NwPopoverContent` prop | Type | Default | Effect |
| ----------------------- | ------------------------- | --------- | -------------------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Minimum width 12rem, 16rem or 22rem |
| `variant` | `'solid' \| 'glass'` | `'solid'` | `glass` blurs what is behind the panel |
| `arrow` | `boolean` | `false` | Draws an arrow pointing at the trigger |
| `showClose` | `boolean` | `false` | Renders an icon close button in the top-end corner |
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
| `sideOffset` | `number` | `6` | Distance from the trigger in px (Reka) |
| `arrowPadding` | `number` | `12` | Keeps the arrow away from the cut corners (Reka) |
| `class` | `HTMLAttributes['class']` | none | Merged onto the panel |
`side`, `align`, collision options and the other Reka `PopoverContent` props and emits pass through.
**Keyboard and accessibility.** The trigger toggles `aria-expanded`; opening moves focus into the content, and Escape closes it and returns focus to the trigger. Give the content an `aria-label` or a heading.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwPopover
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the popover when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the popover. |
| `modal` | `boolean` | | The modality of the popover. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; close: () => void; }` |
### NwPopoverAnchor
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `reference` | `ReferenceElement` | | The reference (or anchor) element that is being referred to for positioning. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPopoverClose
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPopoverContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | Minimum width preset: sm 12rem, md 16rem, lg 22rem. |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the panel. |
| `arrow` | `boolean` | `false` | Draw an arrow pointing at the trigger. |
| `showClose` | `boolean` | `false` | Render an icon close button in the top-end corner. |
| `closeLabel` | `string` | `"Close"` | Accessible name of the close button. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `6` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | `12` | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `dir` | `Direction` | | The reading direction of the popper content when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwPopoverTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwProgress
Part of [Actions & HUD](../families/actions.md).
`NwProgress` wraps Reka `ProgressRoot` and supplies the `ProgressIndicator`. Pass `null` or omit `modelValue` for an indeterminate operation.
```vue title="ProgressDemo.vue"
Advance
Reset
{{ value }}%
```
| Prop | Type | Default | Effect |
| ------------ | ------------------------------ | ----------- | ------------------------------------------- |
| `modelValue` | `number \| null` | unset | Current value; `null` is indeterminate |
| `max` | `number` | `100` | Scale of the indicator |
| `intent` | Intent | `'primary'` | Indicator tone |
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Track height |
| `glow` | `boolean` | `false` | Glow around the track |
| `label` | `string` | unset | `aria-label` when no visible label names it |
The remaining `ProgressRootProps` and emits pass through. Determinate progress exposes `role="progressbar"` with `aria-valuenow`; indeterminate progress omits the value and sweeps instead, or shows a steady tinted track under reduced motion. It takes no keyboard input and does not announce each change.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwProgress
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | |
| `size` | `NwSize` | | |
| `glow` | `boolean` | | Glow around the track. |
| `label` | `string` | | Accessible name when there is no visible label. |
| `modelValue` | `number \| null` | | The progress value. |
| `max` | `number` | | The maximum progress value. |
| `getValueLabel` | `((value: number \| null \| undefined, max: number) => string \| undefined)` | | A function to get the accessible label text in a human-readable format. |
| `getValueText` | `((value: number \| null \| undefined, max: number) => string \| undefined)` | | A function to get the accessible value text representing the current value in a human-readable format. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string[] \| undefined]` | |
| `update:max` | `[value: number]` | |
# NwProvider
Part of [Vue overview](../index.md).
`NwProvider` wraps Reka's `ConfigProvider`, `TooltipProvider` and `ToastProvider`, and renders one `div` that carries the scope. Put one at the root of every Vue app, and one in every Astro island, since each island is its own app.
| Prop | Default | Effect |
| ---------------- | --------- | ----------------------------------------------------------------------------- |
| `v-model:flavor` | inherited | Scopes a flavor to the subtree with `data-flavor` on the provider's wrapper |
| `v-model:accent` | inherited | Scopes an accent to the subtree with `data-accent` (`indigo`, `volt`, `ice`…) |
| `dir` | `'ltr'` | Reading direction for every Reka primitive, also set as `dir` on the wrapper |
| `locale` | `'en'` | Locale for every Reka primitive, dates included, also set as `lang` |
| `tooltipDelay` | `300` | Tooltip open delay in ms |
| `toastDuration` | `5000` | How long a toast stays visible, in ms |
A provider without `flavor` or `accent` inherits the nearest outer provider, or the flavor set on the document. Overlays read the nearest provider even when their content teleports out of the subtree, so a dialog opened from a `twilight` panel is `twilight` too. Other attributes (`class`, `id`, `data-*`) land on the wrapper. The provider also hands Vue's `useId` to Reka, so generated ids match between the server render and hydration, and it owns the toast queue that `useToast()` and `NwToaster` share.
```vue
Light preview with a volt accent
```
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwProvider
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `dir` | `"ltr" \| "rtl"` | `"ltr"` | |
| `locale` | `string` | `"en"` | |
| `toastDuration` | `number` | `5000` | |
| `tooltipDelay` | `number` | `300` | |
| `flavor` | `"abyss" \| "nocturne" \| "twilight" \| "lumen"` | | |
| `accent` | `"indigo" \| "iris" \| "flux" \| "synth" \| "alarm" \| "flare" \| "volt" \| "matrix" \| "circuit" \| "ice" \| "arc" \| "steel"` | | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:flavor` | `[value: "abyss" \| "nocturne" \| "twilight" \| "lumen" \| undefined]` | |
| `update:accent` | `[value: "indigo" \| "iris" \| "flux" \| "synth" \| "alarm" \| "flare" \| "volt" \| "matrix" \| "circuit" \| "ice" \| "arc" \| "steel" \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwFlavorSelect
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Flavor"` | |
| `disabled` | `boolean` | | |
| `modelValue` | `"abyss" \| "nocturne" \| "twilight" \| "lumen"` | | |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: "abyss" \| "nocturne" \| "twilight" \| "lumen"]` | |
# NwRadioGroup
Part of [Forms](../families/forms.md).
`NwRadioGroup` wraps Reka `RadioGroupRoot`; `NwRadioGroupItem` composes `RadioGroupItem`, `RadioGroupIndicator` and a label for its text slot. The checked ring keeps a dark face and glows around a lit core.
```vue title="RadioGroupDemo.vue"
Lowest latency
Lowest cost
Pinned route
Policy: {{ routing }}
```
## Anatomy
```vue
Lowest latency
Lowest cost
```
| Component / prop | Type | Default | Effect |
| ------------------- | ----------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
| Group `label` | `string` | unset | Accessible name of the group |
| Group `options` | `readonly NwOption[]` | unset | `{ value, label, disabled? }` items, rendered when the slot is empty |
| Group `orientation` | `'horizontal' \| 'vertical'` | vertical | Column, or a wrapping row |
| Item `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Ring and core dimensions |
| Item `intent` | `'primary' \| 'secondary' \| 'tertiary' \| 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Selected ring, core and glow |
| Item `invalid` | `boolean` | `false` | `aria-invalid`, danger ring |
Remaining `RadioGroupRootProps` and emits pass through; the item's `label` slot overrides its default slot. Tab enters the group on the selected radio. The arrow keys move focus and select the radio they land on, skipping disabled ones; Reka's roving focus alone would only move focus, so the group selects on arrow keys itself. Use `v-model` for the selected value, and `label`, `aria-label` or `aria-labelledby` for the question.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwRadioGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | | Accessible name of the group. |
| `options` | `readonly NwOption[]` | | Renders one NwRadioGroupItem per option when the default slot is empty. |
| `modelValue` | `AcceptableValue` | | The controlled value of the radio item to check. |
| `defaultValue` | `AcceptableValue` | | The value of the radio item that should be checked when initially rendered. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with radio items. |
| `orientation` | `DataOrientation` | | The orientation of the component. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: AcceptableValue \| undefined; }` |
### NwRadioGroupItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `intent` | `"info" \| "primary" \| "secondary" \| "tertiary" \| "neutral" \| "success" \| "warning" \| "danger"` | | |
| `invalid` | `boolean` | | |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the radio item. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `value` | `AcceptableValue` | | The value given as data when submitted with a `name`. |
| `id` | `string` | | |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent$2]` | |
| Slot | Props |
| --- | --- |
| `label` | |
| `default` | |
# NwRangeCalendar
Part of [Date & time](../families/datetime.md).
`NwRangeCalendar` wraps Reka `RangeCalendarRoot` with the same grid layout and selects a start and an end date. The days between the two endpoints get the range fill.
```vue title="RangeCalendarDemo.vue"
Freeze: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ------------------------------- | ------------------- | -------------------------------------- | ------------------------------------------ |
| `disableDaysOutsideCurrentView` | `boolean` | `true` | Disables outside-month dates |
| `modelValue` | `DateRange \| null` | uncontrolled | Controlled range |
| `defaultValue` | `DateRange` | `{ start: undefined, end: undefined }` | Initial range |
| `numberOfMonths` | `number` | `1` | Visible month count |
| `calendarLabel` | `string` | unset | Accessible name |
| `allowNonContiguousRanges` | `boolean` | `false` | Allows ranges containing unavailable dates |
| `maximumDays` | `number` | unset | Maximum range length |
| `fixedDate` | `'start' \| 'end'` | unset | Fixed endpoint |
| `minValue`, `maxValue` | `DateValue` | unset | Selectable bounds |
The other `RangeCalendarRootProps` and emits pass through, including the date matchers and the disabled and readonly states. The first click sets the start, the second sets the end, and the model is emitted once the range is complete.
**Keyboard and accessibility.** Navigation works as in `NwCalendar`: arrows move by day and week, PageUp and PageDown by month, and Enter selects an endpoint. Keep the header controls and the grid parts together when you compose your own layout, so the named navigation buttons stay in place.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwRangeCalendar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `defaultValue` | `DateRange` | | The default value for the calendar |
| `modelValue` | `DateRange \| null` | | The controlled selected date range of the calendar. |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what month to display when no date is selected. |
| `allowNonContiguousRanges` | `boolean` | | When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. |
| `pagedNavigation` | `boolean` | | This property causes the previous and next buttons to navigate by the number of months displayed at once, rather than one month |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `maximumDays` | `number` | | The maximum number of days that can be selected in a range |
| `weekStartsOn` | `WeekStartsOn` | | The day of the week to start the calendar on |
| `weekdayFormat` | `WeekDayFormat` | | The format to use for the weekday strings provided via the weekdays slot prop |
| `calendarLabel` | `string` | | The accessible label for the calendar |
| `fixedWeeks` | `boolean` | | Whether or not to always display 6 weeks in the calendar |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `numberOfMonths` | `number` | | The number of months to display at once |
| `disabled` | `boolean` | | Whether or not the calendar is disabled |
| `readonly` | `boolean` | | Whether or not the calendar is readonly |
| `initialFocus` | `boolean` | | If true, the calendar will focus the selected day, today, or the first day of the month depending on what is visible when the calendar is mounted |
| `isDateDisabled` | `Matcher` | | A function that returns whether or not a date is disabled |
| `isDateUnavailable` | `Matcher` | | A function that returns whether or not a date is unavailable |
| `isDateHighlightable` | `Matcher` | | A function that returns whether or not a date is hightable |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `nextPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the next page of the calendar. |
| `prevPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the previous page of the calendar. |
| `disableDaysOutsideCurrentView` | `boolean` | `true` | Whether or not to disable days outside the current view. |
| `fixedDate` | `"end" \| "start"` | | Which part of the range should be fixed |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateRange]` | |
| `update:placeholder` | `[date: DateValue]` | |
| `update:startValue` | `[date: DateValue \| undefined]` | |
| `update:validModelValue` | `[date: DateRange]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ date: DateValue; grid: Grid[]; weekDays: string[]; weekStartsOn: WeekStartsOn; locale: string; fixedWeeks: boolean; modelValue: DateRange; }` |
### NwRangeCalendarCell
Same component as `NwDateRangePickerCell`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `date` | `DateValue` | required | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwRating
Part of [Actions & HUD](../families/actions.md).
`NwRating` composes Reka `RatingRoot`, `RatingItem` and `RatingItemIndicator`. Readonly mode instead renders a single labelled `role="img"` and accepts fractional values.
```vue title="RatingDemo.vue"
```
| Prop | Type | Default | Effect |
| ------------ | ------------------------- | --------------------------------------- | ------------------------------------------------------ |
| `modelValue` | `number` | unset | `v-model`; emits `update:modelValue` |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Star dimensions |
| `readonly` | `boolean` | `false` | Display-only `role="img"` reading "3.5 out of 5 stars" |
| `label` | `string` | unset (interactive fallback `'Rating'`) | Accessible name |
| `length` | `number` | `5` | Number of stars |
| `step` | `RatingRootProps['step']` | `1` | Selection step |
The remaining Reka rating props and emits pass through, except `as` and `asChild`. Each star is named "N stars". Arrow keys move between stars and Space selects; readonly mode has no interactive stops. Label the rating with what is being rated.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwRating
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `NwRatingSize` | | |
| `readonly` | `boolean` | | Display only: a single role="img" element that accepts fractional values. |
| `label` | `string` | | Accessible name of the rating. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with radio items. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `orientation` | `DataOrientation` | | The orientation of the component. |
| `modelValue` | `number` | | The controlled rating value. |
| `defaultValue` | `number` | | The rating value when initially rendered. |
| `length` | `number` | `5` | The number of rating items to render. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `step` | `1 \| 0.5 \| 0.25 \| 0.1` | `1` | The granularity each rating item is divided into. |
| `clearable` | `boolean` | | When `true`, clicking the currently selected rating resets the value to `0`. |
| `hoverable` | `boolean` | | When `true`, the rating previews the value under the pointer on hover. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: number]` | |
# NwScrollArea
Part of [Navigation](../families/navigation.md).
A scroll container with themed, overlay scrollbars, wrapping Reka `ScrollArea`. You place the viewport and each scrollbar yourself.
```vue title="ScrollAreaDemo.vue"
{{
String(line.id).padStart(2, '0')
}} {{ line.text }}
```
```text title="Anatomy"
NwScrollArea
├─ NwScrollAreaViewport
├─ NwScrollAreaScrollbar (orientation)
│ └─ NwScrollAreaThumb
└─ NwScrollAreaCorner (when both scrollbars show)
```
| Prop | Type | Default | Effect |
| ----------------- | -------------------------------------------------------- | --------- | -------------------------------------------------------- |
| `type` | `'auto' \| 'always' \| 'scroll' \| 'hover' \| 'glimpse'` | `'hover'` | When the scrollbars are visible (Reka) |
| `scrollHideDelay` | `number` | `600` | Delay in ms before `scroll` and `hover` bars hide (Reka) |
`NwScrollAreaScrollbar` takes Reka's `orientation` (`'vertical'` by default).
**Keyboard and accessibility.** The scrollbars are visual only. Give the viewport `role="region"`, an `aria-label` and `tabindex="0"`, as in the demo, so it is a named stop in the tab order and the arrow, Page and Home/End keys scroll it.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwScrollArea
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `ScrollType` | | Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars. |
| `dir` | `Direction$2` | | The reading direction of the combobox when applicable. |
| `scrollHideDelay` | `number` | | If type is set to either `scroll` or `hover`, this prop determines the length of time, in milliseconds, before the scrollbars are hidden after the user stops interacting with scrollbars. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwScrollAreaCorner
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwScrollAreaScrollbar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"vertical" \| "horizontal"` | | The orientation of the scrollbar |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwScrollAreaThumb
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwScrollAreaViewport
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `nonce` | `string` | | Will add `nonce` attribute to the style tag which can be used by Content Security Policy. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSelect
Part of [Selection](../families/selection.md).
`NwSelect` wraps Reka `SelectRoot`. The trigger shows the current value. The content brings its own portal, viewport and scroll buttons. Reka renders a hidden native `` for a named root, so `NwSelect` passes Reka an empty `name` and submits the value through hidden inputs instead, one per selected value.
```vue title="SelectDemo.vue"
Routing zone
Reachable
Arc district
Circuit district
Flare district (locked)
Steel perimeter
Active zone: {{ zone }}
```
## Anatomy
```vue
```
`NwSelectContent` renders `NwSelectScrollUpButton` and `NwSelectScrollDownButton` itself. Both are also exported for custom content.
| Component / prop | Type | Default | Effect |
| --------------------- | -------------------------------- | ---------- | ----------------------------------------------------------------- |
| Root `class` | `HTMLAttributes['class']` | unset | Accepted by the interface; the root is renderless, so style parts |
| Root `name` | `string` | field name | Hidden input name; falls back to the surrounding `NwField` |
| Trigger `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Trigger height and padding |
| Trigger `invalid` | `boolean` | `false` | Danger edge and `aria-invalid` |
| Content `position` | `SelectContentProps['position']` | `'popper'` | `'popper'` or `'item-aligned'` positioning |
| Content `sideOffset` | `number` | `4` | Distance from the trigger in popper mode |
| Content `portalProps` | `SelectPortalProps` | unset | Portal configuration, including the destination |
In popper mode the content is at least as wide as the trigger and is capped at the available height. A disabled root, or a disabled surrounding field, disables the hidden inputs too.
**Keyboard and accessibility.** Label `NwSelectTrigger` with a `` or `aria-label`, because the placeholder is not its accessible name. ArrowDown, Enter or Space opens the list. Arrow keys move through the options and skip disabled ones. Typing jumps to a matching option, and Enter selects the highlighted one. Escape closes the list and returns focus to the trigger, which leaves the tab order while the list is open. The trigger exposes `aria-expanded` and the selected option exposes `aria-selected`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSelect
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` | | The controlled open state of the Select. |
| `defaultOpen` | `boolean` | | The open state of the select when it is initially rendered. |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The value of the select when initially rendered. |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the Select. |
| `nullableValue` | `string` | | The value of the hidden native select option when the model value is nullish. |
| `by` | `string \| ((a: AcceptableValue, b: AcceptableValue) => boolean)` | | Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `multiple` | `boolean` | | Whether multiple options can be selected or not. |
| `autocomplete` | `string` | | Native html input `autocomplete` attribute. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with Select |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue]` | |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string \| number \| bigint \| Record \| (string \| number \| bigint \| Record \| null)[] \| null \| undefined; open: boolean; }` |
### NwSelectContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `portalProps` | `SelectPortalProps` | | |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `position` | `"popper" \| "item-aligned"` | `"popper"` | The positioning mode to use `item-aligned (default)` - behaves similarly to a native MacOS menu by positioning content relative to the active item. |
| `bodyLock` | `boolean` | | The document.body will be lock, and scrolling will be disabled. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `memoDependencies` | `unknown[]` | | Reactive dependencies that should invalidate the memoized content subtree. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `4` | The distance in pixels from the trigger. |
| `sideFlip` | `boolean` | | Flip to the opposite side when colliding with boundary. |
| `align` | `"end" \| "start" \| "center"` | | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `alignFlip` | `boolean` | | Flip alignment when colliding with boundary. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | | The padding between the arrow and the edges of the content. |
| `hideShiftedArrow` | `boolean` | | When `true`, hides the arrow when it cannot be centered to the reference element. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| `disableUpdateOnLayoutShift` | `boolean` | | Whether to disable the update position for the content when the layout shifted. |
| `prioritizePosition` | `boolean` | | Force content to be position within the viewport. |
| `reference` | `ReferenceElement` | | The custom element or virtual element that will be set as the reference to position the floating element. |
| `dir` | `Direction` | | The reading direction of the popper content when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The value given as data when submitted with a `name`. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `textValue` | `string` | | Optional text used for typeahead purposes. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent$1]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectLabel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `for` | `string` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectScrollDownButton
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectScrollUpButton
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwSelectTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `disabled` | `boolean` | | |
| `reference` | `ReferenceElement` | | The reference (or anchor) element that is being referred to for positioning. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSelectValue
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `placeholder` | `string` | | The content that will be rendered inside the `SelectValue` when no `value` or `defaultValue` is set. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSeparator
Part of [Actions & HUD](../families/actions.md).
`NwSeparator` wraps Reka `Separator` for horizontal or vertical division, optionally with a centered label.
```vue title="SeparatorDemo.vue"
Primary uplink
Status
Logs
Settings
Wire lines
```
| Prop | Type | Default | Effect |
| ------------- | ---------------------------- | -------------- | --------------------------------------------- |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Direction |
| `label` | `string` | unset | Text in the middle of a horizontal separator |
| `wire` | `boolean` | `false` | Wire gradient line with a glow |
| `decorative` | `boolean` | `false` | Reka prop: hides it from assistive technology |
Without `decorative`, Reka renders `role="separator"` with `aria-orientation`; set `decorative` when the line is purely visual. A vertical separator stretches to its row, so give the parent a height.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | | Text shown in the middle of a horizontal separator. |
| `wire` | `boolean` | | Wire gradient line with a glow. |
| `orientation` | `DataOrientation` | | Orientation of the component. |
| `decorative` | `boolean` | | Whether or not the component is purely decorative. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
# NwSheet
Part of [Overlays & menus](../families/overlays.md).
A dialog docked to an edge of the viewport, for settings and secondary panels. Only `NwSheetContent` differs from the dialog: `NwSheet`, `NwSheetTrigger`, `NwSheetHeader`, `NwSheetBody`, `NwSheetFooter`, `NwSheetTitle`, `NwSheetDescription` and `NwSheetClose` are the dialog parts under sheet names. The wire hairline runs along the edge that faces the page.
```vue title="SheetDemo.vue"
Uplinks ({{ side }})
Uplinks
Four uplinks configured, one degraded.
ams-01: 10 Gbit/s, healthy
fra-02: 10 Gbit/s, draining
hel-01: 1 Gbit/s, healthy
waw-03: 1 Gbit/s, packet loss 2%
Done
```
| `NwSheetContent` prop | Type | Default | Effect |
| --------------------- | ---------------------------------------- | --------- | -------------------------------------------------------------------------- |
| `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'right'` | Edge it docks to; side panels are at most 26rem wide, top and bottom 85dvh |
| `showClose` | `boolean` | `true` | Renders the icon close button |
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
| `class` | `HTMLAttributes['class']` | none | Merged onto the panel |
Keyboard behavior is the dialog's: focus is trapped, and Escape or the close button closes the sheet and returns focus to the trigger.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSheet
Same component as `NwDialog`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` | | The controlled open state of the dialog. |
| `defaultOpen` | `boolean` | | The open state of the dialog when it is initially rendered. |
| `modal` | `boolean` | | The modality of the dialog When set to `true`, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. |
| `unmountOnHide` | `boolean` | | When set to `false`, the dialog content will not be unmounted when closed, but instead hidden with CSS. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; close: () => void; }` |
### NwSheetBody
Same component as `NwDialogBody`, `NwDrawerBody`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetClose
Same component as `NwDialogClose`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | Viewport edge the panel docks to. |
| `showClose` | `boolean` | `true` | Render the close button in the top-end corner. |
| `closeLabel` | `string` | `"Close"` | Accessible name of the close button. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `disableOutsidePointerEvents` | `boolean` | | When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: PointerDownOutsideEvent]` | |
| `focusOutside` | `[event: FocusOutsideEvent]` | |
| `interactOutside` | `[event: PointerDownOutsideEvent \| FocusOutsideEvent]` | |
| `openAutoFocus` | `[event: Event]` | |
| `closeAutoFocus` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetDescription
Same component as `NwDialogDescription`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetFooter
Same component as `NwDialogFooter`, `NwDrawerFooter`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetHeader
Same component as `NwDialogHeader`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetTitle
Same component as `NwDialogTitle`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSheetTrigger
Same component as `NwDialogTrigger`.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSidenav
Part of [Navigation](../families/navigation.md).
A Nyxwire-only vertical navigation for an application or docs sidebar: a `` landmark holding lists of links, optionally split into labelled groups.
```vue title="SidenavDemo.vue"
{{ link }}
```
```text title="Anatomy"
NwSidenav (nav)
└─ NwSidenavGroup (label)
└─ NwSidenavList (ul)
└─ NwSidenavItem (li)
└─ NwSidenavLink (a, current)
```
| Part | Prop | Type | Default | Effect |
| ---------------- | --------- | --------------------------------------------------------------- | -------- | ----------------------------------------------------------- |
| `NwSidenav` | `label` | `string` | required | `aria-label` of the navigation landmark |
| | `items` | `readonly { href: string; label: string; current?: boolean }[]` | none | Renders a single list from data instead of the default slot |
| `NwSidenavGroup` | `label` | `string` | required | Visible heading that names the group |
| `NwSidenavLink` | `href` | `string` | none | Link target |
| | `current` | `boolean` | `false` | Sets `aria-current="page"` and highlights the link |
`NwSidenavList`, `NwSidenavItem` and `NwSidenavLink` take `as` and `as-child`.
**Accessibility.** Each group is a `role="group"` labelled by its visible heading, so screen readers announce "Traffic, group" before its links. The current link carries `aria-current="page"`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSidenav
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | required | |
| `items` | `readonly NwSidenavEntry[]` | | Renders one link per entry; without it the default slot holds lists and groups. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSidenavGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | required | Visible heading that names the group. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSidenavItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"li"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSidenavLink
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` | | |
| `current` | `boolean` | | Marks the link as the current page. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"a"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwSidenavList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"ul"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSkeleton
Part of [Actions & HUD](../families/actions.md).
`NwSkeleton` renders Reka `Primitive` as an `aria-hidden` placeholder with a primary shimmer.
```vue title="SkeletonDemo.vue"
North relay
12 ms · 99.98% uptime
{{ loading ? 'Show content' : 'Show placeholders' }}
```
| Prop | Type | Default | Effect |
| -------- | --------------------------------------------------- | --------- | ----------------------------------------------------------------------- |
| `shape` | `'block' \| 'text' \| 'line' \| 'circle' \| 'rect'` | `'block'` | Full-width block, 1em text, 1rem line, 2.5rem circle, or cut 16:9 media |
| `static` | `boolean` | `false` | Turns the shimmer off; reduced motion always does |
| `as` | `PrimitiveProps['as']` | `'div'` | Placeholder element |
Skeletons are invisible to assistive technology, so announce the loading state elsewhere (a status message or `aria-busy` on the region). Size placeholders like the content they stand for to avoid layout shift.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSkeleton
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `shape` | `NwSkeletonShape` | | |
| `static` | `boolean` | | Turns the shimmer sweep off; reduced motion always does. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"div"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSlider
Part of [Forms](../families/forms.md).
`NwSlider` wraps Reka `SliderRoot` and supplies a sunken track, a wire-gradient range and one glowing diamond thumb per value. Its default slot can replace that composition.
```vue title="SliderDemo.vue"
Uplink gain: {{ gain[0] }}
Latency window: {{ latency[0] }} to {{ latency[1] }} ms
```
| Prop | Type | Default | Effect |
| ------------- | ---------------------- | ------- | -------------------------------------------------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Track and thumb dimensions |
| `label` | `string` | unset | Names an unnamed thumb; a range numbers its thumbs after it (`Gain 1`, `Gain 2`) |
| `thumbLabels` | `readonly string[]` | unset | Each thumb's accessible name, in order; wins over `label` |
Without either, thumbs are named `Value 1`, `Value 2` and so on. Remaining `SliderRootProps` and emits pass through, `min`, `max`, `step` and `orientation` included. The model is an array, even for one thumb; give a range two values, as the demo does. Arrow keys step the focused thumb, Page Up and Page Down take bigger steps, and Home and End jump to the bounds. Each thumb exposes `aria-valuenow`. A disabled slider removes its thumbs from the tab order. Keep a numeric field next to it when exact entry matters.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSlider
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `thumbLabels` | `readonly string[]` | | Accessible name of each thumb, in order. |
| `label` | `string` | | Names an unnamed thumb; a range numbers its thumbs after it. |
| `defaultValue` | `number[]` | | The value of the slider when initially rendered. |
| `modelValue` | `number[] \| null` | | The controlled value of the slider. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the slider. |
| `orientation` | `DataOrientation` | | The orientation of the slider. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `inverted` | `boolean` | | Whether the slider is visually inverted. |
| `min` | `number` | | The minimum value for the range. |
| `max` | `number` | | The maximum value for the range. |
| `step` | `number` | | The stepping interval. |
| `minStepsBetweenThumbs` | `number` | | The minimum permitted steps between multiple thumbs. |
| `thumbAlignment` | `ThumbAlignment` | | The alignment of the slider thumb. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: number[] \| undefined]` | |
| `valueCommit` | `[payload: number[]]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: number[] \| null; }` |
# NwSpinner
Part of [Actions & HUD](../families/actions.md).
`NwSpinner` is a native `span` with `role="status"` and a visually hidden label, or a decorative span when another element owns the announcement, as in `NwButton`'s `loading` state.
```vue title="LoadingDemo.vue"
Sync now
Cancel
```
| Prop | Type | Default | Effect |
| ------------ | -------------------------------------- | ----------- | ------------------------------------------------------------ |
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Spinner dimensions |
| `intent` | Intent or `'current'` | `'current'` | Spinner color; `current` follows the text color |
| `label` | `string` | `'Loading'` | Screen-reader status text |
| `decorative` | `boolean` | `false` | Drops the status role and hides it from assistive technology |
A spinner does not take focus. Name the operation (`Loading relays`) rather than mounting several identical "Loading" statuses. Under `prefers-reduced-motion` it stops rotating and shows a static arc; the status text still carries the busy state.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSpinner
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `NwSpinnerSize` | | |
| `intent` | `NwSpinnerIntent` | | Ink of the spinner; `current` follows the text color. |
| `label` | `string` | `"Loading"` | Announced through the status role. |
| `decorative` | `boolean` | | Purely visual (no status role); for controls that carry their own busy state. |
# NwSplitterGroup
Part of [Navigation](../families/navigation.md).
Resizable panels, wrapping Reka `Splitter`. Sizes are percentages of the group unless a panel sets `size-unit="px"`. The handle shows a grip and is a focusable separator.
```vue title="SplitterDemo.vue"
Relay list
Topology map. Focus the grip and use the arrow keys to resize.
```
```text title="Anatomy"
NwSplitterGroup (direction)
├─ NwSplitterPanel
├─ NwSplitterResizeHandle
└─ NwSplitterPanel
```
| Part | Prop | Type | Default | Effect |
| ------------------------ | ------------------ | ---------------------------- | ----------------- | --------------------------------------------------- |
| `NwSplitterGroup` | `direction` | `'horizontal' \| 'vertical'` | required | Panels side by side or stacked (Reka) |
| | `keyboardResizeBy` | `number \| null` | `10` | Arrow-key step (Reka) |
| | `autoSaveId` | `string \| null` | `null` | Saves the layout in `localStorage` (Reka) |
| `NwSplitterPanel` | `defaultSize` | `number` | none | Initial size (Reka) |
| | `minSize` | `number` | `10` | Smallest size (Reka) |
| | `maxSize` | `number` | `100` | Largest size (Reka) |
| | `collapsible` | `boolean` | `false` | Collapses below `minSize` to `collapsedSize` (Reka) |
| `NwSplitterResizeHandle` | `label` | `string` | `'Resize panels'` | `aria-label` of the separator |
The group and panel emits (`@layout`, `@resize`, `@collapse`, `@expand`) pass through.
**Keyboard.** Tab focuses the handle; arrow keys resize the panels by `keyboardResizeBy`. Name each handle after what it resizes when a page has several.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSplitterGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string \| null` | | Group id; falls back to `useId` when not provided. |
| `autoSaveId` | `string \| null` | | Unique id used to auto-save group arrangement via `localStorage`. |
| `direction` | `Direction$1` | required | The group orientation of splitter. |
| `keyboardResizeBy` | `number \| null` | | Step size when arrow key was pressed. |
| `storage` | `PanelGroupStorage` | | Custom storage API; defaults to localStorage |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `layout` | `[val: number[]]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ layout: number[]; }` |
### NwSplitterPanel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `collapsedSize` | `number` | | The size of panel when it is collapsed; interpreted using `sizeUnit`. |
| `collapsible` | `boolean` | | Should panel collapse when resized beyond its `minSize`. |
| `defaultSize` | `number` | | Initial size of panel, interpreted using `sizeUnit` (percent by default). |
| `id` | `string` | | Panel id (unique within group); falls back to `useId` when not provided |
| `maxSize` | `number` | | The maximum allowable size of panel, interpreted using `sizeUnit`; defaults to `100` (percent). |
| `minSize` | `number` | | The minimum allowable size of panel, interpreted using `sizeUnit`; defaults to `10` (percent). |
| `order` | `number` | | The order of panel within group; required for groups with conditionally rendered panels |
| `sizeUnit` | `"%" \| "px"` | | Unit used for sizing values; `%` by default, or `px` for fixed sizing. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `collapse` | `[]` | |
| `expand` | `[]` | |
| `resize` | `[size: number, prevSize: number \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ isCollapsed: boolean; isExpanded: boolean; collapse: () => void; expand: () => void; resize: (size: number) => void; }` |
### NwSplitterResizeHandle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Resize panels"` | |
| `id` | `string` | | Resize handle id (unique within group); falls back to `useId` when not provided |
| `hitAreaMargins` | `PointerHitAreaMargins` | | Allow this much margin when determining resizable handle hit detection |
| `tabindex` | `number` | | Tabindex for the handle |
| `disabled` | `boolean` | | Disable drag handle |
| `nonce` | `string` | | Will add `nonce` attribute to the style tag which can be used by Content Security Policy. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `dragging` | `[isDragging: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | |
# NwStat
Part of [Actions & HUD](../families/actions.md).
`NwStat` is a description list (`dl`) that pairs a label with a headline value and an optional detail line.
```vue title="StatDemo.vue"
Show {{ windows[1 - index]?.label }}
```
| Prop | Type | Default | Effect |
| -------- | ------------------ | -------- | --------------------- |
| `label` | `string` | required | Term (`dt`) |
| `value` | `string \| number` | required | Headline value (`dd`) |
| `detail` | `string` | unset | Secondary line (`dd`) |
Format numbers before passing them (units, separators). Stats are static text: updates are not announced unless you wrap them in a live region.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwStat
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | required | |
| `value` | `string \| number` | required | |
| `detail` | `string` | | |
# NwStepper
Part of [Navigation](../families/navigation.md).
Progress through ordered steps, wrapping Reka `Stepper`. The root's slot exposes `nextStep`, `prevStep`, `isFirstStep` and `isLastStep`; each item's slot exposes its `state`. The indicator shows the step number, then a check once the step is completed.
```vue title="StepperDemo.vue"
{{ stage.title }}
{{ stage.description }}
Previous
Next stage
```
```text title="Anatomy"
NwStepper
└─ NwStepperItem (step; slot: { state })
├─ NwStepperTrigger
│ ├─ NwStepperIndicator (number, or a check when completed)
│ └─ NwStepperTitle
├─ NwStepperDescription
└─ NwStepperSeparator
```
| Part | Prop | Type | Default | Effect |
| -------------------- | ---------------- | --------------------------------------- | -------------- | ---------------------------------------------------------------------------- |
| `NwStepper` | `modelValue` | `number` | none | Active step, `v-model` (Reka) |
| | `defaultValue` | `number` | `1` | Uncontrolled initial step (Reka) |
| | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout and arrow-key axis (Reka) |
| | `linear` | `boolean` | `true` | Steps must be completed in order (Reka) |
| | `intent` | `NwIntent` | `'primary'` | Color of the active and completed indicators |
| | `items` | `readonly (string \| NwStepperEntry)[]` | none | Renders one step per entry: a title, or `{ title, description?, disabled? }` |
| `NwStepperItem` | `step` | `number` | required | Position of the step (Reka) |
| | `disabled` | `boolean` | `false` | Skips the step (Reka) |
| `NwStepperIndicator` | `completedLabel` | `string` | `'Completed:'` | Announced before the title of a completed step |
**Keyboard and accessibility.** Arrow keys move focus between step triggers, Enter or Space activates one. In a linear stepper a later step cannot be reached before the earlier ones; moving forward marks earlier steps `completed`. Each trigger is named by its visible indicator and title, so a completed step reads "Completed: Provision".
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwStepper
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | `"primary"` | |
| `items` | `readonly (string \| NwStepperEntry)[]` | | Renders one step per entry; a string is a title without description. |
| `defaultValue` | `number` | | The value of the step that should be active when initially rendered. |
| `orientation` | `DataOrientation` | | The orientation the steps are laid out. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `modelValue` | `number` | | The controlled value of the step to activate. |
| `linear` | `boolean` | | Whether or not the steps must be completed in order. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: number \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: number \| undefined; totalSteps: number; isNextDisabled: boolean; isPrevDisabled: boolean; isFirstStep: boolean; isLastStep: boolean; goToStep: (step: number) => void; nextStep: () => void; prevStep: () => void; hasNext: () => boolean; hasPrev: () => boolean; }` |
### NwStepperDescription
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwStepperIndicator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `completedLabel` | `string` | `"Completed:"` | Announced before the title of a completed step, where the number gives way to a check. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `{ step: number; }` |
### NwStepperItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `step` | `number` | required | A unique value that associates the stepper item with an index |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the step. |
| `completed` | `boolean` | | Shows whether the step is completed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `{ state: StepperState; }` |
### NwStepperSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `DataOrientation` | | Orientation of the component. |
| `decorative` | `boolean` | | Whether or not the component is purely decorative. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwStepperTitle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwStepperTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwSwitch
Part of [Forms](../families/forms.md).
`NwSwitch` wraps Reka `SwitchRoot` and supplies `SwitchThumb`: a chamfered track with a square thumb, filled and glowing in the intent ink when on.
```vue title="SwitchDemo.vue"
Telemetry is {{ telemetry ? 'streaming' : 'paused' }}.
```
| Prop | Type | Default | Effect |
| --------- | ----------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Track and thumb dimensions |
| `intent` | `'primary' \| 'secondary' \| 'tertiary' \| 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | On-state fill and glow |
| `invalid` | `boolean` | `false` | `aria-invalid`, danger edge |
| `label` | `string` | unset | Renders a visible label after the switch |
Remaining `SwitchRootProps` and emits pass through. `v-model` is the on/off value; Space or a click on the label toggles it and updates `aria-checked`. The thumb travels the other way under `dir="rtl"` and does not animate under reduced motion. Name the setting, not its current state: "Live telemetry", not "Telemetry on".
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwSwitch
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `intent` | `"info" \| "primary" \| "secondary" \| "tertiary" \| "neutral" \| "success" \| "warning" \| "danger"` | | |
| `invalid` | `boolean` | | |
| `label` | `string` | | Renders a visible label after the switch. |
| `defaultValue` | `boolean` | | The state of the switch when it is initially rendered. |
| `modelValue` | `boolean \| null` | | The controlled state of the switch. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the switch. |
| `id` | `string` | | |
| `value` | `string` | | The value given as data when submitted with a `name`. |
| `trueValue` | `boolean` | | The value used when the switch is on. |
| `falseValue` | `boolean` | | The value used when the switch is off. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: boolean]` | |
# NwTable
Part of [Actions & HUD](../families/actions.md).
`NwTable` and its parts render Reka `Primitive` with native table elements. The root adds a horizontal scroll wrapper, not a grid keyboard model or a sorting engine.
```vue title="TableDemo.vue"
Relay
Latency
Status
{{ relay.name }}
{{ relay.latency }} ms
{{
relay.healthy ? 'Healthy' : 'Down'
}}
3 relays · north-1 is pinned
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ----------------------------------- | --------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
| Table `striped`, `hover`, `compact` | `boolean` | `false` | Alternate rows, hover fill, reduced padding |
| Table `caption` | `string` | unset | Renders an `NwTableCaption` and turns the scroll wrapper into a named, focusable region |
| Table `as` | `PrimitiveProps['as']` | `'table'` | Table element |
| TableHead `sort` | `'ascending' \| 'descending' \| 'none'` | unset | `aria-sort` and direction icon |
| TableRow `selected` | `boolean` | `false` | Selection bar, `data-selected` and `aria-selected` |
Keep a caption and column headings (`NwTableHead` sets `scope="col"`). With `caption`, the wrapper is a tab stop so keyboard users can scroll a wide table. `sort` only describes the order: put a button in the heading, as the demo does, and sort your rows. Do not make a clickable row the only way to open a record.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTable
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `striped` | `boolean` | | |
| `hover` | `boolean` | | Highlights the row under the pointer. |
| `compact` | `boolean` | | Tighter cell padding and smaller text. |
| `caption` | `string` | | Renders an NwTableCaption and names the scrollable region, which becomes keyboard focusable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"table"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableBody
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"tbody"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableCaption
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"caption"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableCell
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"td"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableFooter
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"tfoot"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableHead
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `sort` | `"ascending" \| "descending" \| "none"` | | Sort state of the column: sets aria-sort and shows the direction icon. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"th"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableHeader
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"thead"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTableRow
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `selected` | `boolean` | | Marks the row selected with aria-selected and the selection bar. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | `"tr"` | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTabs
Part of [Navigation](../families/navigation.md).
Switches between panels in place, wrapping Reka `Tabs`. Add `NwTabsIndicator` inside the list for the sliding wire underline or segment.
```vue title="TabsDemo.vue"
Traffic
Peers
Capture
4.2 Gbit/s in, 3.9 Gbit/s out, peak at 21:40 UTC.
ams-01, hel-01 and waw-03 are peered over WireGuard.
```
```text title="Anatomy"
NwTabs
├─ NwTabsList
│ ├─ NwTabsTrigger (value)
│ └─ NwTabsIndicator
└─ NwTabsContent (value)
```
| Prop | Type | Default | Effect |
| ---------------- | ----------------------------------------------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------- |
| `modelValue` | `string \| number` | none | Active tab, `v-model` |
| `defaultValue` | `string \| number` | none | Uncontrolled initial tab; with `items`, the first enabled one |
| `variant` | `'line' \| 'segment'` | `'line'` | Underline under the list, or a segmented control |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Trigger height and text size |
| `intent` | `'primary' \| 'secondary' \| 'tertiary' \| 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Color of the indicator and the active trigger |
| `stretch` | `boolean` | `false` | Triggers share the list width equally |
| `items` | `readonly NwOption[]` | none | Renders one tab per `{ value, label, disabled? }`; panels are named slots |
| `label` | `string` | none | Accessible name of the list generated from `items` |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Vertical tabs put the list beside the panels (Reka) |
| `activationMode` | `'automatic' \| 'manual'` | `'automatic'` | `manual` waits for Enter or Space before switching (Reka) |
| `unmountOnHide` | `boolean` | `true` | Removes hidden panels from the DOM (Reka) |
**Keyboard and accessibility.** The list has the `tablist` role and each trigger is a `tab` linked to its `tabpanel`, with `aria-selected` on the active one. Arrow keys move along the list, skip disabled tabs and, in automatic mode, activate the tab they land on. Name the list with `aria-label` (or `label` with `items`). The indicator is `aria-hidden`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTabs
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `TabsVariant` | `"line"` | |
| `size` | `NavigationSize` | `"md"` | |
| `stretch` | `boolean` | `false` | |
| `intent` | `NwIntent` | `"primary"` | |
| `items` | `readonly NwOption[]` | | Renders one tab per option; each panel's content comes from the slot named after its value. |
| `label` | `string` | | Accessible name of the generated tab list. |
| `defaultValue` | `StringOrNumber` | | The value of the tab that should be active when initially rendered. |
| `orientation` | `DataOrientation` | | The orientation the tabs are laid out. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `activationMode` | `"automatic" \| "manual"` | | Whether a tab is activated automatically (on focus) or manually (on click). |
| `modelValue` | `StringOrNumber` | | The controlled value of the tab to activate. |
| `unmountOnHide` | `boolean` | | When `true`, the element will be unmounted on closed state. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: StringOrNumber]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string \| number \| undefined; }` |
### NwTabsContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `StringOrNumber` | required | A unique value that associates the content with a trigger. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTabsIndicator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTabsList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last tab to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTabsTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `StringOrNumber` | required | A unique value that associates the trigger with a content. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the tab. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTagGroup
Part of [Forms](../families/forms.md).
`NwTagGroup` wraps Reka `TagGroupRoot` for selecting and removing existing tags. Unlike tags input, it has no text entry. A selected tag lights its cut edge and fills with the soft primary.
```vue title="TagGroupDemo.vue"
{{ node }}
Draining: {{ selected.join(', ') || 'none' }}
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------ | ------------------------- | ---------- | ------------------------------------------------------------------ |
| Root `class` | `HTMLAttributes['class']` | unset | Root styling; remaining `TagGroupRootProps` and emits pass through |
| ItemDelete `label` | `string` | `'Remove'` | Delete control name |
The root model holds the selected values; `selection-mode` is `'single'` or `'multiple'`. Tags are removable only while the root has a `@remove` listener, and the event hands you the values to drop from your own list, as in the demo. The arrow keys move between tags, Space or Enter toggles the selection, and Delete or Backspace removes the focused tag. Label the group, give each item readable text with `text-value`, and disable locked tags instead of hiding them.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTagGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the selected tag(s). |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The value of the selected tag(s) when initially rendered. |
| `selectionMode` | `TagGroupSelectionMode` | | The type of selection that is allowed. |
| `disallowEmptySelection` | `boolean` | | When `true`, the user cannot deselect the last selected tag. |
| `escapeKeyBehavior` | `"none" \| "clearSelection"` | | Whether pressing Escape clears the selection. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the tag group and all its tags. |
| `dir` | `Direction` | | The reading direction of the tag group when applicable. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last tag to first, and vice versa. |
| `by` | `string \| ((a: AcceptableValue, b: AcceptableValue) => boolean)` | | Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: AcceptableValue \| AcceptableValue[] \| undefined]` | |
| `remove` | `[values: AcceptableValue[]]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: string \| number \| bigint \| Record \| (string \| number \| bigint \| Record \| null)[] \| null \| undefined; }` |
### NwTagGroupItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableValue` | required | The unique value of the tag. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the tag. |
| `textValue` | `string` | | A string representation of the tag's contents, used for typeahead and as the tag's accessible name. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | `{ selected: boolean; disabled: boolean; }` |
### NwTagGroupItemDelete
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Remove"` | Accessible name of the control. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the delete button. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTagGroupItemText
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTagsInput
Part of [Forms](../families/forms.md).
`NwTagsInput` wraps Reka `TagsInputRoot` for editing a list of values. Text, delete and clear parts keep the chamfered tags tied to the root model; the box takes the wire edge while its input has focus.
```vue title="TagsInputDemo.vue"
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------ | ---------------------- | -------------- | ----------------------- |
| Root `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Box and type dimensions |
| ItemDelete `label` | `string` | `'Remove tag'` | Delete control name |
| Clear `label` | `string` | `'Clear tags'` | Clear control name |
Remaining generic `TagsInputRootProps` and emits pass through; `T` is `string` by default and can also be a number, a bigint or a record. Enter adds the typed tag, and `delimiter` or `addOnPaste` add more ways in. Backspace in an empty input selects the last tag and a second Backspace removes it; the arrow keys move between tags. The delete part removes its value and Clear empties the model; both disable with the root. Give removals value-specific names, as the demo does, and label the text input separately from its placeholder.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTagsInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `modelValue` | `T[] \| null` | | The controlled value of the tags input. |
| `defaultValue` | `T[]` | | The value of the tags that should be added. |
| `addOnPaste` | `boolean` | | When `true`, allow adding tags on paste. |
| `addOnTab` | `boolean` | | When `true` allow adding tags on tab keydown |
| `addOnBlur` | `boolean` | | When `true` allow adding tags blur input |
| `duplicate` | `boolean` | | When `true`, allow duplicated tags. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the tags input. |
| `delimiter` | `string \| RegExp` | | The character or regular expression to trigger the addition of a new tag. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `max` | `number` | | Maximum number of tags. |
| `id` | `string` | | |
| `convertValue` | `((value: string) => T)` | | Convert the input value to the desired type. |
| `displayValue` | `((value: T) => string)` | | Display the value of the tag. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: T[]]` | |
| `invalid` | `[payload: T]` | |
| `addTag` | `[payload: T]` | |
| `removeTag` | `[payload: T]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: AcceptableInputValue[]; }` |
### NwTagsInputClear
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Clear tags"` | Accessible name of the control. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTagsInputInput
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `placeholder` | `string` | | The placeholder character to use for empty tags input. |
| `autoFocus` | `boolean` | | Focus on element when mounted. |
| `maxLength` | `number` | | Maximum number of character allowed. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTagsInputItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `AcceptableInputValue` | required | Value associated with the tags |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the tags input. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTagsInputItemDelete
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Remove tag"` | Accessible name of the control. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTagsInputItemText
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTextarea
Part of [Forms](../families/forms.md).
`NwTextarea` renders a native textarea through Reka `Primitive`, or `FieldControl` inside a field, with three rows by default. `autoResize` measures the control on mount and on every change, growing it with the content.
```vue title="TextareaDemo.vue"
Change notes
```
| Prop | Type | Default | Effect |
| -------------- | ------------------------------ | ----------------------- | ----------------------------------------------- |
| `modelValue` | `string \| number` | unset | Controlled text |
| `defaultValue` | `string \| number` | `''` effective fallback | Initial text |
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Minimum height and type size |
| `invalid` | `boolean` | `false` | `aria-invalid` |
| `autoResize` | `boolean` | `false` | Content-driven height; disables manual resizing |
It emits `update:modelValue`; native textarea attributes, `rows` included, pass through. Enter inserts a line break, so do not use it as a form-wide submit shortcut. Label the control and let Tab move to the next field.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTextarea
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `string \| number` | | |
| `defaultValue` | `string \| number` | | |
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `autoResize` | `boolean` | | Grows the textarea with its content instead of scrolling. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: string \| number]` | |
# NwTimeField
Part of [Date & time](../families/datetime.md).
`NwTimeField` wraps Reka `TimeFieldRoot` and renders an `NwTimeFieldInput` for each formatted time segment.
```vue title="TimeFieldDemo.vue"
Failover: {{ value?.toString() ?? 'none' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------- | -------------------------------- | ----------------- | ------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Invalid appearance and `aria-invalid` |
| `modelValue` | `TimeValue \| null` | unset | Controlled time |
| `defaultValue` | `TimeValue` | unset | Initial time |
| `hourCycle` | `12 \| 24` | locale preference | Hour display |
| `granularity` | `'hour' \| 'minute' \| 'second'` | `'minute'` | Last displayed segment |
| `minValue`, `maxValue` | `TimeValue` | unset | Time bounds |
| `disabled`, `readonly` | `boolean` | `false` | Interaction / editing lock |
The other `TimeFieldRootProps` and emits pass through. The demo uses 24-hour entry. Without `hour-cycle`, the locale decides, and a 12-hour field adds an AM/PM segment.
**Keyboard and accessibility.** Name the field with `aria-label`. ArrowUp and ArrowDown step the focused segment, and typing digits replaces it. A time value says nothing about time zones, so decide whether it means server time or local time before you store it.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTimeField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `defaultValue` | `TimeValue` | | The default value for the calendar |
| `defaultPlaceholder` | `TimeValue` | | The default placeholder date |
| `placeholder` | `TimeValue` | | The placeholder date, which is used to determine what time to display when no time is selected. |
| `modelValue` | `TimeValue \| null` | | The controlled checked state of the field. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `stepSnapping` | `boolean` | | Whether to enforce snapping the value to the nearest step increment after input. |
| `granularity` | `"hour" \| "minute" \| "second"` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `maxValue` | `TimeValue` | | The maximum date that can be selected |
| `minValue` | `TimeValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether or not the time field is disabled |
| `readonly` | `boolean` | | Whether or not the time field is readonly |
| `id` | `string` | | Id of the element |
| `dir` | `Direction` | | The reading direction of the time field when applicable. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: TimeValue \| undefined]` | |
| `update:placeholder` | `[date: TimeValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: TimeValue \| undefined; segments: { part: SegmentPart; value: string; }[]; isInvalid: boolean; }` |
# NwTimeRangeField
Part of [Date & time](../families/datetime.md).
`NwTimeRangeField` wraps Reka `TimeRangeFieldRoot` for a start time and an end time, separated by an en dash.
```vue title="TimeRangeFieldDemo.vue"
Quiet hours: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| ---------------------- | -------------------------------- | ----------------- | ------------------------------------- |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field dimensions |
| `invalid` | `boolean` | `false` | Invalid appearance and `aria-invalid` |
| `modelValue` | `TimeRange \| null` | uncontrolled | Controlled endpoints |
| `defaultValue` | `TimeRange` | unset | Initial range |
| `hourCycle` | `12 \| 24` | locale preference | Hour display |
| `granularity` | `'hour' \| 'minute' \| 'second'` | `'minute'` | Last displayed segment |
| `disabled`, `readonly` | `boolean` | `false` | Interaction / editing lock |
The other `TimeRangeFieldRootProps` and emits pass through. You can change the end without moving the start.
**Keyboard and accessibility.** Name the whole range, and keep `type="start"` and `type="end"` on the inputs when you compose them yourself. Segments follow the same keys as `NwTimeField`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTimeRangeField
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"sm" \| "md" \| "lg"` | | |
| `invalid` | `boolean` | | |
| `defaultValue` | `TimeRange` | | The default value for the field |
| `defaultPlaceholder` | `TimeValue` | | The default placeholder time |
| `placeholder` | `TimeValue` | | The placeholder time, which is used to determine what time to display when no time is selected. |
| `modelValue` | `TimeRange \| null` | | The controlled checked state of the field. |
| `hourCycle` | `HourCycle` | | The hour cycle used for formatting times. |
| `step` | `DateStep` | | The stepping interval for the time fields. |
| `granularity` | `"hour" \| "minute" \| "second"` | | The granularity to use for formatting times. |
| `hideTimeZone` | `boolean` | | Whether or not to hide the time zone segment of the field |
| `maxValue` | `TimeValue` | | The maximum time that can be selected |
| `minValue` | `TimeValue` | | The minimum time that can be selected |
| `locale` | `string` | | The locale to use for formatting times |
| `disabled` | `boolean` | | Whether or not the time field is disabled |
| `readonly` | `boolean` | | Whether or not the time field is readonly |
| `id` | `string` | | Id of the element |
| `dir` | `Direction` | | The reading direction of the time field when applicable. |
| `isTimeUnavailable` | `Matcher` | | A function that returns whether or not a time is unavailable |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: TimeRange]` | |
| `update:placeholder` | `[date: TimeValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ modelValue: TimeRange \| undefined; segments: { start: { part: SegmentPart; value: string; }[]; end: { part: SegmentPart; value: string; }[]; }; isInvalid: boolean; }` |
# NwToaster and toasts
Part of [Overlays & menus](../families/overlays.md).
Short, non-blocking notifications, built on Reka `Toast`. Mount one `NwToaster` inside `NwProvider` (which holds Reka's `ToastProvider` and the toast queue), then queue toasts with [`useToast`](../composables.md#usetoast). `useToast()` must run in a component rendered inside that provider, not in the one that renders it, which is why the demo splits its buttons into `ToastControls.vue`. Each toast is a cut-corner card with a glowing intent bar on its inline-start edge.
```vue title="ToastDemo.vue"
```
```vue title="ToastControls.vue"
Push config
Warn
Dismiss all
{{ pushes }} pushes live
```
```text title="Anatomy (NwToaster renders one per queued toast)"
NwToaster
├─ NwToast (intent, variant)
│ ├─ intent icon (info, success, warning, danger)
│ ├─ NwToastTitle
│ ├─ NwToastDescription
│ ├─ NwToastAction
│ └─ NwToastClose
└─ viewport (the notifications region)
```
| `NwToaster` prop | Type | Default | Effect |
| ---------------- | ------------------------------------------------------------------------------------------------- | ---------------------------- | ------------------------------------------------------------------------- |
| `position` | `'top-right' \| 'top-left' \| 'top-center' \| 'bottom-right' \| 'bottom-left' \| 'bottom-center'` | `'bottom-right'` | Corner or edge the stack docks to; the newest toast sits nearest the edge |
| `variant` | `'solid' \| 'glass'` | `'solid'` | Surface of every toast |
| `label` | `string` | `'Notifications ({hotkey})'` | Name of the region; `{hotkey}` becomes the focus shortcut |
| `closeLabel` | `string` | `'Dismiss notification'` | Name of every close button |
| `class` | `HTMLAttributes['class']` | none | Merged onto the viewport |
`toast()` takes `title`, `description`, `intent`, `duration` (ms, `0` keeps it until dismissed), `action` (`{ label, onClick }`) and `icon`, and returns the toast's id; `dismiss(id?)` closes one toast or all of them. The default visible time is the `NwProvider` prop `toast-duration` (5000 ms). Each `NwProvider` owns its own queue, and the queue is cleared when its last toaster unmounts.
The parts are exported for a hand-built toast: `NwToast` takes `intent` (`'primary'`, `'secondary'`, `'tertiary'`, `'neutral'`, `'info'`, `'success'`, `'warning'`, `'danger'`, default `'primary'`) and `variant`, plus Reka's `ToastRoot` props such as `v-model:open`; `NwToastClose` takes `label` (default `'Dismiss notification'`); `NwToastAction` takes Reka's required `alt-text`.
**Accessibility.** Toasts are announced through a live region: `danger` and `warning` toasts interrupt (`foreground`), the others wait (`background`). Every toast has a labelled close button, and an action button runs its callback, then closes the toast. The hotkey in `label` (F8 by default in Reka) moves focus to the region. Toasts slide in from their edge and simply appear under `prefers-reduced-motion: reduce`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwToaster
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `position` | `"top-right" \| "top-left" \| "top-center" \| "bottom-right" \| "bottom-left" \| "bottom-center"` | `"bottom-right"` | Screen corner or edge the stack docks to. |
| `variant` | `"solid" \| "glass"` | `"solid"` | |
| `label` | `string` | `"Notifications ({hotkey})"` | Accessible name of the region; `{hotkey}` is replaced by the focus shortcut. |
| `closeLabel` | `string` | `"Dismiss notification"` | Accessible name of every close button. |
### NwToast
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `intent` | `NwIntent` | | Ink of the intent bar and icon. |
| `variant` | `"solid" \| "glass"` | | `glass` blurs what is behind the card. |
| `defaultOpen` | `boolean` | | The open state of the dialog when it is initially rendered. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `type` | `"foreground" \| "background"` | | Control the sensitivity of the toast for accessibility purposes. |
| `open` | `boolean` | | The controlled open state of the dialog. |
| `duration` | `number` | | Time in milliseconds that toast should remain visible for. |
| `toast` | `ToastObject` | | A toast from `useToastManager()`. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pause` | `[]` | |
| `resume` | `[]` | |
| `swipeStart` | `[event: SwipeEvent]` | |
| `swipeMove` | `[event: SwipeEvent]` | |
| `swipeCancel` | `[event: SwipeEvent]` | |
| `swipeEnd` | `[event: SwipeEvent]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToastAction
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `altText` | `string` | | A short description for an alternate way to carry out the action. |
| `closeOnClick` | `boolean` | | Whether the action should close the toast when clicked. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToastClose
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Dismiss notification"` | Accessible name of the button. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToastDescription
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToastTitle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwToggle + NwToggleGroup
Part of [Actions & HUD](../families/actions.md).
`NwToggle` wraps Reka `Toggle` for a pressed state. `NwToggleGroup` wraps `ToggleGroupRoot`; its items inherit the group's `variant` and `size` unless they set their own.
```vue title="ToggleDemo.vue"
Mute alerts
Graph
List
Map
{{ muted ? 'Alerts muted' : 'Alerts on' }} · {{ view || 'no' }} view
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------------------- | ------------------------------------ | --------------------------------------------- | -------------------------------------------------------------- |
| Toggle / Group / Item `variant` | `'default' \| 'outline'` | `'default'` | Toggle surface; the pressed state fills with the soft primary |
| Toggle / Group / Item `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Item dimensions |
| Toggle `modelValue` | `boolean` | unset | `v-model`; emits `update:modelValue` |
| Group `type` | `'single' \| 'multiple'` | inferred from the value, otherwise `'single'` | Selection mode; set it explicitly for an initially empty group |
| Group `modelValue` | `ToggleGroupRootProps['modelValue']` | uncontrolled, from `defaultValue` | Selected value(s); emits `update:modelValue` |
| Group `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout and arrow-key axis |
Space and Enter toggle `aria-pressed`; disabled items do not activate. In a group, arrow keys move roving focus between items, so the group is one tab stop. Give the group an accessible name and each item visible text or `aria-label`. A single group lets the user clear the selection by pressing the active item, so handle an empty value.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwToggle
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwToggleVariant` | | |
| `size` | `NwToggleSize` | | |
| `defaultValue` | `boolean` | | The pressed state of the toggle when it is initially rendered. |
| `modelValue` | `boolean \| null` | | The controlled pressed state of the toggle. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the toggle. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToggleGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwToggleVariant` | | Style of every item that does not set its own. |
| `size` | `NwToggleSize` | | |
| `rovingFocus` | `boolean` | | When `false`, navigating through the items using arrow keys will be disabled. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the toggle group and all its items. |
| `orientation` | `DataOrientation` | | The orientation of the component, which determines how focus moves: `horizontal` for left/right arrows and `vertical` for up/down arrows. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `loop` | `boolean` | | When `loop` and `rovingFocus` is `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `type` | `SingleOrMultipleType` | | Determines whether a "single" or "multiple" items can be selected at a time. |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the active item(s). |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The default active value of the item(s). |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue \| AcceptableValue[]]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToggleGroupItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwToggleVariant` | | |
| `size` | `NwToggleSize` | | |
| `value` | `AcceptableValue` | required | A string value for the toggle group item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the toggle. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwToolbar
Part of [Actions & HUD](../families/actions.md).
`NwToolbar` wraps Reka `ToolbarRoot` to group related commands into one tab stop. Use its own button, link, toggle and separator parts so arrow navigation can find them.
```vue title="ToolbarDemo.vue"
Stable
Canary
Save
Publish
Guide
Channel {{ channel || 'none' }} · saved {{ saved }} times
```
## Anatomy
```vue
```
| Component / prop | Type | Default | Effect |
| ------------------------------------ | ---------------------------- | ------------------------------ | ---------------------------------------------- |
| Toolbar `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout, arrow-key axis and separator direction |
| ToolbarButton appearance | Appearance | `'neutral'`, `'ghost'`, `'sm'` | Command appearance, with the button motifs |
| ToolbarButton `icon` | `boolean` | `false` | Square command; name it with `aria-label` |
| ToolbarToggleGroup `variant`, `size` | Toggle variants above | `'default'`, `'sm'` | Appearance inherited by its items |
| ToolbarToggleItem `variant`, `size` | Toggle variants above | inherited, then `'sm'` | Per-item override |
The root exposes `role="toolbar"`. Tab enters it once; arrows move between commands, Home and End jump to the ends, and Enter or Space activates the focused command. Separators orient across the toolbar's flow. Set `aria-label` on the toolbar and on each toggle group.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwToolbar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `DataOrientation` | | The orientation of the toolbar |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last tab to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToolbarButton
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `icon` | `boolean` | | Square icon-only button; name it with aria-label. |
| `disabled` | `boolean` | | |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `intent` | `NwIntent` | `"neutral"` | |
| `variant` | `NwVariant` | `"ghost"` | |
| `size` | `NwSize` | `"sm"` | |
| `cut` | `boolean` | | |
| `wire` | `boolean` | | |
| `glow` | `NwGlow` | | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToolbarLink
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToolbarSeparator
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
### NwToolbarToggleGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwToggleVariant` | `"default"` | |
| `size` | `NwToggleSize` | `"sm"` | |
| `rovingFocus` | `boolean` | | When `false`, navigating through the items using arrow keys will be disabled. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the toggle group and all its items. |
| `orientation` | `DataOrientation` | | The orientation of the component, which determines how focus moves: `horizontal` for left/right arrows and `vertical` for up/down arrows. |
| `dir` | `Direction` | | The reading direction of the combobox when applicable. |
| `loop` | `boolean` | | When `loop` and `rovingFocus` is `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `name` | `string` | | The name of the field. |
| `required` | `boolean` | | When `true`, indicates that the user must set the value before the owning form can be submitted. |
| `type` | `SingleOrMultipleType` | | Determines whether a "single" or "multiple" items can be selected at a time. |
| `modelValue` | `AcceptableValue \| AcceptableValue[]` | | The controlled value of the active item(s). |
| `defaultValue` | `AcceptableValue \| AcceptableValue[]` | | The default active value of the item(s). |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[payload: AcceptableValue \| AcceptableValue[]]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwToolbarToggleItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `NwToggleVariant` | | |
| `size` | `NwToggleSize` | | |
| `value` | `AcceptableValue` | required | A string value for the toggle group item. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the toggle. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTooltip
Part of [Overlays & menus](../families/overlays.md).
A short label shown on hover or keyboard focus, wrapping Reka `Tooltip`. It relies on the `TooltipProvider` inside `NwProvider`, whose `tooltip-delay` (300 ms) sets the opening delay; never add a second provider.
```vue title="TooltipDemo.vue"
Resync routes (R)
Traffic replay
Available on capture-enabled relays
```
```text title="Anatomy"
NwTooltip
├─ NwTooltipTrigger
└─ NwTooltipContent
```
| `NwTooltipContent` prop | Type | Default | Effect |
| ----------------------- | ------------------------- | ------- | -------------------------------------- |
| `arrow` | `boolean` | `true` | Draws an arrow pointing at the trigger |
| `sideOffset` | `number` | `6` | Distance from the trigger in px (Reka) |
| `arrowPadding` | `number` | `8` | Keeps the arrow off the corners (Reka) |
| `class` | `HTMLAttributes['class']` | none | Merged onto the bubble |
`NwTooltip` forwards Reka's root props, such as `delayDuration` and `disabled`.
**Keyboard and accessibility.** Keyboard focus opens the tooltip, and the tooltip describes its trigger. Escape hides it while the trigger keeps focus. Put only a label in a tooltip; an icon-only trigger still needs its own `aria-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTooltip
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultOpen` | `boolean` | | The open state of the tooltip when it is initially rendered. |
| `open` | `boolean` | | The controlled open state of the tooltip. |
| `delayDuration` | `number` | | Override the duration given to the `Provider` to customise the open delay for a specific tooltip. |
| `disableHoverableContent` | `boolean` | | Prevents Tooltip.Content from remaining open when hovering. |
| `disableClosingTrigger` | `boolean` | | When `true`, clicking on trigger will not close the content. |
| `disabled` | `boolean` | | When `true`, disable tooltip |
| `ignoreNonKeyboardFocus` | `boolean` | | Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the `:focus-visible` selector. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:open` | `[value: boolean]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ open: boolean; }` |
### NwTooltipContent
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `arrow` | `boolean` | `true` | Draw an arrow pointing at the trigger. |
| `forceMount` | `boolean` | | Used to force mounting when more control is needed. |
| `ariaLabel` | `string` | | By default, screenreaders will announce the content inside the component. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | | The preferred side of the trigger to render against when open. |
| `sideOffset` | `number` | `6` | The distance in pixels from the trigger. |
| `align` | `"end" \| "start" \| "center"` | | The preferred alignment against the trigger. |
| `alignOffset` | `number` | | An offset in pixels from the `start` or `end` alignment options. |
| `avoidCollisions` | `boolean` | | When `true`, overrides the side and align preferences to prevent collisions with boundary edges. |
| `collisionBoundary` | `Element \| (Element \| null)[] \| null` | | The element used as the collision boundary. |
| `collisionPadding` | `number \| Partial>` | | The distance in pixels from the boundary edges where collision detection should occur. |
| `arrowPadding` | `number` | `8` | The padding between the arrow and the edges of the content. |
| `sticky` | `"partial" \| "always"` | | The sticky behavior on the align axis. |
| `hideWhenDetached` | `boolean` | | Whether to hide the content when the trigger becomes fully occluded. |
| `positionStrategy` | `"fixed" \| "absolute"` | | The type of CSS position property to use. |
| `updatePositionStrategy` | `"always" \| "optimized"` | | Strategy to update the position of the floating element on every animation frame. |
| Event | Payload | Description |
| --- | --- | --- |
| `escapeKeyDown` | `[event: KeyboardEvent]` | |
| `pointerDownOutside` | `[event: Event]` | |
| Slot | Props |
| --- | --- |
| `default` | |
### NwTooltipTrigger
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `reference` | `ReferenceElement` | | The reference (or anchor) element that is being referred to for positioning. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Slot | Props |
| --- | --- |
| `default` | |
# NwTree
Part of [Navigation](../families/navigation.md).
A hierarchical list, wrapping Reka `Tree`. The root flattens your items and hands them to its slot; render one `NwTreeItem` per entry. `NwTreeItem` draws a chevron when you pass `has-children`, a leaf mark otherwise, and indents by level.
```vue title="TreeDemo.vue"
{{ item.value.name }}
Selected: {{ selected?.name ?? 'none' }}
```
```text title="Anatomy"
NwTree (slot: { flattenItems })
└─ NwTreeItem v-for item in flattenItems (v-bind="item.bind", has-children)
```
| Part | Prop | Type | Default | Effect |
| ------------ | ------------- | ------------------------------- | -------- | ----------------------------------------------------- |
| `NwTree` | `items` | `T[]` | none | Top-level items (Reka) |
| | `getKey` | `(item: T) => string` | required | Unique key of an item (Reka) |
| | `getChildren` | `(item: T) => T[] \| undefined` | none | Children of an item; Reka reads `children` without it |
| | `modelValue` | `T \| T[]` | none | Selection, `v-model` (Reka) |
| | `expanded` | `string[]` | none | Keys of open branches, `v-model:expanded` (Reka) |
| | `multiple` | `boolean` | `false` | Multiple selection (Reka) |
| | `disabled` | `boolean` | `false` | Disables the whole tree (Reka) |
| `NwTreeItem` | `hasChildren` | `boolean` | `false` | Shows the expand chevron, or a leaf mark when false |
`NwTree` and `NwTreeItem` are generic over your item type. The other Reka `TreeRoot` and `TreeItem` props and emits pass through.
**Keyboard and accessibility.** The tree has the `tree` role and items carry their level. ArrowDown and ArrowUp move, ArrowRight expands a branch (then enters it), ArrowLeft collapses it (or goes to the parent), Enter selects. Name the tree with `aria-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwTree
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `modelValue` | `(M extends true ? T[] : T)` | | The controlled value of the tree. |
| `defaultValue` | `(M extends true ? T[] : T)` | | The value of the tree when initially rendered. |
| `items` | `T[]` | | List of items |
| `expanded` | `string[]` | | The controlled value of the expanded item. |
| `defaultExpanded` | `string[]` | | The value of the expanded tree when initially rendered. |
| `getKey` | `(val: T) => string` | required | This function is passed the index of each item and should return a unique key for that item |
| `getChildren` | `((val: T) => T[] \| undefined)` | | This function is passed the index of each item and should return a list of children for that item |
| `selectionBehavior` | `"replace" \| "toggle"` | | How multiple selection should behave in the collection. |
| `multiple` | `boolean \| M` | | Whether multiple options can be selected or not. |
| `dir` | `Direction` | | The reading direction of the listbox when applicable. |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with tree |
| `propagateSelect` | `boolean` | | When `true`, selecting parent will select the descendants. |
| `bubbleSelect` | `boolean` | | When `true`, selecting children will update the parent state. |
| `loop` | `boolean` | | When `true`, keyboard navigation will loop from last item to first, and vice versa. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[val: M extends true ? T[] : T]` | |
| `update:expanded` | `[val: string[]]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ flattenItems: FlattenedItem[]; modelValue: M extends true ? T[] : T; expanded: string[]; }` |
### NwTreeItem
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `hasChildren` | `boolean` | | |
| `value` | `T` | required | Value given to this item |
| `level` | `number` | required | Level of depth |
| `disabled` | `boolean` | | When `true`, prevents the user from interacting with the item. |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `select` | `[event: SelectEvent]` | |
| `toggle` | `[event: ToggleEvent]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ isExpanded: boolean; isSelected: boolean; isIndeterminate: boolean \| undefined; isDisabled: boolean; handleToggle: () => void; handleSelect: () => void; }` |
# NwYearPicker
Part of [Date & time](../families/datetime.md).
`NwYearPicker` wraps Reka `YearPickerRoot` for values that only need a year, such as a fiscal or archive year.
```vue title="YearPickerDemo.vue"
Archive: {{ value?.year ?? 'none' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| -------------------------------------- | ---------------------------------- | ------- | --------------------------------------------- |
| `modelValue` | `DateValue \| DateValue[] \| null` | unset | Selected year(s) |
| `defaultValue` | `DateValue` | unset | Initial selection |
| `yearsPerPage` | `number` | `12` | Years in a view |
| `calendarLabel` | `string` | unset | Accessible name |
| `multiple`, `preventDeselect` | `boolean` | `false` | Multiple selection / deselection policy |
| `isYearDisabled`, `isYearUnavailable` | `(date: DateValue) => boolean` | unset | Year restrictions |
| `disabled`, `readonly`, `initialFocus` | `boolean` | `false` | Interaction lock / read-only / focus on mount |
The other `YearPickerRootProps` and emits pass through, including the date bounds. Choosing a year emits a date value in that year. Its month and day come from the placeholder, so read only `year`.
**Keyboard and accessibility.** Arrow keys move between years, and Enter or Space selects. The page buttons are named "Previous years" and "Next years". Name the grid with `calendar-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwYearPicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `DateValue` | | The default value for the year picker |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what year range to display when no date is selected |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `calendarLabel` | `string` | | The accessible label for the year picker |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether the year picker is disabled |
| `readonly` | `boolean` | | Whether the year picker is readonly |
| `initialFocus` | `boolean` | | If true, the year picker will focus the selected year, today, or the first year of the range on mount |
| `isYearDisabled` | `Matcher` | | A function that returns whether or not a year is disabled |
| `isYearUnavailable` | `Matcher` | | A function that returns whether or not a year is unavailable |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `nextPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the next page of the year picker. |
| `prevPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the previous page of the year picker. |
| `modelValue` | `DateValue \| DateValue[] \| null` | | The controlled selected year value of the year picker. |
| `multiple` | `boolean` | | Whether multiple years can be selected |
| `yearsPerPage` | `number` | | Number of years to display per page |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateValue \| DateValue[] \| undefined]` | |
| `update:placeholder` | `[date: DateValue]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ date: DateValue; grid: Grid; locale: string; modelValue: DateValue \| DateValue[] \| undefined; }` |
# NwYearRangePicker
Part of [Date & time](../families/datetime.md).
`NwYearRangePicker` wraps Reka `YearRangePickerRoot` and selects a start year and an end year.
```vue title="YearRangePickerDemo.vue"
Support: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }}
```
## Anatomy
```vue
```
| Prop | Type | Default | Effect |
| --------------------------------------------- | ------------------- | -------------------------------------- | --------------------------------------------- |
| `modelValue` | `DateRange \| null` | uncontrolled | Selected year endpoints |
| `defaultValue` | `DateRange` | `{ start: undefined, end: undefined }` | Initial endpoints |
| `yearsPerPage` | `number` | `12` | Years per view |
| `maximumYears` | `number` | unset | Range length limit |
| `calendarLabel` | `string` | unset | Accessible name |
| `allowNonContiguousRanges`, `preventDeselect` | `boolean` | `false` | Unavailable-year ranges / deselection policy |
| `fixedDate` | `'start' \| 'end'` | unset | Fixed endpoint |
| `disabled`, `readonly`, `initialFocus` | `boolean` | `false` | Interaction lock / read-only / focus on mount |
The other `YearRangePickerRootProps` and emits pass through, including the year matchers and bounds. The model is emitted once both endpoints are set.
**Keyboard and accessibility.** Keep the cell triggers when you compose the grid, and name the grid with `calendar-label`.
## API
Generated from the component sources. Every component also takes `class`, `style` and the other attributes Vue falls through.
### NwYearRangePicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultPlaceholder` | `DateValue` | | The default placeholder date |
| `defaultValue` | `DateRange` | | The default value for the calendar |
| `modelValue` | `DateRange \| null` | | The controlled selected year range of the year range picker. |
| `placeholder` | `DateValue` | | The placeholder date, which is used to determine what year range to display when no date is selected. |
| `allowNonContiguousRanges` | `boolean` | | When combined with `isYearUnavailable`, determines whether non-contiguous ranges may be selected. |
| `preventDeselect` | `boolean` | | Whether or not to prevent the user from deselecting a date without selecting another date first |
| `maximumYears` | `number` | | The maximum number of years that can be selected in a range |
| `calendarLabel` | `string` | | The accessible label for the calendar |
| `maxValue` | `DateValue` | | The maximum date that can be selected |
| `minValue` | `DateValue` | | The minimum date that can be selected |
| `locale` | `string` | | The locale to use for formatting dates |
| `disabled` | `boolean` | | Whether or not the calendar is disabled |
| `readonly` | `boolean` | | Whether or not the calendar is readonly |
| `initialFocus` | `boolean` | | If true, the calendar will focus the selected year on mount |
| `isYearDisabled` | `Matcher` | | A function that returns whether or not a year is disabled |
| `isYearUnavailable` | `Matcher` | | A function that returns whether or not a year is unavailable |
| `dir` | `Direction` | | The reading direction of the calendar when applicable. |
| `nextPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the next page of the calendar. |
| `prevPage` | `((placeholder: DateValue) => DateValue)` | | A function that returns the previous page of the calendar. |
| `fixedDate` | `"end" \| "start"` | | Which part of the range should be fixed |
| `yearsPerPage` | `number` | | Number of years to display per page |
| `asChild` | `boolean` | | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| `as` | `AsTag \| Component` | | The element or component this component should render as. |
| Event | Payload | Description |
| --- | --- | --- |
| `update:modelValue` | `[date: DateRange]` | |
| `update:placeholder` | `[date: DateValue]` | |
| `update:startValue` | `[date: DateValue \| undefined]` | |
| Slot | Props |
| --- | --- |
| `default` | `{ date: DateValue; grid: Grid; locale: string; modelValue: DateRange; }` |
# Composables & utilities
> The full API of useFlavor, useToast, useNyxwireTheme, useNwFieldControl, cn, tv and NyxwirePlugin from @nyxwire/vue.
Besides components, `@nyxwire/vue` exports four composables, two class helpers and a plugin. Everything on this page is a named export of the package root.
```ts
import {
NyxwirePlugin,
cn,
tv,
useFlavor,
useNyxwireTheme,
useNwFieldControl,
useToast,
} from '@nyxwire/vue'
```
## useFlavor
Reads and sets the flavor. [Flavors](foundations/flavors.md#vue-useflavor) explains the flavors themselves; this section is the reference.
```vue title="UseFlavorDemo.vue"
Auto
{{ item.label }}
flavor: {{ flavor }} · resolvedFlavor: {{ resolvedFlavor }} · isDark: {{ isDark }}
```
On this site the buttons drive the page runtime, so the header's flavor select and every other island follow.
### Returned values
| Name | Type | Description |
| ---------------- | ---------------------------------------- | ---------------------------------------------------------------------------- |
| `flavor` | `Readonly[>` | The preference: `'auto'`, `'abyss'`, `'nocturne'`, `'twilight'` or `'lumen'` |
| `resolvedFlavor` | `ComputedRef]` | The flavor actually applied; `'auto'` resolved through the system preference |
| `isDark` | `ComputedRef` | Whether `resolvedFlavor` is a dark flavor (every flavor except Lumen) |
| `flavors` | `readonly FlavorMeta[]` | `{ id, label, dark }` for the four flavors |
| `setFlavor` | `(preference: FlavorPreference) => void` | Changes the preference |
### Options
Options are read by the first `useFlavor` call in a Vue app, which creates the app's shared state. Later calls in the same app return that state and ignore their options.
| Option | Type | Default | Effect |
| --------------- | ---------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------ |
| `defaults` | `{ dark?: DarkFlavorName; light?: LightFlavorName }` | `{ dark: 'nocturne', light: 'lumen' }` | Flavors that `'auto'` resolves to |
| `defaultFlavor` | `FlavorPreference` | `'auto'` | Preference used when nothing is stored |
| `storageKey` | `string` | `'nyxwire-flavor'` | `localStorage` key of the preference |
| `storage` | `{ getItem; setItem } \| null` | `window.localStorage` | Where the preference persists; `null` disables persistence |
| `target` | `HTMLElement \| (() => HTMLElement \| null) \| null` | `document.documentElement` | Element that receives the attributes; `null` applies nothing |
| `matchMedia` | `(query: string) => MediaQueryLike \| null` | `window.matchMedia` | Source of `prefers-color-scheme`, replaceable in tests |
| `runtime` | `FlavorRuntimeLike \| null` | `window.nyxwire` | Page runtime to delegate to; `null` forces standalone mode |
Storage errors such as a blocked `localStorage` are ignored: the flavor still applies, it just does not persist.
### Two modes
**With a page runtime.** When `window.nyxwire` exists (installed by the [Astro integration](https://nyxwire.dissidence.ovh/astro/integration/) or the [Starlight plugin](https://nyxwire.dissidence.ovh/starlight/setup/)), the runtime owns ``, storage and the media query. `useFlavor` reads its current preference on mount, `setFlavor` calls `nyxwire.setFlavor()`, and the change comes back through the runtime's event. Storage, target and media options are not used in this mode. A runtime without `resolve()` only accepts concrete flavors; then `useFlavor` follows the system preference itself while the preference is `'auto'` and hands the runtime the resolved flavor.
**Standalone.** A Vite app has no runtime. Then `useFlavor` loads the stored preference, follows `prefers-color-scheme` while the preference is `'auto'`, writes each change to storage, and sets `data-flavor`, `data-theme` and `color-scheme` on the target.
### Synchronization
Every instance listens on `document` for the `nyxwire:flavor` event, a `CustomEvent` whose `detail` holds `{ flavor, resolved, theme, accent }`. The runtime dispatches it whenever the flavor changes, so all islands on a page, the header select and `NwFlavorSelect` stay in agreement. Code outside Vue can listen to it too:
```ts
import { FLAVOR_CHANGE_EVENT } from '@nyxwire/vue'
document.addEventListener(FLAVOR_CHANGE_EVENT, (event) => {
if (event instanceof CustomEvent) console.log(event.detail.flavor, event.detail.resolved)
})
```
In standalone mode `useFlavor` does not dispatch the event itself; it only mirrors changes that another source announces.
### Lifecycle and server rendering
- `useFlavor` touches neither `window` nor `document` until the calling component mounts, so it renders on the server.
- Every call inside one Vue app shares a single state, removed when the app unmounts. Each Astro island is its own app, with its own state, kept in step by the runtime event.
- Called outside a component, it uses one detached state for the whole page and starts it at once.
### Related exports
| Export | Value or signature |
| ---------------------------------------------------- | ------------------------------------------------ |
| `FLAVOR_STORAGE_KEY` | `'nyxwire-flavor'` |
| `FLAVOR_CHANGE_EVENT` | `'nyxwire:flavor'` |
| `flavors` | Flavor metadata, `{ id, label, dark }[]` |
| `flavorNames` | The four flavor names, in palette order |
| `flavorPreferences` | `'auto'` followed by the flavor names |
| `defaultFlavor` | `'nocturne'` |
| `accentNames` | The 12 accent names, `indigo` to `steel` |
| `isFlavorName`, `isFlavorPreference`, `isAccentName` | Type guards for untrusted strings |
| `isDarkFlavor(flavor)` | `true` for Abyss, Nocturne and Twilight |
| `themeOf(flavor)` | `'dark'` or `'light'`, the value of `data-theme` |
The types `FlavorName`, `FlavorPreference`, `DarkFlavorName`, `LightFlavorName`, `ThemeName`, `AccentName`, `FlavorMeta`, `UseFlavorOptions` and `UseFlavorReturn` are exported too.
## useToast
Queues toasts for the `NwToaster` of the nearest `NwProvider`. Toast components and the toaster's props are documented in [Overlays & menus](families/overlays.md).
```vue title="UseToastDemo.vue"
```
```vue title="ToastQueue.vue"
Queue a toast
Dismiss oldest
Dismiss all
{{ item.id }}: {{ item.title }} ({{ item.open ? 'open' : 'closing' }})
The queue is empty.
```
Each `NwProvider` owns its queue, and `useToast()` injects it, so call it in a component rendered inside the provider, never in the component that renders the provider: there it throws `useToast requires an ancestor NwProvider`. That is why the demo splits into two files. `useToast()` takes no arguments and returns:
| Name | Type | Description |
| --------- | ------------------------------------- | ----------------------------------------------------------------------------- |
| `toast` | `(options: NwToastOptions) => string` | Queues a toast and returns its id |
| `dismiss` | `(id?: string) => void` | Closes the toast with that id, or every open toast without one |
| `toasts` | `ComputedRef` | The live queue, including toasts playing their exit animation (`open: false`) |
### Toast options
| Option | Type | Default | Effect |
| ------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------- |
| `title` | `string` | required | First line of the toast |
| `description` | `string` | none | Second line |
| `intent` | `'primary' \| 'secondary' \| 'tertiary' \| 'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Glowing edge bar and icon color; `warning` and `danger` are announced assertively |
| `duration` | `number` | `NwProvider`'s `toast-duration` (5000) | Visible time in ms; `0` keeps the toast until it is dismissed |
| `action` | `{ label: string; onClick: () => void }` | none | A button; the toast closes after `onClick` runs |
| `icon` | `Component` | intent icon | Leading icon; `info`, `success`, `warning` and `danger` get one by default |
An `NwToastItem` is the options plus a readonly `id` and `open`. The types are exported as `NwToastOptions`, `NwToastItem`, `NwToastIntent`, `NwToastActionOptions` and `UseToastReturn`.
### Placement and lifetime
- Any component under the provider can call `toast()`; the toasts appear in that provider's `NwToaster`. Mount exactly one per provider.
- `NwToaster`'s `position` picks the corner or edge: `'top-right'`, `'top-left'`, `'top-center'`, `'bottom-right'` (default), `'bottom-left'` or `'bottom-center'`. The demo uses `'top-right'`. Its `variant` is `'solid'` (default) or `'glass'`.
- A closed toast leaves the queue 600 ms after it closes, once its exit animation is over.
- When the last `NwToaster` of a provider unmounts, the queue is cleared, so toasts never outlive their viewport.
## useNyxwireTheme
Returns the theme scope of the nearest `NwProvider`, as a `ComputedRef` of `{ flavor?, accent?, provided? }`. `flavor` and `accent` are set when a provider (or one of its ancestors) scopes them with `v-model:flavor` or `v-model:accent`, and `provided` is `true` inside any provider. Outside a provider it returns an empty scope.
Portalled overlays use it to carry the scope onto content that leaves the provider's subtree, so a dialog opened from a Lumen panel stays Lumen. Use it the same way when you teleport your own content:
```vue
Floating HUD
```
## useNwFieldControl
Returns the attributes that join a control to the surrounding `NwField`, as a `ComputedRef`: `id`, `name`, `disabled`, `required`, `aria-labelledby`, `aria-describedby` and `aria-invalid`. Outside a field it is empty. `NwField`'s default slot exposes the same value as `control`. [Forms](components/field.md) shows it wiring a select trigger; bind it on the focusable element of any custom control.
## cn
`cn(...classes)` joins class values (strings, arrays, objects) and resolves Tailwind conflicts with the Nyxwire tailwind-merge configuration, so a later utility replaces an earlier one, theme utilities such as `glow-sm`, `cut` or `text-fg-muted` included. It is the same function as `@nyxwire/tailwind/merge`'s `cn`, documented in [Class merging](https://nyxwire.dissidence.ovh/tailwind/merging/#cn). Every component merges its `class` prop with it.
```ts
cn('rounded-md glow-sm px-3 text-fg-muted', isActive && 'text-primary glow-md', 'rounded-full')
// → 'px-3 text-primary glow-md rounded-full' when isActive is true
```
## tv
`tv` is tailwind-variants' `tv`, created with `createTV({ twMergeConfig })` from `@nyxwire/tailwind/merge`. Recipes you build with it merge classes exactly like the components' own recipes, so variant classes and the `class` you pass at call time override the base without duplicates. [Recipes with tailwind-variants](https://nyxwire.dissidence.ovh/tailwind/merging/#recipes-with-tailwind-variants) covers the API.
```vue title="TvDemo.vue"
node hel-01: {{ status }}
{{ item }}
{{ classes }}
```
The merged class list is printed under the chip. Turn on Cut corners and `rounded-md` and `border` leave it: `cut` draws its own chamfered edge from `--nw-edge` and `--nw-fill`, which the recipe sets per status. Use `tv` to style your own components in the same idiom as the library. The package also re-exports the `VariantProps` and `ClassValue` types.
## NyxwirePlugin
A Vue plugin that registers every `Nw*` component globally, from every family: foundations, actions, forms, selection, date and time, color, overlays and navigation. Composables and helpers are not registered; import them.
```ts title="src/main.ts"
import { createApp } from 'vue'
import { NyxwirePlugin } from '@nyxwire/vue'
import App from './App.vue'
createApp(App).use(NyxwirePlugin).mount('#app')
```
It takes no options. Registering everything pulls every component into the bundle, so prefer named imports outside prototypes. You still need `NwProvider` at the root of the app.
# Actions & HUD
> Buttons, toggles, display components, feedback, data and HUD surfaces of @nyxwire/vue, with live examples and source-backed API references.
Import these components from `@nyxwire/vue`. Each example is a separate `client:visible` island with its own `NwProvider`; [Vue overview](../index.md) covers the shared stylesheet and provider.
The tables list Nyxwire's additions and overrides. Every component documented with a `class` prop merges it with the theme through `cn()`; components without one pass `class` through as a plain attribute. Components wrapping Reka forward the remaining props and declared emits of the named primitive; components built from native elements do not acquire a Reka model or keyboard behavior.
Here, **Intent** means `'primary' | 'secondary' | 'tertiary' | 'neutral' | 'info' | 'success' | 'warning' | 'danger'`. **Appearance** means the shared props `intent` (Intent), `variant` (`'solid' | 'soft' | 'outline' | 'ghost' | 'link'`), `size` (`'xs' | 'sm' | 'md' | 'lg'`), `cut` (chamfered top-right and bottom-left corners), `wire` (gradient edge) and `glow` (`'sm' | 'md' | 'lg'`). Boolean flags default to `false` unless stated otherwise; optional labels default to unset. Defaults below include theme defaults.
## Components
- [NwButton + NwButtonGroup](../components/button.md): `NwButton` renders Reka `Primitive` as a native button by default.
- [NwIconButton](../components/icon-button.md): `NwIconButton` is an `NwButton` with `icon` set and a required `label`, which becomes both its `aria-label` and its tooltip-style `title`.
- [NwToggle + NwToggleGroup](../components/toggle.md): `NwToggle` wraps Reka `Toggle` for a pressed state.
- [NwToolbar](../components/toolbar.md): `NwToolbar` wraps Reka `ToolbarRoot` to group related commands into one tab stop.
- [NwBadge](../components/badge.md): `NwBadge` renders Reka `Primitive` as a `span` for a status or category.
- [NwChip](../components/chip.md): `NwChip` is a removable tag: a `span` with the badge face and, when `removeLabel` is set, a native remove button that emits `remove`.
- [NwKbd](../components/kbd.md): `NwKbd` is a native `kbd` keycap.
- [NwKeyHint](../components/key-hint.md): `NwKeyHint` composes keycaps joined by a decorative plus and an action label in a `span`.
- [NwCard](../components/card.md): `NwCard` and its parts render Reka `Primitive` for a composed content surface.
- [NwSeparator](../components/separator.md): `NwSeparator` wraps Reka `Separator` for horizontal or vertical division, optionally with a centered label.
- [NwAvatar + NwAvatarGroup](../components/avatar.md): `NwAvatar` wraps Reka `AvatarRoot`, with image and fallback parts.
- [NwAspectRatio](../components/aspect-ratio.md): `NwAspectRatio` wraps Reka `AspectRatio` to reserve media space before it loads.
- [NwSkeleton](../components/skeleton.md): `NwSkeleton` renders Reka `Primitive` as an `aria-hidden` placeholder with a primary shimmer.
- [NwSpinner](../components/spinner.md): `NwSpinner` is a native `span` with `role="status"` and a visually hidden label, or a decorative span when another element owns the announcement, as in `NwButton`'s `loading` state.
- [NwAlert](../components/alert.md): `NwAlert` is a native feedback surface with title and description parts.
- [NwLink](../components/link.md): `NwLink` renders Reka `Primitive` as an anchor.
- [NwProgress](../components/progress.md): `NwProgress` wraps Reka `ProgressRoot` and supplies the `ProgressIndicator`.
- [NwMeter](../components/meter.md): `NwMeter` is a native `` for a measurement within a known range (disk use, load), as opposed to task progress.
- [NwRating](../components/rating.md): `NwRating` composes Reka `RatingRoot`, `RatingItem` and `RatingItemIndicator`.
- [NwTable](../components/table.md): `NwTable` and its parts render Reka `Primitive` with native table elements.
- [NwDataTable](../components/data-table.md): `NwDataTable` builds an `NwTable` from typed rows and column accessors and sorts them itself.
- [NwStat](../components/stat.md): `NwStat` is a description list (`dl`) that pairs a label with a headline value and an optional detail line.
- [NwHudPanel + NwStatBar + NwNeonText](../components/hud-panel.md): `NwHudPanel` renders Reka `Primitive` as a `section` with a cut-corner frame, a header label and a status readout; `NwNeonText` renders it as a `span`.
- [NwCode](../components/code.md): `NwCode` renders inline code, or with `block` a `pre` that keeps whitespace and scrolls horizontally.
- [NwList](../components/list.md): `NwList` renders a styled `ul` or `ol`, from an `items` array or from your own `li` elements.
- [NwEmpty](../components/empty.md): `NwEmpty` is the placeholder for a collection with no items: a title, an optional description and a slot for the next action.
- [NwLayout](../components/layout.md): `NwLayout` is a `div` that arranges its children with one of the four layout primitives of the CSS layer.
# Color
> NwColorPicker, NwColorArea, NwColorSlider, NwColorField, NwColorSwatch and NwColorSwatchPicker, Reka's color primitives drawn in the page with Nyxwire's wire edges and cut swatches.
The color family wraps Reka UI's color primitives and draws every part in the page. It looks the same in every browser and every flavor, which ` ` does not.
Values are hex strings or Reka `Color` objects (`{ space: 'hsl', h, s, l, alpha }`). `v-model` returns whatever the primitive produces. When several parts share one value, type the ref with the component's own `modelValue` prop, as the examples do. The example colors come from the nocturne palette.
## Components
- [NwColorPicker](../components/color-picker.md): `NwColorPicker` is a complete picker behind one button.
- [NwColorArea](../components/color-area.md): `NwColorArea` is a two-dimensional picker over two channels of one color space.
- [NwColorSlider](../components/color-slider.md): `NwColorSlider` shows one channel of a color on a gradient track and wraps Reka `ColorSliderRoot` and `ColorSliderThumb`.
- [NwColorField](../components/color-field.md): `NwColorField` is a text input for a color, wrapping Reka `ColorFieldRoot` and `ColorFieldInput`.
- [NwColorSwatch](../components/color-swatch.md): `NwColorSwatch` previews one color over a checkerboard and cannot be interacted with.
- [NwColorSwatchPicker](../components/color-swatch-picker.md): `NwColorSwatchPicker` is a grid of preset swatches with one selected.
# Date & time
> Calendars, segmented date and time fields, popup date pickers and month and year grids for Vue, built on Reka and @internationalized/date values.
These components use Reka's date values and draw every control in the page; none of them opens a native date or time popup. Each example starts empty, shows the current month or year, prints its model under the control, and has its own `NwProvider` with `locale="en-US"`. The provider's locale sets the segment order, month and weekday names, and the first day of the week.
Every root accepts a `class` that is merged with tailwind-merge (`HTMLAttributes['class']`, unset by default). Each root extends its Reka `*RootProps` and forwards the remaining props and declared emits, and `v-model` listens to `update:modelValue`. The tables list the wrapper's own props, its defaults and the forwarded props you will use most. They do not copy Reka's full root interfaces.
Values are `DateValue` objects from `@internationalized/date`, not JS `Date` objects or ISO strings. Use a `CalendarDate` for a date without a time. `TimeValue` covers Reka's time values, including `Time`. A `DateRange` has `start` and `end` dates, and either can be `undefined` while the range is incomplete; a `TimeRange` has the same shape with time values. The examples type their refs with the wrapper's own props (`NwDatePickerProps['modelValue']`) and never construct a date. If your app does construct dates, install `@internationalized/date` and keep controlled values in a `shallowRef`.
Each anatomy block shows the parts the wrapper puts in its default slot. It shows how they nest, not a complete custom implementation: a custom grid also needs the dates, rows, segments and bindings that the root's slot provides.
## Components
- [NwCalendar](../components/calendar.md): `NwCalendar` wraps Reka `CalendarRoot` and fills its default slot with a header (previous, heading, next), a weekday row and one date grid per visible month.
- [NwRangeCalendar](../components/range-calendar.md): `NwRangeCalendar` wraps Reka `RangeCalendarRoot` with the same grid layout and selects a start and an end date.
- [NwDateField](../components/date-field.md): `NwDateField` wraps Reka `DateFieldRoot` and renders one `NwDateFieldInput` per segment, in the order the provider's locale uses.
- [NwDateRangeField](../components/date-range-field.md): `NwDateRangeField` wraps Reka `DateRangeFieldRoot`.
- [NwTimeField](../components/time-field.md): `NwTimeField` wraps Reka `TimeFieldRoot` and renders an `NwTimeFieldInput` for each formatted time segment.
- [NwTimeRangeField](../components/time-range-field.md): `NwTimeRangeField` wraps Reka `TimeRangeFieldRoot` for a start time and an end time, separated by an en dash.
- [NwDatePicker](../components/date-picker.md): `NwDatePicker` wraps Reka `DatePickerRoot`.
- [NwDateRangePicker](../components/date-range-picker.md): `NwDateRangePicker` wraps Reka `DateRangePickerRoot`.
- [NwMonthPicker](../components/month-picker.md): `NwMonthPicker` wraps Reka `MonthPickerRoot`.
- [NwMonthRangePicker](../components/month-range-picker.md): `NwMonthRangePicker` wraps Reka `MonthRangePickerRoot` and selects a start month and an end month.
- [NwYearPicker](../components/year-picker.md): `NwYearPicker` wraps Reka `YearPickerRoot` for values that only need a year, such as a fiscal or archive year.
- [NwYearRangePicker](../components/year-range-picker.md): `NwYearRangePicker` wraps Reka `YearRangePickerRoot` and selects a start year and an end year.
## States and combinations
These three examples show the props from the tables together: sizes, granularity, invalid and disabled fields, unavailable dates, multiple selection and read-only grids.
### Fields
`size` changes the height and text size of every segmented field. `granularity="second"` adds a seconds segment. `invalid` sets `aria-invalid` and the danger edge, so point an error message at the field with `aria-describedby`. A disabled field takes its segments out of the tab order.
```vue title="FieldsDemo.vue"
Key rotation (small)
Value: {{ rotation?.toString() ?? 'incomplete' }}
Cutover time (large, seconds)
Value: {{ cutover?.toString() ?? 'incomplete' }}
Audit period (invalid)
Enter both audit dates.
Locked shift (disabled)
```
### Pickers
`is-date-unavailable` takes a function that receives each `DateValue`. In this example it strikes weekends from the release calendar, and those days cannot be picked. `number-of-months="2"` shows two months side by side in the range popup. `invalid` marks the picker field.
```vue title="PickerDemo.vue"
Release cutoff (weekdays only)
Value: {{ cutoff?.toString() ?? 'none' }}
Canary rollout (two months, small)
Expired token (invalid)
```
### Month and year grids
`multiple` turns the month model into an array; clicking a selected month again removes it. `is-month-unavailable` blocks December here. `maximum-months` limits how long a range can be. `years-per-page` sets how many years one page shows. A `readonly` grid still takes focus but does not select.
```vue title="MonthYearDemo.vue"
Months: {{ list(months) }}
Year: {{ year?.year ?? 'none' }}
```
All of these controls draw their popups in the page and portal them to ``, so they inherit the page flavor. If an island scopes a different flavor with `NwProvider`, point the popup's `portalProps` at an element inside that scope when you compose the parts yourself.
# Forms
> Text fields, field wiring, validation, choice controls and structured input, with live Vue islands, anatomy and API tables.
Each example imports from `@nyxwire/vue`, wraps its controls in `NwProvider`, and hydrates when visible. [Vue setup](../index.md) explains the styles and the provider.
Tables describe what each wrapper adds and its defaults, theme defaults included. Every component accepts a merged `class` (`HTMLAttributes['class']`, unset). Unless a table says otherwise, optional flags are false and optional values are unset. The remaining props and declared emits of each named Reka primitive pass through; use its root model with `v-model` and `update:modelValue`. Input and textarea expose their own native text model.
The family shares one look: text entry sits in a canvas-subtle well whose wire edge lights up on keyboard focus, checkboxes, switches and tags are chamfered with the cut-corner motif, and a checked choice glows in its intent ink. Controls drawn smaller than 24px keep a 24px pointer target.
## Components
- [NwLabel + NwInput](../components/input.md): `NwLabel` wraps Reka `Label`.
- [NwInputGroup](../components/input-group.md): `NwInputGroup` wraps Reka `Primitive` to join inputs and `NwInputGroupAddon` text into one bar: inner corners square off, borders collapse and the focused input rises above its neighbours.
- [NwTextarea](../components/textarea.md): `NwTextarea` renders a native textarea through Reka `Primitive`, or `FieldControl` inside a field, with three rows by default.
- [NwField](../components/field.md): `NwField` wraps Reka `FieldRoot`.
- [NwForm](../components/form.md): `NwForm` wraps Reka `FormRoot` to collect named fields, validate on submit and focus the first invalid control.
- [NwCheckbox + NwCheckboxGroup](../components/checkbox.md): `NwCheckbox` composes Reka `CheckboxRoot` and `CheckboxIndicator` in a chamfered box: a check when checked, a dash when indeterminate.
- [NwRadioGroup](../components/radio-group.md): `NwRadioGroup` wraps Reka `RadioGroupRoot`; `NwRadioGroupItem` composes `RadioGroupItem`, `RadioGroupIndicator` and a label for its text slot.
- [NwSwitch](../components/switch.md): `NwSwitch` wraps Reka `SwitchRoot` and supplies `SwitchThumb`: a chamfered track with a square thumb, filled and glowing in the intent ink when on.
- [NwSlider](../components/slider.md): `NwSlider` wraps Reka `SliderRoot` and supplies a sunken track, a wire-gradient range and one glowing diamond thumb per value.
- [NwNumberField](../components/number-field.md): `NwNumberField` wraps Reka `NumberFieldRoot` and supplies decrement, input and increment parts by default.
- [NwPinInput](../components/pin-input.md): `NwPinInput` wraps Reka `PinInputRoot`.
- [NwTagsInput](../components/tags-input.md): `NwTagsInput` wraps Reka `TagsInputRoot` for editing a list of values.
- [NwEditable](../components/editable.md): `NwEditable` wraps Reka `EditableRoot` for an inline preview/edit cycle.
- [NwTagGroup](../components/tag-group.md): `NwTagGroup` wraps Reka `TagGroupRoot` for selecting and removing existing tags.
## Accessibility
- Every control needs a name: `NwLabel` with `for`, an `NwField` label, a `label` prop or an `aria-label`.
- Inside `NwField`, descriptions and errors join `aria-describedby` automatically, and an invalid field sets `aria-invalid` on its control.
- Focus is always visible: a 2px ring in `--nw-ring`, plus the wire edge and glow on text entry.
- Disabled controls dim and stop responding, and their labels switch to the disabled ink.
- Motion (thumb travel, glows, transitions) stops under `prefers-reduced-motion: reduce`.
# Navigation
> Tabs, accordions, collapsibles, navigation menus, pagination, breadcrumbs, steppers, trees, scroll areas, splitters, navbars and sidenavs from @nyxwire/vue, built on Reka UI.
These components move people between views, sections and steps. The Reka-based ones forward their primitive's props and emits and expose the Reka element through `ref`. Every part also takes `class`, merged with [`cn()`](https://nyxwire.dissidence.ovh/tailwind/merging/). Tabs, accordions, steppers, breadcrumbs, pagination and sidenavs also take an `items` prop that renders the whole anatomy from data, for when you do not need custom parts.
## Components
- [NwTabs](../components/tabs.md): Switches between panels in place, wrapping Reka `Tabs`.
- [NwAccordion](../components/accordion.md): A stack of sections that expand and collapse, wrapping Reka `Accordion`.
- [NwCollapsible](../components/collapsible.md): One section that shows and hides, wrapping Reka `Collapsible`.
- [NwNavigationMenu](../components/navigation-menu.md): Site navigation with dropdown panels, wrapping Reka `NavigationMenu`.
- [NwPagination](../components/pagination.md): Page controls for a long list, wrapping Reka `Pagination`.
- [NwBreadcrumb](../components/breadcrumb.md): The path from the top of a hierarchy to the current page.
- [NwStepper](../components/stepper.md): Progress through ordered steps, wrapping Reka `Stepper`.
- [NwTree](../components/tree.md): A hierarchical list, wrapping Reka `Tree`.
- [NwScrollArea](../components/scroll-area.md): A scroll container with themed, overlay scrollbars, wrapping Reka `ScrollArea`.
- [NwSplitterGroup](../components/splitter-group.md): Resizable panels, wrapping Reka `Splitter`.
- [NwNavbar](../components/navbar.md): A Nyxwire-only application bar: a `` landmark with a brand, a row of links and an actions area, underlined by a wire hairline.
- [NwSidenav](../components/sidenav.md): A Nyxwire-only vertical navigation for an application or docs sidebar: a `` landmark holding lists of links, optionally split into labelled groups.
## Notes
- Every navigation part renders in the page; the navigation menu's panels use the in-flow viewport, not a portal.
- `NwScrollArea` draws its own scrollbars, which keeps long lists on themed bars inside panels and HUD layouts; give the area a background.
- For touch-heavy layouts, prefer `size="lg"` pagination (2.75rem buttons; `md` is 2.25rem) and tabs. Accordion triggers are at least 2.75rem tall and tree rows at least 2.25rem.
# Overlays & menus
> Dialogs, alert dialogs, sheets, drawers, popovers, tooltips, hover cards, dropdown and context menus, menubars, toasts and the command palette from @nyxwire/vue, all rendered in the page through Reka portals.
Every overlay in this family is a Reka UI primitive whose content is portalled into ``. None relies on a native ``, the Popover API or a `title` tooltip, so focus handling, stacking and styling are the same in every browser. Portalled panels copy the flavor and accent of the nearest `NwProvider` onto themselves, so a dialog opened from a `lumen` scope stays `lumen` even though it renders at the end of ``.
Root components (`NwDialog`, `NwPopover`, `NwDropdownMenu`, …) forward every Reka root prop and emit, including `v-model:open`. Triggers, closes and anchors are unstyled and accept `as-child`, so an `NwButton` can be the trigger. Every styled part takes `class`, merged with [`cn()`](https://nyxwire.dissidence.ovh/tailwind/merging/).
## Components
- [NwDialog](../components/dialog.md): A modal window for a focused task, wrapping Reka `Dialog`.
- [NwAlertDialog](../components/alert-dialog.md): A confirmation that interrupts, wrapping Reka `AlertDialog`.
- [NwSheet](../components/sheet.md): A dialog docked to an edge of the viewport, for settings and secondary panels.
- [NwDrawer](../components/drawer.md): A swipeable panel, wrapping Reka `Drawer`.
- [NwPopover](../components/popover.md): A non-modal, cut-corner panel anchored to its trigger, wrapping Reka `Popover`.
- [NwTooltip](../components/tooltip.md): A short label shown on hover or keyboard focus, wrapping Reka `Tooltip`.
- [NwHoverCard](../components/hover-card.md): A preview card for sighted pointer users, wrapping Reka `HoverCard`: it opens after the pointer rests on the trigger (700 ms) and closes 300 ms after it leaves.
- [NwDropdownMenu](../components/dropdown-menu.md): A menu of actions opened from a button, wrapping Reka `DropdownMenu`, with items, checkbox and radio items, labels, groups, separators, shortcuts and submenus.
- [NwContextMenu](../components/context-menu.md): The same menu opened by a right-click (or a long press) on an area, wrapping Reka `ContextMenu`.
- [NwMenubar](../components/menubar.md): A horizontal row of menus, as in a desktop application, wrapping Reka `Menubar`.
- [NwToaster and toasts](../components/toaster.md): Short, non-blocking notifications, built on Reka `Toast`.
- [NwCommandPalette](../components/command-palette.md): A Nyxwire-only composite: a dialog with a search field over a filtered list of commands, built from `NwDialog` parts and Reka `Listbox`.
## Notes
- Portals mount in ``. Each panel copies the flavor and accent of the nearest `NwProvider`, so menus and dialogs keep a scoped flavor without extra setup.
- Menus and popovers share the popover layer, so they open above dialogs; toasts use their own `--nw-z-toast` layer.
- Pick `variant="glass"` for popovers, menus and toasts over busy backgrounds such as the circuit grid; `solid` keeps maximum contrast.
- Keep a visible close control on drawers and toasts: swipe gestures are pointer-only.
# Selection
> Selects, searchable comboboxes, free-text autocomplete and persistent listboxes for Vue, drawn in the page with Nyxwire's wire-edge focus.
Pick the component by how the value is chosen. A select holds a known set of values. A combobox searches that set. Autocomplete accepts any text and only suggests values. A listbox keeps its options on screen. Each example imports from `@nyxwire/vue` and has its own `NwProvider`.
The tables list wrapper props and overrides only. Each root adds `class` to its Reka root interface and forwards the rest, including `v-model` through `update:modelValue`. Every part takes a `class` (`HTMLAttributes['class']`, unset by default) that is merged with tailwind-merge. Size and invalid props belong to the trigger, input or filter, not to the root. Popup content is portalled to `` and uses the page's flavor.
## Components
- [NwSelect](../components/select.md): `NwSelect` wraps Reka `SelectRoot`.
- [NwCombobox](../components/combobox.md): `NwCombobox` wraps Reka `ComboboxRoot` so the user can search item text to choose a value.
- [NwAutocomplete](../components/autocomplete.md): `NwAutocomplete` wraps Reka `AutocompleteRoot`.
- [NwListbox](../components/listbox.md): `NwListbox` wraps Reka `ListboxRoot` for a list that stays visible.
# Accessibility
> The palette's contrast gate with live results, focus rings, keyboard support, reduced motion and forced-colors fallbacks.
Nyxwire guarantees what a palette can guarantee: every color meant for text is readable on the backgrounds it is meant for, in every flavor. The rest (focus, keyboard, motion, layout) is built into the components and is yours to keep when you compose them.
## Contrast gate
`pnpm check:contrast` runs the palette gate and exits with an error on any failure, so a color that drops below its threshold cannot be released. The table recomputes the WCAG 2.x rules from the published palette when this site is built. Each cell shows the weakest pair the rule covers.
_Live example: [Accessibility](https://nyxwire.dissidence.ovh/foundations/accessibility/)._
The gate also checks two things the table cannot show:
- **Accent separation.** No two accents inside one flavor may come within ΔEOK 0.06, so `volt` never reads as `flare` at a different size and `ice` never collapses into `arc`.
- **Identity.** Every flavor's `base` stays at least 0.03 ΔEOK from sixteen popular dark and light themes (Static Bloom, Catppuccin, Rose Pine, Tokyo Night, Dracula, Nord and friends), with 0.045 as an advisory margin. The gate prints APCA Lc values for text roles as information.
What follows from the table:
- `text` is 7:1 (AAA) on `crust`, `mantle`, `base` and `surface0`, and 4.5:1 on the raised fills; `subtext1` and `subtext0` are body-safe on the page backgrounds.
- Every accent is AA on `crust`, `mantle`, `base` and `surface0`, so colored text, links and soft badges stay readable in any accent scope.
- Soft badges and buttons sit on a 16% tint of their own color, so their text mixes the intent with `fg` per flavor (`--nw-soft-ink`: 100% in Abyss, 90% in Nocturne, 75% in Twilight, 70% in Lumen). That keeps them AA on the same four grounds.
- `on-accent` text is AA on every solid accent fill, which covers solid buttons and badges.
- `overlay1` (`line-strong`) meets the 3:1 non-text minimum for input borders and control edges; `overlay0` (`line`) is decorative only, and the circuit grid sits on it by design.
> **Caution**
>
> These are solid-color guarantees. Text over imagery, colors at reduced opacity, and new color
> pairs need checking where you use them: put text on a solid, glass or cut panel when the backdrop
> is loud.
## Focus
Every focusable element gets a visible ring on keyboard focus: the base layer styles `:focus-visible` with a 2px outline in `--nw-ring` (the primary intent, so it follows `data-accent`) at a 2px offset, and interactive components add their intent glow on top. Tab through these controls to see it:
```html
Solid
Outline
Link
```
Tokens: `--nw-ring`, `--nw-ring-width` (2px) and `--nw-ring-offset` (2px). Do not remove the outline; restyle it through the tokens instead.
## Keyboard
- **CSS components** build on native elements (``, ``, ``, ``, ``, the Popover API), so keyboard behavior comes from the browser.
- **Vue components** wrap [Reka UI](https://reka-ui.com/) primitives: arrow-key roving focus in toolbars and toggle groups, typeahead in lists, Escape to close the topmost overlay, focus trapped inside dialogs and returned to the trigger on close, and the ARIA roles and states each pattern needs.
- Icon-only buttons need an accessible name: give them `aria-label`.
## Motion
Decorative animation stops under `prefers-reduced-motion: reduce`: durations collapse to 0.01ms, loops run once, and `.nw-motion-essential` opts meaning-bearing motion (a spinner for pending work) back in. See [Effects & motion](effects-motion.md#motion).
## Forced colors
Under `forced-colors: active` the motif utilities fall back to system colors: cut and wire surfaces become a plain `Canvas` box with a real border, the scanline overlay and circuit grid are removed, and buttons keep their state through `Highlight`/`HighlightText` rather than color. Disabled controls show as `GrayText`.
## Color is never the only signal
Intent colors always travel with words or icons: alerts have titles, badges have text, meters show their value, and form errors are written out under the field with `aria-invalid` set. Keep that pairing when you compose your own components.
## Targets
Control heights are 1.75rem (`xs`), 2rem (`sm`), 2.5rem (`md`, the default) and 3rem (`lg`), above the 24px WCAG 2.2 minimum. Inputs are 2.5rem tall. On touch layouts, prefer `md` or larger.
# Color roles
> Semantic color tokens, what each accent means, and the syntax highlighting roles, generated from @nyxwire/palette.
Components never reference a raw palette color. They use semantic roles, which resolve to a palette color in the nearest flavor scope. The same names work as CSS variables (`--nw-canvas`) and as Tailwind color keys (`bg-canvas`, `text-fg-muted`, `border-line-strong`). Raw palette keys carry an `nw-` prefix in Tailwind (`bg-nw-indigo`) so the neutral named `base` cannot collide with `text-base`.
## Semantic tokens
Generated from `semanticRoles`. The swatches are the token resolved in each flavor.
| CSS variable | Tailwind key | Palette | Abyss | Nocturne | Twilight | Lumen |
| --- | --- | --- | --- | --- | --- | --- |
| `--nw-canvas` | `canvas` | `base` | `#080720` | `#14093e` | `#271a4b` | `#eae6ff` |
| `--nw-canvas-subtle` | `canvas-subtle` | `mantle` | `#050419` | `#0e0533` | `#211540` | `#dedaff` |
| `--nw-canvas-sunken` | `canvas-sunken` | `crust` | `#030312` | `#0a0329` | `#1b1136` | `#d3cefa` |
| `--nw-panel` | `panel` | `surface0` | `#12122f` | `#1d154c` | `#312457` | `#ddd9ff` |
| `--nw-panel-hover` | `panel-hover` | `surface1` | `#1b1c3b` | `#272258` | `#3b2f61` | `#d1cdf8` |
| `--nw-panel-active` | `panel-active` | `surface2` | `#262747` | `#302d60` | `#453b6a` | `#c6c1ef` |
| `--nw-fg` | `fg` | `text` | `#f0f1f7` | `#f2f3fa` | `#f5f4fa` | `#1f0e47` |
| `--nw-fg-muted` | `fg-muted` | `subtext1` | `#d0d2dd` | `#d4d4e3` | `#d9d7e4` | `#3d326b` |
| `--nw-fg-subtle` | `fg-subtle` | `subtext0` | `#aeb0c1` | `#b2b4ca` | `#bab7cd` | `#524a7e` |
| `--nw-fg-faint` | `fg-faint` | `overlay2` | `#82849b` | `#8b8cab` | `#9793af` | `#686191` |
| `--nw-fg-disabled` | `fg-disabled` | `overlay1` | `#646781` | `#6c6d93` | `#7c7799` | `#7c76a4` |
| `--nw-line` | `line` | `overlay0` | `#3e415f` | `#464673` | `#59517a` | `#b0abd9` |
| `--nw-line-strong` | `line-strong` | `overlay1` | `#646781` | `#6c6d93` | `#7c7799` | `#7c76a4` |
| `--nw-line-bright` | `line-bright` | `overlay2` | `#82849b` | `#8b8cab` | `#9793af` | `#686191` |
| `--nw-primary` | `primary` | `indigo` | `#848fff` | `#848fff` | `#848fff` | `#4940d7` |
| `--nw-secondary` | `secondary` | `synth` | `#ff47d8` | `#ff47d8` | `#ff47d8` | `#a8008b` |
| `--nw-tertiary` | `tertiary` | `ice` | `#5eddfe` | `#5eddfe` | `#5eddfe` | `#006081` |
| `--nw-info` | `info` | `arc` | `#4aa9ff` | `#4aa9ff` | `#4aa9ff` | `#0055b6` |
| `--nw-success` | `success` | `matrix` | `#4bf677` | `#4bf677` | `#4bf677` | `#00680f` |
| `--nw-warning` | `warning` | `volt` | `#f8e445` | `#f8e445` | `#f8e445` | `#6e5700` |
| `--nw-danger` | `danger` | `alarm` | `#ff5d7b` | `#ff5d7b` | `#ff5d7b` | `#b6002c` |
| `--nw-ring` | `ring` | `indigo` | `#848fff` | `#848fff` | `#848fff` | `#4940d7` |
| `--nw-link` | `link` | `iris` | `#cdc0ff` | `#cdc0ff` | `#cdc0ff` | `#6746a7` |
- **Surfaces**: `canvas` is the page; `canvas-subtle` holds sidebars, navigation and inputs; `canvas-sunken` holds app chrome, HUD backdrops and code. `panel` raises cards, menus and popovers, with `panel-hover` and `panel-active` for interaction.
- **Text**: `fg` for body text, `fg-muted` for secondary text, `fg-subtle` for placeholders, `fg-faint` for icons and comments, `fg-disabled` for disabled controls.
- **Lines**: `line` for decorative hairlines and the circuit grid, `line-strong` for component boundaries such as input borders (3:1 or better), `line-bright` for emphasis.
- **Intents**: `primary` (or the `data-accent` choice), `secondary`, `tertiary`, `info`, `success`, `warning`, `danger`. `ring` follows `primary`; `link` stays `iris` so links keep their color under any accent.
## Derived tokens
These are built with `color-mix()` in `@nyxwire/css` and have no palette entry of their own.
| CSS variable | Value | Tailwind key |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `--nw-on-` | `--nw-on-accent`: text on a solid intent fill (`crust` on dark flavors, `base` on Lumen) | `on-primary`, `on-secondary`, `on-tertiary`, `on-info`, `on-success`, `on-warning`, `on-danger` |
| `--nw--soft` | intent at 16% over transparent | `primary-soft`, `secondary-soft`, `tertiary-soft`, `info-soft`, `success-soft`, `warning-soft`, `danger-soft` |
| `--nw-soft-ink` | share of the intent in text on its own soft tint, the rest is `fg`: 100% in Abyss, 90% in Nocturne, 75% in Twilight, 70% in Lumen | none (CSS only) |
| `--nw-selection` | `primary` at 32% | `selection` |
| `--nw-backdrop` | `shadow-ink` at up to 72%, behind dialogs | `backdrop` |
| `--nw-glass` | `canvas` at 78%, for panels over imagery | `glass` |
| `--nw-shadow-ink` | `crust` on dark flavors, `text` on Lumen; the ink of shadows and scrims | `shadow-ink` |
## Accents
Every accent passes 4.5:1 on `crust`, `mantle`, `base` and `surface0` in its flavor, so any of them can be used for text. Meanings stay stable across flavors:
| Accent | Roles | CSS variable | Tailwind key | Nocturne | Lumen |
| --- | --- | --- | --- | --- | --- |
| indigo | `primary`, `ring` | `--nw-indigo` | `nw-indigo` | `#848fff` | `#4940d7` |
| iris | `link` | `--nw-iris` | `nw-iris` | `#cdc0ff` | `#6746a7` |
| flux | | `--nw-flux` | `nw-flux` | `#d071ff` | `#8c16c5` |
| synth | `secondary` | `--nw-synth` | `nw-synth` | `#ff47d8` | `#a8008b` |
| alarm | `danger` | `--nw-alarm` | `nw-alarm` | `#ff5d7b` | `#b6002c` |
| flare | | `--nw-flare` | `nw-flare` | `#ff9845` | `#9d3a00` |
| volt | `warning` | `--nw-volt` | `nw-volt` | `#f8e445` | `#6e5700` |
| matrix | `success` | `--nw-matrix` | `nw-matrix` | `#4bf677` | `#00680f` |
| circuit | | `--nw-circuit` | `nw-circuit` | `#17edd5` | `#006558` |
| ice | `tertiary` | `--nw-ice` | `nw-ice` | `#5eddfe` | `#006081` |
| arc | `info` | `--nw-arc` | `nw-arc` | `#4aa9ff` | `#0055b6` |
| steel | | `--nw-steel` | `nw-steel` | `#b5bdd5` | `#4d5976` |
## Syntax roles
Generated from `syntaxRoles` and used by the [Expressive Code themes](https://nyxwire.dissidence.ovh/starlight/setup/) of the Starlight plugin. Code backgrounds are `crust`; dark flavors share the token colors.
| Role | Palette | Style | Nocturne | Lumen |
| --- | --- | --- | --- | --- |
| `keyword` | `flux` | | `#d071ff` | `#8c16c5` |
| `storage` | `synth` | | `#ff47d8` | `#a8008b` |
| `modifier` | `synth` | | `#ff47d8` | `#a8008b` |
| `string` | `matrix` | | `#4bf677` | `#00680f` |
| `number` | `flare` | | `#ff9845` | `#9d3a00` |
| `constant` | `flare` | | `#ff9845` | `#9d3a00` |
| `boolean` | `alarm` | | `#ff5d7b` | `#b6002c` |
| `null` | `alarm` | | `#ff5d7b` | `#b6002c` |
| `function` | `arc` | | `#4aa9ff` | `#0055b6` |
| `method` | `arc` | | `#4aa9ff` | `#0055b6` |
| `type` | `volt` | | `#f8e445` | `#6e5700` |
| `class` | `volt` | | `#f8e445` | `#6e5700` |
| `interface` | `volt` | | `#f8e445` | `#6e5700` |
| `enum` | `volt` | | `#f8e445` | `#6e5700` |
| `namespace` | `volt` | | `#f8e445` | `#6e5700` |
| `variable` | `text` | | `#f2f3fa` | `#1f0e47` |
| `parameter` | `iris` | | `#cdc0ff` | `#6746a7` |
| `property` | `ice` | | `#5eddfe` | `#006081` |
| `tag` | `synth` | | `#ff47d8` | `#a8008b` |
| `attribute` | `circuit` | | `#17edd5` | `#006558` |
| `operator` | `circuit` | | `#17edd5` | `#006558` |
| `punctuation` | `overlay2` | | `#8b8cab` | `#686191` |
| `comment` | `overlay2` | italic | `#8b8cab` | `#686191` |
| `regex` | `circuit` | | `#17edd5` | `#006558` |
| `escape` | `synth` | | `#ff47d8` | `#a8008b` |
| `decorator` | `synth` | | `#ff47d8` | `#a8008b` |
| `markup-heading` | `indigo` | | `#848fff` | `#4940d7` |
| `markup-link` | `iris` | | `#cdc0ff` | `#6746a7` |
| `inserted` | `matrix` | | `#4bf677` | `#00680f` |
| `deleted` | `alarm` | | `#ff5d7b` | `#b6002c` |
| `changed` | `volt` | | `#f8e445` | `#6e5700` |
| `editor-bg` | `crust` | | `#0a0329` | `#d3cefa` |
| `selection` | `indigo` | 30% opacity | `#848fff` | `#4940d7` |
| `line-highlight` | `surface0` | | `#1d154c` | `#ddd9ff` |
# Effects & motion
> Cut corners, the wire edge, neon glow, scanlines, the circuit grid, glitch, glass, and motion tokens that respect reduced motion.
The effects are the identity: cut corners, a wire edge, neon glow, scanlines, a circuit grid and a hover glitch. Use them as accents on a few elements, not as texture for every surface. The examples use the CSS utility classes; the Tailwind equivalents are on [Utilities & variants](https://nyxwire.dissidence.ovh/tailwind/utilities/).
## Glow
Glow is a colored shadow built from `--nw-glow-color`, which defaults to the primary intent. Its strength is `--nw-glow-strength`: 1 on the dark flavors, 0.45 on Lumen, where a full glow would smudge.
```html
nw-glow-sm --nw-glow-sm
nw-glow-md --nw-glow-md
nw-glow-lg --nw-glow-lg
nw-glow-info
nw-glow-success
nw-glow-danger
```
Pick a color with `.nw-glow-` (the seven intents), or set `--nw-glow-color` yourself. In Tailwind, `glow-` accepts every palette and semantic color (`glow-matrix`, `glow-info`), and `text-glow` / `text-glow-` put the same bloom on text. The glow tokens are declared on every element, so changing the color on one element rebuilds its own glow. Components already glow on hover and focus in their intent color.
```html
Text glow follows the accent
or any color you pick
Nyxwire
```
`text-wire` (Tailwind) clips `--nw-gradient-wire` (135°, primary to secondary) to the glyphs; `bg-wire` paints the same gradient as a fill.
## Cut corners
`.nw-cut` chamfers the top-right and bottom-left corners, sized by `--nw-cut` (10px). The element paints its own chamfered fill and stays unclipped, and `::before` draws the 1px edge, so a glow still fits in the box: `clip-path` would clip a `box-shadow`, so the cut utilities swap to a `drop-shadow` filter instead.
```html
nw-cut panel fill, line edge
custom --nw-fill / --nw-edge
cut + glow filter, not box-shadow
cut + wire gradient edge
```
Paint the fill through `--nw-fill` (a flat color, default panel) and the edge through `--nw-edge` (any paint, default line), not through `background` and `border`. Replaced elements (`img`, `video`, `svg`) have no pseudo-elements, so they are clipped directly and cannot glow; wrap one to give it a glow. Forced-colors mode falls back to a plain system-colored box with a real border.
## Wire edge
`.nw-wire` draws a 1px border in `--nw-gradient-wire`, primary toward the top left and secondary opposite, over an opaque `--nw-fill`; `.nw-wire-glow` adds the matching bloom. On a cut surface the wire becomes the edge paint, which also works over a translucent fill. Buttons (`.nw-btn-wire`), cards and HUD panels have wire variants.
```html
nw-wire 1px gradient border
nw-wire-glow bloom follows the wire
```
## Scanlines, grid and glitch
```html
nw-scanlines pointer-transparent overlay
nw-grid-bg --nw-grid-size 32px
nw-glitch hover or focus me
All three cut, scanlines, glow
```
| Class | Effect | Tune with |
| --------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `.nw-scanlines` | Horizontal lines from `--nw-scanlines` in a pointer-transparent `::after` | the shadow ink and flavor; lines are 3px apart |
| `.nw-grid-bg` | Circuit grid: lines every `--nw-grid-size`, a node on every fourth crossing | `--nw-grid-size` (32px), `--nw-grid-line` |
| `.nw-glitch` | One 480ms chromatic burst when the text, or the link or button around it, is hovered or focused | disabled under reduced motion |
Cut and scanlines combine (the overlay is clipped to the chamfer); the grid paints `background`, so it does not combine with cut or wire, which paint `background` too. Glitch splits the text in the secondary and tertiary colors with a step timing function.
## Glass
`glass` (a Tailwind utility) is `--nw-glass` (canvas at 78%) with a `--nw-blur-md` backdrop blur, for panels over imagery or busy backdrops. Its legibility depends on the flavor and the scene behind it: put text on a solid or cut panel when the backdrop is loud, and check the pair where you use it.
```html
glass canvas at 78% + blur
cut + glass fill translucent --nw-fill
```
Blur tokens: `--nw-blur-sm` 4px, `--nw-blur-md` 12px, `--nw-blur-lg` 24px.
## Motion
Motion answers an interaction or a state change. Durations and easings are tokens:
| Duration | Value | Easing | Curve |
| ----------------------- | ----- | -------------------- | ----------------------------------- |
| `--nw-duration-instant` | 80ms | `--nw-ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` |
| `--nw-duration-fast` | 140ms | `--nw-ease-out` | `cubic-bezier(0.16, 1, 0.3, 1)` |
| `--nw-duration-base` | 220ms | `--nw-ease-in` | `cubic-bezier(0.7, 0, 0.84, 0)` |
| `--nw-duration-slow` | 360ms | `--nw-ease-in-out` | `cubic-bezier(0.65, 0, 0.35, 1)` |
| `--nw-duration-slower` | 560ms | `--nw-ease-back` | `cubic-bezier(0.34, 1.56, 0.64, 1)` |
Hover and color changes use `fast` with `standard`; entrances use `base` with `out`; exits use `fast` with `in`; a small overshoot (`back`) suits elements that pop in. Keyframes ship as `nw-spin`, `nw-pulse`, `nw-glow-pulse`, `nw-shimmer`, `nw-fade-in`, `nw-fade-out`, `nw-zoom-in`, `nw-zoom-out`, `nw-slide-in-from-{top,bottom,left,right}` and `nw-slide-out-to-{top,bottom,left,right}`; the slides travel `--nw-slide-distance` (0.5rem for a popover, 100% for a drawer). In Tailwind they are `animate-*` utilities of the same names.
```html
nw-glow-pulse alarms, live states
nw-pulse idle work, skeletons
```
> **Note: Reduced motion**
>
> Under `prefers-reduced-motion: reduce`, the duration tokens drop to 0.01ms and every animation and
> transition jumps to its end state, so `animationend` and `transitionend` still fire. Add
> `.nw-motion-essential` to an element whose motion carries meaning, such as a spinner for pending
> work. The switch lives in `@nyxwire/css` base, which the full bundle and the `@nyxwire/tailwind`
> entry both import; import the Tailwind theme alone and Tailwind animations follow the browser
> defaults, so bring the base import or your own switch.
# Flavors & theming
> Pick a flavor with data attributes, nest scopes, swap the accent, and persist the visitor's choice without a flash.
A flavor is a complete palette: twelve neutrals from the deepest background to body text, plus twelve accents. Nyxwire has four, one wire from the deepest dark to daylight.
| Flavor | Theme | Character | Use for |
| ---------- | ----- | ----------------------------------- | -------------------------- |
| `abyss` | dark | Near-black indigo, the deepest base | Dense dashboards, HUDs |
| `nocturne` | dark | Deep electric indigo | Websites and docs, default |
| `twilight` | dark | Dusky violet-indigo, softest dark | Long reading |
| `lumen` | light | Lavender daylight, deeper accents | Light mode |
The three dark flavors share the exact same accent values; only their neutrals change.
## Try it
_Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._
This is the Vue `NwFlavorSelect` from `@nyxwire/vue`, driven by `useFlavor`. It shares one runtime with the flavor select in the header: change either and the other follows, and the choice survives a reload.
## Three attributes
| Attribute | Values | Effect |
| ------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `data-flavor` | `abyss`, `nocturne`, `twilight`, `lumen` | Selects the palette for the element and its descendants |
| `data-theme` | `dark`, `light` | Set with the flavor; drives the Tailwind `dark:`/`lumen:` variants and Starlight |
| `data-accent` | one of the [12 accents](color-roles.md#accents) | Re-points `--nw-primary`, and with it buttons, links, focus and glow |
```html
```
With no `data-flavor` on the root, Nocturne applies, or Lumen when the system prefers a light color scheme. An explicit attribute always wins over that fallback.
## Nested scopes
Every semantic token is re-declared on each `[data-flavor]` and `[data-accent]` element, so a nested scope resolves against its own palette:
```html
Lumen
Abyss, matrix accent
```
_Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._
> **Note**
>
> The Tailwind `dark:` variant matches any dark flavor scope and `light:`/`lumen:` match a Lumen
> scope, on the element or any ancestor, so inside a light scope on a dark page both match. Prefer
> semantic utilities such as `bg-canvas` and `text-fg`, which follow the nearest scope, over theme
> variants.
## Accents
`data-accent` swaps the primary intent for one subtree. Everything derived from it follows: solid buttons, links, focus rings and glow. The generated palette CSS re-resolves the accent inside nested flavor scopes against that flavor's own value, so an accent set on an ancestor carries into a Lumen scope and picks up Lumen's deeper hex.
```html
indigo
ice
arc
matrix
volt
steel
```
An inner `data-accent` beats an outer one. The generated selectors cover an accent scope inside an accent scope inside a flavor scope; nest accent scopes deeper than that and the nearest accent stops being re-resolved, so avoid going past two.
## Persisting the choice
The visitor's flavor is stored in `localStorage` under `nyxwire-flavor` as `auto`, `abyss`, `nocturne`, `twilight` or `lumen`, and the accent under `nyxwire-accent`. `auto` follows `prefers-color-scheme`: a light system gets the configured light flavor (Lumen), anything else the configured dark flavor. Every package reads and writes the same keys, so a choice made on the docs carries over to an Astro site or a Vue app on the same origin.
### The page runtime
The Astro integration, the Astro `FlavorScript` component and the Starlight plugin all install the same runtime as `window.nyxwire`. It sets `data-flavor`, `data-theme`, `data-accent`, `data-nw-flavor-preference` and `color-scheme` on ``, and updates ` `:
```js
window.nyxwire.getFlavor() // stored preference, including 'auto'
window.nyxwire.resolve() // concrete flavor in use, e.g. 'nocturne'
window.nyxwire.setFlavor('twilight') // persists, applies, dispatches the event
window.nyxwire.getAccent() // stored accent, or null for the palette default
window.nyxwire.setAccent('matrix') // persists, applies
window.nyxwire.setAccent(null) // removes data-accent, back to indigo
document.addEventListener('nyxwire:flavor', ({ detail }) => {
console.log(detail.flavor, detail.resolved, detail.theme, detail.accent)
// 'twilight' 'twilight' 'dark' 'matrix'
})
```
`nyxwire:flavor` fires on initialization, on every `setFlavor` and `setAccent` call and, while the preference is `auto`, when the system color scheme changes. `setFlavor` and `setAccent` throw a `TypeError` for unknown values. When storage is blocked, the choice still applies for the current page.
### Vue: `useFlavor`
```vue
{{ item.label }}
```
Every call inside one Vue app shares a single state; the first call supplies the app's options. On a page with `window.nyxwire`, `useFlavor` delegates to the runtime and mirrors its events, which is how the island above stays in sync with the header. Without a runtime, it runs standalone: it persists under the same key, follows the system preference while `auto`, and sets `data-flavor`, `data-theme` and `color-scheme` on `` or on a `target` element. The first call can pass options:
```ts
useFlavor({
defaults: { dark: 'abyss', light: 'lumen' }, // flavors used by 'auto'
defaultFlavor: 'auto', // when nothing is stored
storageKey: 'nyxwire-flavor',
target: () => document.querySelector('#hud'), // null applies nothing
storage: window.localStorage, // or null to keep the choice in memory
matchMedia: (query) => window.matchMedia(query),
runtime: window.nyxwire, // or null to force standalone mode
})
```
It is SSR-safe: nothing touches `window` or `document` until a component mounts.
## No flash of the wrong flavor
The runtime is a small inline script in `` that runs before the first paint, so the stored flavor is already on `` when the page draws. The Astro integration injects it into every page; on standalone Astro pages, put `FlavorScript` in the head slot of `Layout`. Without JavaScript, the CSS fallback still applies: Nocturne, or Lumen for a light system preference.
# Icons
> Lucide icons through @lucide/vue, sized by the component around them and hidden from assistive technology unless they carry meaning.
Nyxwire uses [Lucide](https://lucide.dev/) through `@lucide/vue`, a dependency of `@nyxwire/vue`: one stroked set, 24×24 grid, 2px stroke, ISC licensed. Icons are Vue components bundled with your app, so nothing loads from the network.
_Live example: [Icons](https://nyxwire.dissidence.ovh/foundations/icons/)._
## Use
```vue
Overclock
```
Every icon is exported under its name and with an `Icon` suffix (`Map` and `MapIcon`); the suffixed form avoids shadowing globals such as `Map`.
## Size and color
| Prop | Default | Notes |
| -------------------- | -------------- | --------------------------------------------------- |
| `size` | `24` | Sets `width` and `height` |
| `stroke-width` | `2` | In icon units, so it scales with the icon |
| `non-scaling-stroke` | `false` | Keeps the stroke width constant at any size |
| `color` | `currentColor` | The stroke; usually leave it and set the text color |
Inside Nyxwire components you rarely set `size`: the CSS sizes direct `svg` children to the text. Buttons use 1.2em (an icon button is square at the control height), badges 1em, and a stat icon fills its 20px box in the stat's intent color. Elsewhere, use 16px next to small text, 20px next to body text and 24px for standalone icons. Each icon also gets the classes `lucide` and `lucide-` for styling.
## Accessibility
- Lucide adds `aria-hidden="true"` automatically unless you pass an `aria-*` attribute, `role` or `title`, so an icon next to a text label is ignored by screen readers, as it should be.
- An icon-only button needs a name on the button: `aria-label="Open map"`.
- A standalone icon that carries meaning (a status, a warning) gets `role="img"` and an `aria-label`, or visible text next to it.
## Outside Vue
These docs use Starlight's `` component. On plain HTML pages, copy the SVG markup of a Lucide icon from lucide.dev into the page; the `nw-btn`, `nw-badge` and `nw-stat-icon` classes size inline `svg` elements the same way.
# Palette
> Every Nyxwire color in all four flavors, generated from @nyxwire/palette with hex, RGB, OKLCH and contrast against the flavor's base.
Each flavor has 24 named colors: twelve neutrals and twelve accents. The names are the API; the values are tuned per flavor. Colors were designed in OKLCH, gamut-mapped, and frozen as hex, the canonical form. RGB and OKLCH below are derived from that hex, and every table on this page is generated from the published package at build time.
**Neutrals**, darkest to lightest on dark flavors: `crust`, `mantle` and `base` are backgrounds; `surface0` to `surface2` are raised fills; `overlay0` to `overlay2` are lines and icons; `subtext0`, `subtext1` and `text` are text. Lumen runs the background ramp the other way (`crust` lightest around the edges, `base` the page). **Accents** are identical across the three dark flavors; Lumen has a deeper set that stays readable on light backgrounds.
The last column is the WCAG contrast ratio against the flavor's `base`. Ratios are truncated, never rounded up, and badges mark AAA (7:1), AA (4.5:1) and AA large text or UI (3:1). Backgrounds and hairlines sit below 3:1 by design.
## Abyss
The deepest dark: near-black indigo with the highest contrast, for dense dashboards and HUD frames.
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
| --- | --- | --- | --- | --- | --- |
| Crust | `--nw-crust` | `#030312` | 3 3 18 | `oklch(11.2% 0.039 278.1)` | 1.03 below 3:1 |
| Mantle | `--nw-mantle` | `#050419` | 5 4 25 | `oklch(12.8% 0.048 280.4)` | 1.02 below 3:1 |
| Base | `--nw-base` | `#080720` | 8 7 32 | `oklch(15.0% 0.052 280.2)` | base |
| Surface 0 | `--nw-surface0` | `#12122f` | 18 18 47 | `oklch(20.1% 0.056 280.1)` | 1.08 below 3:1 |
| Surface 1 | `--nw-surface1` | `#1b1c3b` | 27 28 59 | `oklch(24.4% 0.058 279.8)` | 1.20 below 3:1 |
| Surface 2 | `--nw-surface2` | `#262747` | 38 39 71 | `oklch(28.9% 0.058 280.8)` | 1.37 below 3:1 |
| Overlay 0 | `--nw-overlay0` | `#3e415f` | 62 65 95 | `oklch(38.6% 0.051 279.3)` | 2.00 below 3:1 |
| Overlay 1 | `--nw-overlay1` | `#646781` | 100 103 129 | `oklch(52.1% 0.041 279.7)` | 3.57 AA large |
| Overlay 2 | `--nw-overlay2` | `#82849b` | 130 132 155 | `oklch(62.0% 0.035 281.4)` | 5.39 AA |
| Subtext 0 | `--nw-subtext0` | `#aeb0c1` | 174 176 193 | `oklch(76.1% 0.024 280.5)` | 9.21 AAA |
| Subtext 1 | `--nw-subtext1` | `#d0d2dd` | 208 210 221 | `oklch(86.5% 0.015 277.8)` | 13.13 AAA |
| Text | `--nw-text` | `#f0f1f7` | 240 241 247 | `oklch(95.9% 0.008 278.6)` | 17.54 AAA |
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 6.92 AA |
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 11.85 AAA |
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 7.05 AAA |
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 6.73 AA |
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 6.69 AA |
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 9.25 AAA |
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 15.23 AAA |
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 13.89 AAA |
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 13.29 AAA |
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 12.48 AAA |
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 7.92 AAA |
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 10.55 AAA |
## Nocturne
The default dark: deep electric indigo. Websites and docs start here.
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
| --- | --- | --- | --- | --- | --- |
| Crust | `--nw-crust` | `#0a0329` | 10 3 41 | `oklch(15.1% 0.075 283.5)` | 1.07 below 3:1 |
| Mantle | `--nw-mantle` | `#0e0533` | 14 5 51 | `oklch(17.3% 0.085 282.8)` | 1.04 below 3:1 |
| Base | `--nw-base` | `#14093e` | 20 9 62 | `oklch(20.1% 0.094 283.5)` | base |
| Surface 0 | `--nw-surface0` | `#1d154c` | 29 21 76 | `oklch(24.5% 0.097 283.3)` | 1.11 below 3:1 |
| Surface 1 | `--nw-surface1` | `#272258` | 39 34 88 | `oklch(29.1% 0.094 283.1)` | 1.27 below 3:1 |
| Surface 2 | `--nw-surface2` | `#302d60` | 48 45 96 | `oklch(32.9% 0.088 283.1)` | 1.46 below 3:1 |
| Overlay 0 | `--nw-overlay0` | `#464673` | 70 70 115 | `oklch(41.5% 0.074 282.7)` | 2.09 below 3:1 |
| Overlay 1 | `--nw-overlay1` | `#6c6d93` | 108 109 147 | `oklch(54.9% 0.059 283.1)` | 3.73 AA large |
| Overlay 2 | `--nw-overlay2` | `#8b8cab` | 139 140 171 | `oklch(65.0% 0.046 283.6)` | 5.65 AA |
| Subtext 0 | `--nw-subtext0` | `#b2b4ca` | 178 180 202 | `oklch(77.5% 0.031 281.5)` | 9.02 AAA |
| Subtext 1 | `--nw-subtext1` | `#d4d4e3` | 212 212 227 | `oklch(87.4% 0.021 286.0)` | 12.58 AAA |
| Text | `--nw-text` | `#f2f3fa` | 242 243 250 | `oklch(96.5% 0.009 279.7)` | 16.66 AAA |
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 6.46 AA |
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 11.05 AAA |
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 6.57 AA |
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 6.27 AA |
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 6.24 AA |
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 8.63 AAA |
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 14.20 AAA |
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 12.95 AAA |
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 12.39 AAA |
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 11.63 AAA |
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 7.38 AAA |
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 9.84 AAA |
## Twilight
The softest dark: dusky violet-indigo with the lightest dark base, for long reading sessions.
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
| --- | --- | --- | --- | --- | --- |
| Crust | `--nw-crust` | `#1b1136` | 27 17 54 | `oklch(21.5% 0.069 292.0)` | 1.13 below 3:1 |
| Mantle | `--nw-mantle` | `#211540` | 33 21 64 | `oklch(23.9% 0.078 292.3)` | 1.07 below 3:1 |
| Base | `--nw-base` | `#271a4b` | 39 26 75 | `oklch(26.5% 0.087 291.6)` | base |
| Surface 0 | `--nw-surface0` | `#312457` | 49 36 87 | `oklch(30.5% 0.089 292.1)` | 1.13 below 3:1 |
| Surface 1 | `--nw-surface1` | `#3b2f61` | 59 47 97 | `oklch(34.4% 0.085 292.4)` | 1.32 below 3:1 |
| Surface 2 | `--nw-surface2` | `#453b6a` | 69 59 106 | `oklch(38.5% 0.079 292.1)` | 1.56 below 3:1 |
| Overlay 0 | `--nw-overlay0` | `#59517a` | 89 81 122 | `oklch(46.0% 0.066 292.5)` | 2.15 below 3:1 |
| Overlay 1 | `--nw-overlay1` | `#7c7799` | 124 119 153 | `oklch(58.6% 0.052 291.5)` | 3.71 AA large |
| Overlay 2 | `--nw-overlay2` | `#9793af` | 151 147 175 | `oklch(67.6% 0.041 291.8)` | 5.32 AA |
| Subtext 0 | `--nw-subtext0` | `#bab7cd` | 186 183 205 | `oklch(78.9% 0.031 291.9)` | 8.04 AAA |
| Subtext 1 | `--nw-subtext1` | `#d9d7e4` | 217 215 228 | `oklch(88.5% 0.018 293.1)` | 11.07 AAA |
| Text | `--nw-text` | `#f5f4fa` | 245 244 250 | `oklch(97.0% 0.008 293.9)` | 14.37 AAA |
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 5.50 AA |
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 9.41 AAA |
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 5.60 AA |
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 5.34 AA |
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 5.31 AA |
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 7.35 AAA |
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 12.11 AAA |
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 11.04 AAA |
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 10.56 AAA |
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 9.92 AAA |
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 6.29 AA |
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 8.38 AAA |
## Lumen
The light flavor: lavender daylight with a deeper accent set.
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
| --- | --- | --- | --- | --- | --- |
| Crust | `--nw-crust` | `#d3cefa` | 211 206 250 | `oklch(87.0% 0.061 290.3)` | 1.23 below 3:1 |
| Mantle | `--nw-mantle` | `#dedaff` | 222 218 255 | `oklch(90.3% 0.050 290.3)` | 1.10 below 3:1 |
| Base | `--nw-base` | `#eae6ff` | 234 230 255 | `oklch(93.6% 0.034 293.1)` | base |
| Surface 0 | `--nw-surface0` | `#ddd9ff` | 221 217 255 | `oklch(90.0% 0.052 290.1)` | 1.11 below 3:1 |
| Surface 1 | `--nw-surface1` | `#d1cdf8` | 209 205 248 | `oklch(86.5% 0.059 289.4)` | 1.25 below 3:1 |
| Surface 2 | `--nw-surface2` | `#c6c1ef` | 198 193 239 | `oklch(83.0% 0.064 289.9)` | 1.40 below 3:1 |
| Overlay 0 | `--nw-overlay0` | `#b0abd9` | 176 171 217 | `oklch(76.1% 0.066 289.7)` | 1.78 below 3:1 |
| Overlay 1 | `--nw-overlay1` | `#7c76a4` | 124 118 164 | `oklch(58.9% 0.070 290.1)` | 3.46 AA large |
| Overlay 2 | `--nw-overlay2` | `#686191` | 104 97 145 | `oklch(51.9% 0.075 290.2)` | 4.65 AA |
| Subtext 0 | `--nw-subtext0` | `#524a7e` | 82 74 126 | `oklch(44.1% 0.084 289.5)` | 6.53 AA |
| Subtext 1 | `--nw-subtext1` | `#3d326b` | 61 50 107 | `oklch(36.0% 0.096 289.6)` | 9.24 AAA |
| Text | `--nw-text` | `#1f0e47` | 31 14 71 | `oklch(23.1% 0.099 290.0)` | 14.24 AAA |
| Indigo | `--nw-indigo` | `#4940d7` | 73 64 215 | `oklch(48.5% 0.221 276.9)` | 5.75 AA |
| Iris | `--nw-iris` | `#6746a7` | 103 70 167 | `oklch(48.0% 0.150 295.9)` | 5.73 AA |
| Flux | `--nw-flux` | `#8c16c5` | 140 22 197 | `oklch(49.9% 0.240 310.0)` | 5.68 AA |
| Synth | `--nw-synth` | `#a8008b` | 168 0 139 | `oklch(49.6% 0.217 338.3)` | 5.68 AA |
| Alarm | `--nw-alarm` | `#b6002c` | 182 0 44 | `oklch(49.1% 0.197 20.5)` | 5.70 AA |
| Flare | `--nw-flare` | `#9d3a00` | 157 58 0 | `oklch(48.2% 0.144 42.7)` | 5.68 AA |
| Volt | `--nw-volt` | `#6e5700` | 110 87 0 | `oklch(46.7% 0.095 90.9)` | 5.70 AA |
| Matrix | `--nw-matrix` | `#00680f` | 0 104 15 | `oklch(44.9% 0.147 143.8)` | 5.77 AA |
| Circuit | `--nw-circuit` | `#006558` | 0 101 88 | `oklch(45.4% 0.082 179.9)` | 5.74 AA |
| Ice | `--nw-ice` | `#006081` | 0 96 129 | `oklch(45.8% 0.092 230.6)` | 5.77 AA |
| Arc | `--nw-arc` | `#0055b6` | 0 85 182 | `oklch(46.8% 0.169 257.4)` | 5.80 AA |
| Steel | `--nw-steel` | `#4d5976` | 77 89 118 | `oklch(46.6% 0.050 267.0)` | 5.74 AA |
## Use the values
#### JavaScript
```ts
import { flavors, flavorEntries, semanticRoles } from '@nyxwire/palette'
import type { ColorName, FlavorName } from '@nyxwire/palette'
const nocturne = flavors.nocturne
nocturne.colors.indigo.hex // '#848fff'
nocturne.colors.indigo.oklch // { l, c, h }
nocturne.colors[semanticRoles.primary].rgb // { r: 132, g: 143, b: 255 }
for (const flavor of flavorEntries) console.log(flavor.id, flavor.dark, flavor.onAccent)
```
Each color carries `name`, `label`, `order`, `accent`, `hex`, `rgb`, `hsl` and `oklch`. Each flavor carries `id`, `name`, `order`, `dark`, `colors` and `onAccent`, the palette color used for text on solid accent fills. The package also exports `colorNames`, `neutralNames`, `accentNames`, `flavorNames`, `flavorMeta`, `defaultFlavor`, `semanticRoles`, `syntaxRoles` and the `FlavorName`, `DarkFlavorName`, `ColorName`, `NeutralName`, `AccentName`, `Flavor` and `ColorFormat` types. No color library is needed at runtime.
#### JSON
```js
import palette from '@nyxwire/palette/palette.json' with { type: 'json' }
palette.flavors.lumen.colors.base.hex // '#eae6ff'
```
The JSON holds the same data as the JavaScript exports, role maps included.
#### CSS
```css
@import '@nyxwire/palette/css';
body {
background: var(--nw-base);
color: var(--nw-text);
}
```
`palette.css` declares `--nw-` for all 24 colors in `@layer theme`, for Nocturne on `:root` (with a light-scheme fallback to Lumen) and for every `[data-flavor]` value, plus `--nw--rgb` channels, `--nw-on-accent`, `--nw-flavor-dark` (`1` or `0`) and `color-scheme`. Use the RGB channels for alpha without `color-mix`: `rgb(var(--nw-indigo-rgb) / 50%)`. `[data-accent]` scopes set `--nw-accent`; the default is `var(--nw-indigo)`. To pin one flavor on `:root`, import its file instead:
```css
@import '@nyxwire/palette/css/abyss.css';
```
For components, prefer the semantic tokens from `@nyxwire/css` ([Color roles](color-roles.md)) over raw palette variables.
# Spacing & elevation
> The 0.25rem spacing grid, radius and cut scale, control heights, surface ramp, shadows and z-index layers.
## Spacing
Spacing tokens sit on a 0.25rem grid. Fractional steps use a hyphen: `--nw-space-0-5` is 0.125rem, `--nw-space-1-5` is 0.375rem and `--nw-space-2-5` is 0.625rem.
```html
--nw-space-1
0.25rem
--nw-space-2
0.5rem
--nw-space-3
0.75rem
--nw-space-4
1rem
--nw-space-5
1.25rem
--nw-space-6
1.5rem
--nw-space-8
2rem
--nw-space-10
2.5rem
--nw-space-12
3rem
--nw-space-16
4rem
--nw-space-20
5rem
--nw-space-24
6rem
```
The full set is `0`, `px` (1px), `0-5`, `1`, `1-5`, `2`, `2-5`, `3`, `4`, `5`, `6`, `8`, `10`, `12`, `16`, `20` and `24`. The Tailwind theme binds Tailwind's spacing to this grid (`--spacing: var(--nw-space-1)`), so `p-4` equals `--nw-space-4` and arbitrary values stay on the grid.
## Radius and cut
Two corner languages coexist: radii for ordinary surfaces, and the cut chamfer for signature surfaces. Buttons and inputs use `md`, cards and dialogs `lg`; the cut chamfers the top-right and bottom-left corner only.
```html
xs 2px
sm 4px
md 8px
lg 12px
xl 16px
2xl 24px
cut --nw-cut 10px
```
Tokens: `--nw-radius-xs` to `--nw-radius-2xl` and `--nw-radius-full` (9999px). Tailwind: `rounded-xs` to `rounded-2xl` map to the tokens; `rounded-full` is Tailwind's own. The cut is `.nw-cut` (or the Tailwind `cut` utility), sized by `--nw-cut` (10px); opt-in component variants `.nw-btn-cut`, `.nw-card-cut` and `.nw-hud-cut` chamfer those surfaces. See [Effects & motion](effects-motion.md#cut-corners) for how the cut paints and glows.
## Control heights
| Token | Value | Tailwind |
| ----------------- | ------- | ----------------- |
| `--nw-control-xs` | 1.75rem | `h-7` equivalents |
| `--nw-control-sm` | 2rem | `h-8` |
| `--nw-control-md` | 2.5rem | `h-10` |
| `--nw-control-lg` | 3rem | `h-12` |
Controls default to `md`; pick the size for the interaction, not the label length, and prefer `md` or larger on touch layouts. Every height clears the 24px WCAG 2.2 minimum target.
## Surfaces
Depth comes first from tone. Each step raises the surface one level; hover and active states move one more.
```html
canvas-sunken crust
canvas-subtle mantle
canvas base
panel surface0
panel-hover surface1
panel-active surface2
```
## Shadows
Shadows add separation for floating layers, tinted by `--nw-shadow-ink`: near-black on the dark flavors, the text ink at a lower strength on Lumen.
```html
shadow-sm --nw-shadow-sm
shadow-md --nw-shadow-md
shadow-lg --nw-shadow-lg
```
Cards use `sm`, toasts and HUD panels `md` or `lg`, menus, popovers and dialogs `lg`. Tailwind: `shadow-sm`, `shadow-md`, `shadow-lg`, plus `shadow-glow-sm`, `shadow-glow-md`, `shadow-glow-lg` and `shadow-glow-wire` for the neon effects. The neon glow is an effect, not elevation: see [Effects & motion](effects-motion.md#glow).
## Layers
| Token | Value | For |
| ----------------- | ----- | --------------------------- |
| `--nw-z-dropdown` | 1000 | Dropdowns and select lists |
| `--nw-z-sticky` | 1100 | Sticky headers and toolbars |
| `--nw-z-overlay` | 1300 | Backdrops |
| `--nw-z-modal` | 1400 | Dialogs and drawers |
| `--nw-z-popover` | 1500 | Popovers and menus |
| `--nw-z-toast` | 1600 | Toasts |
| `--nw-z-tooltip` | 1700 | Tooltips |
# Typography
> Three bundled variable fonts, the type scale, heading roles and the typography classes.
## Fonts
| Role | Family | Token | Tailwind | Use |
| ------- | ---------------------- | ------------------- | -------------- | -------------------------------------------- |
| Display | Space Grotesk Variable | `--nw-font-display` | `font-display` | Headings h1 to h6, display text, stat values |
| Sans | Inter Variable | `--nw-font-sans` | `font-sans` | Body text, controls, lead |
| Mono | Martian Mono Variable | `--nw-font-mono` | `font-mono` | Code, values, eyebrows, table headers |
All three are open-licensed (OFL) variable fonts shipped as local `woff2` files, Latin and Latin Extended subsets, with `font-display: swap`. They load from `@nyxwire/css/fonts.css`, which the full CSS bundle, `@nyxwire/tailwind` and the Starlight plugin import. No request leaves your origin.
Space Grotesk leans technical and slightly wide, which is why it carries headings and numbers; Inter carries everything you read at length; Martian Mono is a wide monospace with tall x-height, tuned for short labels and code.
## Specimen
```html
Signal on the wire
Indigo tubes and quiet panels
Cut corners, readable in every flavor
Panels, cards and HUD frames
Section headings in the display face
Section label in the body face
h6 keeps the display face here
Mono uppercase eyebrow
Lead text opens a section at 1.25rem with normal leading and muted ink.
Body copy is Inter at 1rem with 1.55 line height. It carries strong text ,
emphasis and inline code without changing rhythm.
channel.alerts · latency 12ms · 0123456789 != =>
```
## Heading roles
Element defaults in `@nyxwire/css` base styles, mirrored by classes so any tag can take a role:
| Role | Class | Font | Size | Weight | Notes |
| ------- | ------------- | ------- | --------------------------------- | ------ | ----------------------------------------- |
| Display | `.nw-display` | display | `clamp(3rem, 2rem + 5vw, 4.5rem)` | 700 | leading 1, tracking −0.03em |
| h1 | `.nw-h1` | display | 2.25rem (`--nw-text-4xl`) | 700 | leading 1.15, tracking −0.03em |
| h2 | `.nw-h2` | display | 1.875rem (`--nw-text-3xl`) | 700 | leading 1.15, tracking −0.015em |
| h3 | `.nw-h3` | display | 1.5rem (`--nw-text-2xl`) | 600 | leading 1.3, tracking −0.015em |
| h4 | `.nw-h4` | display | 1.25rem (`--nw-text-xl`) | 600 | leading 1.3, tracking −0.015em |
| h5 | `.nw-h5` | display | 1.125rem (`--nw-text-lg`) | 600 | leading 1.3, tracking −0.015em |
| h6 | `.nw-h6` | display | 1rem (`--nw-text-base`) | 600 | leading 1.3, tracking −0.015em |
| Eyebrow | `.nw-eyebrow` | mono | 0.6875rem (`--nw-text-2xs`) | 500 | uppercase, tracking 0.18em, `primary` ink |
| Lead | `.nw-lead` | sans | 1.25rem (`--nw-text-xl`) | 400 | leading 1.55, `fg-muted` |
Headings balance their lines (`text-wrap: balance`) and paragraphs avoid orphans (`text-wrap: pretty`). Helpers: `.nw-mono` (mono font), `.nw-text-muted`, `.nw-text-subtle`, `.nw-text-faint`, `.nw-text-disabled` and `.nw-text-` for colored text. For long-form HTML, wrap it in `.nw-prose` (`.nw-prose-sm`, `.nw-prose-lg`, `.nw-prose-wide`), which styles lists, quotes, code, tables and rules at a 68ch measure.
## Scale
| Token | Size | Tailwind |
| ---------------- | --------- | ----------- |
| `--nw-text-2xs` | 0.6875rem | `text-2xs` |
| `--nw-text-xs` | 0.75rem | `text-xs` |
| `--nw-text-sm` | 0.875rem | `text-sm` |
| `--nw-text-base` | 1rem | `text-base` |
| `--nw-text-lg` | 1.125rem | `text-lg` |
| `--nw-text-xl` | 1.25rem | `text-xl` |
| `--nw-text-2xl` | 1.5rem | `text-2xl` |
| `--nw-text-3xl` | 1.875rem | `text-3xl` |
| `--nw-text-4xl` | 2.25rem | `text-4xl` |
| `--nw-text-5xl` | 3rem | `text-5xl` |
| `--nw-text-6xl` | 3.75rem | `text-6xl` |
| `--nw-text-7xl` | 4.5rem | `text-7xl` |
The Tailwind theme re-binds Tailwind's own size names to these tokens, with leading from `snug` up. `text-base`, `text-sm` and smaller keep Tailwind's default line heights; `text-xl` and up pair with the tighter leading tokens.
| Leading | Value | Tracking | Value |
| ---------------------- | ----- | ----------------------- | -------- |
| `--nw-leading-none` | 1 | `--nw-tracking-tighter` | −0.03em |
| `--nw-leading-tight` | 1.15 | `--nw-tracking-tight` | −0.015em |
| `--nw-leading-snug` | 1.3 | `--nw-tracking-normal` | 0 |
| `--nw-leading-normal` | 1.55 | `--nw-tracking-wide` | 0.04em |
| `--nw-leading-relaxed` | 1.7 | `--nw-tracking-wider` | 0.08em |
| | | `--nw-tracking-widest` | 0.18em |