Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also
accepted unless noted.
NumberField.Root
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
value | number | null | undefined | — | Controlled value. |
defaultValue | number | null | — | Uncontrolled initial value. |
onValueChange | ((value: number | null, event: Event) => void) | undefined | — | Event handler called when the value changes. |
min | number | undefined | — | — |
max | number | undefined | — | — |
step | number | — | — |
disabled | boolean | false | Whether the control ignores user interaction. |
name | string | undefined | — | — |
required | boolean | — | — |
children | Snippet<[{ value: number | null; disabled: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
data-scrubbing | Present on the element when applicable. |
NumberField.Decrement
Extends button HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
NumberField.Group
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
NumberField.Increment
Extends button HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
NumberField.Input
Extends input HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
NumberField.ScrubArea
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
pixelSensitivity | number | — | — |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
data-scrubbing | Present on the element when applicable. |
NumberField.ScrubAreaCursor
Extends span HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-scrubbing | Present on the element when applicable. |