Skip to content

Slider

Slider

Input component for selecting a numeric value from a range using a draggable handle.

Import

import { SliderComponent } from '@primitivekit/angular';

Basic Usage

<pk-slider>Content</pk-slider>

Props

No props available.

Customization

The Slider component supports CSS variables for complete customization:

<pk-slider [style]="{
  '--slider-bg-color': '#007bff',
  '--slider-text-color': '#ffffff'
}">Custom</pk-slider>

Design Tokens

The following design tokens are available for customization:

  • --slider-height
  • --slider-padding
  • --disabled
  • --slider-rail-height
  • --slider-rail-background
  • --slider-rail-border-radius
  • --slider-track-background
  • --slider-track-height
  • --slider-track-border-radius
  • --slider-transition-duration
  • … and 46 more

Accessibility

The Slider component is fully accessible and follows WCAG 2.1 AA standards:

  • ✅ Semantic HTML elements
  • ✅ Keyboard accessible
  • ✅ Focus visible indicator
  • ✅ Proper ARIA attributes
  • ✅ Screen reader compatible
  • ✅ Touch target size (44x44px minimum)
  • ✅ Color contrast compliance

Keyboard Navigation

KeyAction
TabMove focus to/from component
EnterActivate component
SpaceActivate component

Related Components

  • Button - Interactive button component with multiple variants, sizes, and states for triggering actions.
  • Input - Text input field component with validation, icons, and various input types.
  • Select - Dropdown component for selecting one or multiple options from a list.
  • Checkbox - Form input component for selecting one or multiple options from a set.
  • Radio - Form input component for selecting a single option from a set of mutually exclusive choices.

See Also