Navigation
Inputs & Forms
Selection
Containers & Overlays
Overview
Slider picks a number or a range between min and max. A number as value gives one thumb, a [from, to] tuple a range.
Budget
50 €200 €
"use client";import React, {useState} from "react";import {Slider} from "@brynlabs/fusion-ui";export const SliderExample = () => {const [value, setValue] = useState(100);return (<Sliderlabel={"Budget"}min={50}max={200}formatLabel={value => `${value} €`}value={value}onChange={setValue}/>);};
Ticks
Budget*
50 €200 €
50200
Helper Text
"use client";import React, {useState} from "react";import {Slider} from "@brynlabs/fusion-ui";export const SliderTicksExample = () => {const [value, setValue] = useState(100);return (<Sliderlabel={"Budget"}hint={"Helper Text"}required={true}min={50}max={200}formatLabel={value => `${value} €`}showTicks={true}value={value}onChange={setValue}/>);};
Histogram with few values
A histogram above the track shows how the values are distributed.
Rating
1 ★5 ★
15
Every bar is centered on its rating, the first and last bar are half as wide.
"use client";import React, {useState} from "react";import {Slider} from "@brynlabs/fusion-ui";// Maps every star rating to the number of reviews with that rating.const ratingDistribution = {1: 12, 2: 8, 3: 25,4: 61, 5: 44};export const SliderRatingExample = () => {const [value, setValue] = useState<[number, number]>([3, 5]);return (<Sliderlabel={"Rating"}hint={"Every bar is centered on its rating, the first and last bar are half as wide."}min={1}max={5}formatLabel={value => `${value} ★`}showTicks={true}histogram={ratingDistribution}value={value}onChange={setValue}/>);};
Range with histogram
Price range
50 €200 €
50200
Helper Text
"use client";import React, {useState} from "react";import {Slider} from "@brynlabs/fusion-ui";// Maps prices to the number of products with that price.const priceDistribution = {50: 12,60: 25,70: 38,80: 45,90: 52,100: 48,110: 40,120: 33,130: 27,140: 22,150: 30,160: 41,170: 36,180: 24,190: 15,200: 8,};export const SliderRangeExample = () => {const [value, setValue] = useState<[number, number]>([100, 140]);return (<Sliderlabel={"Price range"}hint={"Helper Text"}min={50}max={200}step={10}formatLabel={value => `${value} €`}showTicks={true}histogram={priceDistribution}value={value}onChange={setValue}/>);};

