Astryx

Astryx Slider

Forms

About

A draggable control for selecting a numeric value or range within defined bounds. Supports single value and range selection, tick marks, custom value formatting, and vertical orientation. Use it when users need to explore a continuous range, such as volume, price, or percentage. Under a finger, on any touch device, it tracks as UISlider does: only the thumb takes a drag, through a target larger than it, the value follows the finger’s travel rather than jumping to it, a release coasts on before `onChangeEnd`, a swipe from the track scrolls the page, and a tap on the track or a mark sets the value when the finger lifts (the thumb springs there). A mouse drag on a thumb tracks the same way, past the same 10 px in any direction, with no lift or coast; a mouse press on the track moves the thumb there, and only a primary click presses. A pen drags as a finger does, claiming only along the track, and its drag ends at the release with no coast. A wheel or a trackpad scroll over the slider goes to whatever scrolls under it. Astryx by Meta. Source: https://astryx.atmeta.com/components/Slider

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Slider to your project and fits it to your theme.

Code

How Astryx Slider is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-slider.tsx. */

import '@/components/ui/astryx-slider-utils/astryx-preview.css';
import {useState} from 'react';
import {Slider} from '@/components/ui/astryx-slider';

function OfficialSample() {
  const [value, setValue] = useState(50);
  return (
    <Slider
      containerStyle={{width: '100%'}}
      label="Volume"
      value={value}
      onChange={setValue}
      marks={[
        {value: 0, label: '0'},
        {value: 25, label: '25'},
        {value: 50, label: '50'},
        {value: 75, label: '75'},
        {value: 100, label: '100'},
      ]}
    />
  );
}

export default function Demo() {
  return (
    <div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
      <div className="astryx-demo-content" data-centered style={{maxWidth: 380}}>
        <OfficialSample />
      </div>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    27
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    10

More in Forms

View all
  • Contact Form

    Contact Form

    30
  • Form

    Form

    7
  • Premium Auth

    Premium Auth

    607
  • Book A Demo 1

    Book A Demo 1

    94
  • Card Studio

    Card Studio

    48
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    16
  • Paper Plane

    Paper Plane

    30