BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ericts-ui/expandable-slider

Expandable Slider

ericts-ui/expandable-slider
FreeComponent

A composable icon button that grows into a wider button on hover, focus, or drag, revealing a draggable track inside the same surface.

Live preview

live · rendered by the registry
Rendered by ericts-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.ericts.com/r/expandable-slider.json

Source

registry/base/ui/expandable-slider.tsxui.ericts.com/r/expandable-slider.json · first 6 KB
1"use client";
2
3import * as React from "react";
4
5import { cn } from "@/lib/utils";
6
7// The surface is one pill: collapsed it is an icon button, expanded it is a
8// wider button that holds the track. Pill radii nest cleanly, so the trigger
9// fills the surface's content box instead of carrying its own box model.
10//
11// The glyph, rail, and handle keep the YouTube player's volume control sizing;
12// the box around them is tighter and the track is longer. The rim alone no
13// longer clears the glyph, so the track carries a small leading inset to hold
14// YouTube's 8px gap. The tail is wider than the lead only because our surface
15// ends in a rounded cap that a player bar does not have.
16const SURFACE_HEIGHT = 36;
17const SURFACE_BORDER = 1;
18const TRIGGER_SIZE = SURFACE_HEIGHT - SURFACE_BORDER * 2;
19const ICON_SIZE = 24;
20const DEFAULT_TRACK_WIDTH = 72;
21const RAIL_HEIGHT = 3;
22const THUMB_SIZE = 12;
23const TRACK_INSET = 4;
24const TRACK_END_INSET = 12;
25const PAGE_STEP_MULTIPLIER = 10;
26// Leaving the surface should not snap it shut: a grace period forgives a
27// pointer that clips the rounded cap on its way to the thumb. 300ms is the
28// hover-intent convention (Radix's close delay) and keeps the whole exit —
29// grace plus the 200ms collapse — inside half a second, so a control this
30// frequently used never reads as stuck open.
31const DEFAULT_COLLAPSE_DELAY = 300;
32
33type ExpandableSliderContextValue = {
34 value: number;
35 min: number;
36 max: number;
37 step: number;
38 /** Position of the value in [0, 1]. */
39 ratio: number;
40 disabled: boolean;
41 expanded: boolean;
42 dragging: boolean;
43 label: string;
44 valueText?: string;
45 trackWidth: number;
46 /** Attached by the rail; every measurement is taken from it. */
47 railRef: React.RefObject<HTMLDivElement | null>;
48 commitValue: (next: number) => void;
49 valueFromPointer: (clientX: number) => number | undefined;
50 stepBy: (steps: number) => void;
51 setDragging: (dragging: boolean) => void;
52};
53
54const ExpandableSliderContext =
55 React.createContext<ExpandableSliderContextValue | null>(null);
56
57function useExpandableSliderContext(component: string) {
58 const context = React.useContext(ExpandableSliderContext);
59
60 if (!context) {
61 throw new Error(`${component} must be rendered inside <ExpandableSlider>.`);
62 }
63
64 return context;
65}
66
67export type ExpandableSliderProps = Omit<
68 React.ComponentProps<"div">,
69 "defaultValue" | "onChange"
70> & {
71 /** Controlled value. */
72 value?: number;
73 /** Initial value for uncontrolled usage. */
74// … truncated

Files it writes

  • registry/base/ui/expandable-slider.tsx

Facts

Registry
ericts-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-15
Last confirmed
today

Go to the source

Docs on ericts-ui ui.ericts.com EricTsai83/ericts-ui on GitHub Raw registry item This item as JSON

More from ericts-ui

All 43 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Adaptive Draweradaptive-drawerericts-uiComponentsFree2 deps
Adaptive Switchadaptive-switchericts-uiComponentsFree2 deps
Check Markcheck-markericts-uiComponentsFreeno deps · 2 files
Context Cursorcontext-cursorericts-uiComponentsFree1 dep
Copy Buttoncopy-buttonericts-uiComponentsFree2 deps
Expandable Dialogexpandable-dialogericts-uiComponentsFree1 dep
Expandable Panelexpandable-panelericts-uiComponentsFree2 deps
Expandable Segmented Tabsexpandable-segmented-tabsericts-uiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex