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

NameDescriptionPropertyTypeDefaultAllowed values
compactPairs a short exact field with the track, without separate step buttons. Keyboard stepping and arithmetic remain available.compactbooleanfalse—
disabledPrevents typing, stepping and pointer or keyboard changes while keeping the value visible.disabledbooleanfalse—
labelAccessible name for the editing control.labelstringValue—
maxInclusive upper bound for dragging, keyboard steps and exact entry.maxnumber100—
minInclusive lower bound for dragging, keyboard steps and exact entry.minnumber0—
nameOptional numeric form field name.namestring—
sizeShared field and button height.sizekeywordmdsm, md, lg
stepPositive native range and exact entry increment.stepnumber1—
unitUnit shown by the exact editor.unitstring—
valueCurrent numeric value. Native range and exact entry share bounds.valuenumber0—

Framework props

NameTypeDefaultAllowed values
compactbooleanfalse—
disabledbooleanfalse—
labelstringValue—
maxnumber100—
minnumber0—
namestring—
size"sm" | "md" | "lg"mdsm, md, lg
stepnumber1—
unitstring—
valuenumber0—

Events

NameDetailDescription
changeobject
  • value: number (required)
Emitted when a toggleable control changes checked state.
inputobject
  • value: number (required)
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

TokenFallback
--ui-accent-solid—
--ui-control-focusvar(--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—