Import the public directive from the published package entrypoint.

slider.ts
import { KuiSlider } from '@kikita-labs/ui';

Use native range input semantics first. Prefer a wrapping kui-field for visible labels and helper text instead of hand-written labels or description ids.

Use arrow keys, Home, and End.

<div class="basic-slider-example">
  <kui-field label="Volume" hint="Use arrow keys, Home, and End.">
    <input type="range" kuiSlider min="0" max="100" value="60" />
  </kui-field>

  <input
    type="range"
    kuiSlider
    color="success"
    size="lg"
    min="0"
    max="100"
    value="40"
    minLabel="0"
    maxLabel="100"
    aria-label="Progress"
  />
</div>

min, max, step, and value are native range attributes. kuiSlider reads them directly to size the fill and thumb.

min 0.5, max 2, step 0.25

min 1, max 5, step 1

<div class="slider-range-example">
  <kui-field label="Playback speed" hint="min 0.5, max 2, step 0.25">
    <input
      type="range"
      kuiSlider
      min="0.5"
      max="2"
      step="0.25"
      value="1"
      minLabel="0.5x"
      maxLabel="2x"
    />
  </kui-field>

  <kui-field label="Rating" hint="min 1, max 5, step 1">
    <input type="range" kuiSlider min="1" max="5" step="1" value="3" minLabel="1" maxLabel="5" />
  </kui-field>
</div>

disabled mirrors native disabled styling. invalid applies invalid styling outside a kui-field error state.

Disabled until a plan is selected.

<div class="slider-disabled-example">
  <kui-field label="Storage limit" hint="Disabled until a plan is selected.">
    <input type="range" kuiSlider min="0" max="100" value="25" disabled />
  </kui-field>

  <input type="range" kuiSlider min="0" max="100" value="70" invalid aria-label="Invalid slider" />
</div>

Use Angular Signal Forms formField on the same native range input. Angular owns the native value, disabled, and validation state; kuiSlider keeps the generated visuals in sync. Use the min(...) and max(...) schema validators instead of native min/max attributes when formField is bound.

Signal Forms native range binding

<div class="slider-field-example">
  <kui-field label="Volume" hint="Signal Forms native range binding">
    <input type="range" kuiSlider [formField]="settingsForm.volume" />
  </kui-field>
</div>

Set defaults.slider once for the application or for a subtree. Each option resolves as local input > defaults.slider.<option> > built-in default.

import { provideKikitaUi } from '@kikita-labs/ui';

export const appConfig: ApplicationConfig = {
  providers: [
    provideKikitaUi({
      defaults: {
        slider: {
          /* options below */
        },
      },
    }),
  ],
};
NameTypeDefaultDescription
size'sm' | 'md' | 'lg' — Component size. Takes precedence over the global defaults.size.
color'primary' | 'success' | 'danger' | 'neutral' — Default colour role.

Set any of these on the component or an ancestor to restyle one part. Each token is optional: when it is not set, the part uses the role or scale token in the default column.

NameTypeDefaultDescription
--kui-slider-fill-bgCSS custom property--kui-color-primary-indicatorFill background
--kui-slider-fill-bg-primaryCSS custom property--kui-color-primary-indicatorFill background, primary
--kui-slider-fill-bg-successCSS custom property--kui-color-success-indicatorFill background, success
--kui-slider-fill-bg-dangerCSS custom property--kui-color-danger-indicatorFill background, danger
--kui-slider-fill-bg-neutralCSS custom property--kui-color-text-secondaryFill background, neutral
--kui-slider-fill-bg-invalidCSS custom property--kui-color-danger-indicatorFill background, invalid
--kui-slider-thumb-bgCSS custom property--kui-color-primary-indicatorThumb background
--kui-slider-thumb-bg-primaryCSS custom property--kui-color-primary-indicatorThumb background, primary
--kui-slider-thumb-bg-successCSS custom property--kui-color-success-indicatorThumb background, success
--kui-slider-thumb-bg-dangerCSS custom property--kui-color-danger-indicatorThumb background, danger
--kui-slider-thumb-bg-neutralCSS custom property--kui-color-text-secondaryThumb background, neutral
--kui-slider-thumb-bg-invalidCSS custom property--kui-color-danger-indicatorThumb background, invalid
--kui-slider-thumb-focus-ring-colorCSS custom property--kui-color-focusThumb focus outline color
--kui-slider-track-bg-disabledCSS custom property--kui-color-surface-elevatedTrack background, disabled
--kui-slider-fill-bg-disabledCSS custom property--kui-color-text-disabledFill background, disabled
--kui-slider-thumb-bg-disabledCSS custom property--kui-color-text-disabledThumb background, disabled
--kui-slider-tooltip-bgCSS custom property--kui-color-textTooltip background
--kui-slider-tooltip-colorCSS custom property--kui-color-bgTooltip color
--kui-slider-tooltip-arrow-colorCSS custom property--kui-color-textTooltip arrow color
--kui-slider-labels-colorCSS custom property--kui-color-text-secondaryLabels color
NameTypeDefaultDescription
--kui-slider-tooltip-text-font-sizeCSS custom property--kui-text-xs-sizeTooltip text font size
--kui-slider-labels-font-sizeCSS custom property--kui-text-xs-sizeLabels font size
--kui-slider-thumb-sizeCSS custom property18px (sm 14px, lg 22px)Thumb diameter; sets the track inset and the block padding
--kui-slider-thumb-size-activeCSS custom propertythumb size + 4pxThumb diameter while pressed
--kui-slider-track-sizeCSS custom property4px (sm 2px, lg 6px)Track thickness
--kui-slider-thumb-shadowCSS custom propertynoneThumb shadow at rest
--kui-slider-thumb-shadow-hoverCSS custom propertyhalo and 1px 3px black 30%Thumb shadow on hover
--kui-slider-thumb-shadow-focusCSS custom property1px 2px black 30%Thumb shadow on keyboard focus
--kui-slider-thumb-shadow-activeCSS custom property2px 8px black 50% and haloThumb shadow while pressed

Inputs verified against @kikita-labs/ui v2.0.0 public typings.

NameTypeDefaultDescription
kuiSliderdirective — Selector input[type=range][kuiSlider]. Applies Kikita UI slider styling and behavior to a native range input.
color'primary' | 'success' | 'danger' | 'neutral' | undefinedundefinedSemantic color applied to the generated slider fill and thumb.
size'sm' | 'md' | 'lg' | undefinedundefinedVisual size of the generated slider control.
minLabelstring''Optional label rendered below the minimum side of the track.
maxLabelstring''Optional label rendered below the maximum side of the track.
disabledbooleanfalseMirrors disabled styling on the generated slider wrapper.
invalidbooleanfalseApplies invalid styling outside a kui-field error state.
idstring | undefined — Explicit native input id. Falls back to the parent kui-field control id.
min / max / step / valuenative attributes — Native range input attributes. kuiSlider reads them directly; use them (or Signal Forms min/max validators) instead of a directive input.
kuiTooltipstring — When set to a non-empty string on the same host, the static tooltip text wins over the default value tooltip. Otherwise kuiSlider shows the current numeric value in a tooltip on hover.
[formField]FieldTree<number> (from @angular/forms/signals) — Angular Signal Forms binding. Owns native value, disabled, and validation state; kuiSlider keeps the generated track and thumb visuals in sync. Do not add native min/max alongside formField; use the min(...) and max(...) schema validators instead.
KuiSliderOptionsinterface-Shape of defaults.slider: size and color.

Slider keeps native range input semantics instead of replacing them with ARIA roles.

  • Use a visible label through kui-field or a native label; otherwise provide aria-label.
  • Arrow keys, Home, and End are native range input keyboard behavior and are preserved.
  • When projected inside kui-field, kuiSlider inherits the field id, aria-describedby, and aria-invalid.
  • Use invalid only when the slider is outside field error wiring.
  • The default tooltip shows the current numeric value on hover, and also on keyboard focus and while adjusting with the keyboard, so arrow-key users see what they set. It is hoverable and Escape dismisses it (WCAG 1.4.13). A non-empty kuiTooltip on the same host overrides it with static text.
  • Disabled sliders get native disabled semantics, and the track, fill and thumb stay visible under forced-colors: active.

Consumer-visible changes of @kikita-labs/ui 2.0 for Slider.

  • The directive class is KuiSlider; the Directive suffix is gone.
  • Size and colour defaults moved to provideKuiDefaults({ slider: { size, color } }); the inputs are now undefined until set.
  • The value tooltip also shows on keyboard focus and while adjusting with the keyboard, and Escape dismisses it.
  • Every colour part has a token, and the thumb and track have size tokens (--kui-slider-thumb-size, --kui-slider-track-size) and shadow tokens.
  • A required kui-field sets aria-required, and the slider is covered by forced-colors.