BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/scrub-bar

scrub-bar

elevenlabs/scrub-bar
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/scrub-bar.json

Source

components/ui/scrub-bar.tsxraw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/scrub-bar.json
1"use client"
2
3import * as React from "react"
4import {
5 createContext,
6 useCallback,
7 useContext,
8 useRef,
9 type ComponentProps,
10 type HTMLAttributes,
11} from "react"
12
13import { cn } from "@/lib/utils"
14import { Progress } from "@/components/ui/progress"
15
16function formatTimestamp(value: number) {
17 if (!Number.isFinite(value) || value < 0) return "0:00"
18 const totalSeconds = Math.floor(value)
19 const minutes = Math.floor(totalSeconds / 60)
20 const seconds = totalSeconds % 60
21 return `${minutes}:${seconds.toString().padStart(2, "0")}`
22}
23
24interface ScrubBarContextValue {
25 duration: number
26 value: number
27 progress: number
28 onScrub?: (time: number) => void
29 onScrubStart?: () => void
30 onScrubEnd?: () => void
31}
32
33const ScrubBarContext = createContext<ScrubBarContextValue | null>(null)
34
35function useScrubBarContext() {
36 const context = useContext(ScrubBarContext)
37 if (!context) {
38 throw new Error("useScrubBarContext must be used within a ScrubBar.Root")
39 }
40 return context
41}
42
43interface ScrubBarContainerProps extends HTMLAttributes<HTMLDivElement> {
44 duration: number
45 value: number
46 onScrub?: (time: number) => void
47 onScrubStart?: () => void
48 onScrubEnd?: () => void
49}
50
51function ScrubBarContainer({
52 duration,
53 value,
54 onScrub,
55 onScrubStart,
56 onScrubEnd,
57 children,
58 className,
59 ...props
60}: ScrubBarContainerProps) {
61 const progress = duration > 0 ? (value / duration) * 100 : 0
62
63 const contextValue: ScrubBarContextValue = {
64 duration,
65 value,
66 progress,
67 onScrub,
68 onScrubStart,
69 onScrubEnd,
70 }
71
72 return (
73 <ScrubBarContext.Provider value={contextValue}>
74 <div
75 data-slot="scrub-bar-root"
76 className={cn("flex w-full items-center", className)}
77 {...props}
78 >
79 {children}
80 </div>
81 </ScrubBarContext.Provider>
82 )
83}
84ScrubBarContainer.displayName = "ScrubBarContainer"
85
86type ScrubBarTrackProps = HTMLAttributes<HTMLDivElement>
87
88function ScrubBarTrack({ className, children, ...props }: ScrubBarTrackProps) {
89 const trackRef = useRef<HTMLDivElement | null>(null)
90 const { duration, onScrub, onScrubStart, onScrubEnd, value } =
91 useScrubBarContext()
92
93 const getTimeFromClientX = useCallback(
94 (clientX: number) => {
95 const track = trackRef.current
96 if (!track || !duration) return null
97 const rect = track.getBoundingClientRect()
98 const ratio = (clientX - rect.left) / rect.width
99 const clamped = Math.min(Math.max(ratio, 0), 1)
100// … truncated

What it pulls in

Other registry items

  • progress

Files it writes

  • registry/elevenlabs-ui/ui/scrub-bar.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-08
Last confirmed
3 days ago

Go to the source

ui.elevenlabs.io elevenlabs/ui on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 50 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
audio-playeraudio-playershadcn/uiComponentsFree2 deps
bar-visualizerbar-visualizershadcn/uiComponentsFreeno deps
conversationconversationshadcn/uiComponentsFree1 dep
conversation-barconversation-barshadcn/uiComponentsFree1 dep
live-waveformlive-waveformshadcn/uiComponentsFreeno deps
matrixmatrixshadcn/uiComponentsFreeno deps
messagemessageshadcn/uiComponentsFree1 dep
mic-selectormic-selectorshadcn/uiComponentsFreeno deps

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