Slider
Native accessible range paired with bounded exact number and unit editing.
Exact and visual editing
Native accessible range paired with bounded exact number and unit editing.
Code
<link
rel="component"
href="@threadlabs/looma/components/ui-slider/ui-slider.html"
>
<ui-slider
label="Sam’s focus time"
value="25"
min="5"
max="60"
step="5"
unit="min"
></ui-slider><script setup>
import { UiSlider } from "@threadlabs/looma";
</script>
<template>
<UiSlider
label="Sam’s focus time"
:value="25"
:min="5"
:max="60"
:step="5"
unit="min"
/>
</template>import { UiSlider } from "@threadlabs/looma";
export default function Example() {
return <UiSlider
label="Sam’s focus time"
value={25}
min={5}
max={60}
step={5}
unit="min"
/>;
}/** @jsxImportSource preact */
import { UiSlider } from "@threadlabs/looma";
export default function Example() {
return <UiSlider
label="Sam’s focus time"
value={25}
min={5}
max={60}
step={5}
unit="min"
/>;
}<script>
import { UiSlider } from "@threadlabs/looma";
</script>
<UiSlider
label="Sam’s focus time"
value={25}
min={5}
max={60}
step={5}
unit="min"
/>import { Component } from "@angular/core";
import { UiSlider } from "@threadlabs/looma";
@Component({
selector: "example-view",
standalone: true,
imports: [UiSlider],
template: `
<span
ui-slider
[label]="'Sam’s focus time'"
[value]="25"
[min]="5"
[max]="60"
[step]="5"
[unit]="'min'"
></span>
`,
})
export default class Example {}API
Package: @threadlabs/looma · Native root: span
Attributes
| Name | Description | Property | Type | Default | Allowed values |
|---|---|---|---|---|---|
compact | Pairs a short exact field with the track, without separate step buttons. Keyboard stepping and arithmetic remain available. | compact | boolean | false | — |
disabled | Prevents typing, stepping and pointer or keyboard changes while keeping the value visible. | disabled | boolean | false | — |
label | Accessible name for the editing control. | label | string | Value | — |
max | Inclusive upper bound for dragging, keyboard steps and exact entry. | max | number | 100 | — |
min | Inclusive lower bound for dragging, keyboard steps and exact entry. | min | number | 0 | — |
name | Optional numeric form field name. | name | string | | — |
size | Shared field and button height. | size | keyword | md | sm, md, lg |
step | Positive native range and exact entry increment. | step | number | 1 | — |
unit | Unit shown by the exact editor. | unit | string | | — |
value | Current numeric value. Native range and exact entry share bounds. | value | number | 0 | — |
Framework props
| Name | Type | Default | Allowed values |
|---|---|---|---|
compact | boolean | false | — |
disabled | boolean | false | — |
label | string | Value | — |
max | number | 100 | — |
min | number | 0 | — |
name | string | | — |
size | "sm" | "md" | "lg" | md | sm, md, lg |
step | number | 1 | — |
unit | string | | — |
value | number | 0 | — |
Events
| Name | Detail | Description |
|---|---|---|
change | object
| Emitted when a toggleable control changes checked state. |
input | object
| Emitted with the declared detail payload. |
Slots
No slots.
Design tokens
Set shared theme properties on a theme boundary. Component hooks apply only to their owning component.
Component tokens
No component tokens.
Shared tokens
| Token | Fallback |
|---|---|
--ui-accent-solid | — |
--ui-control-focus | var(--ui-accent-solid) |
--ui-control-min-block-size | — |
--ui-control-size-lg | — |
--ui-control-size-md | — |
--ui-control-size-sm | — |
--ui-focus-width | — |
--ui-radius-sm | — |
--ui-space-1 | — |
--ui-space-2 | — |