BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/nexvyn/bars-theme

Bars Theme

nexvyn/bars-theme
FreeComponent

A traveling-wave bars visualization with 5 vertical bars sharing a sine-wave frequency, evenly phase-shifted left to right so the wave appears to travel across. Volume scales bar heights with a diamond-shaped idle boost.

Live preview

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

Install it

npx shadcn@latest add https://ui.nexvyn.dev/r/bars-theme.json

Source

components/ui/bars-theme.tsxui.nexvyn.dev/r/bars-theme.json · first 6 KB
1'use client'
2
3import { useEffect, useRef } from 'react'
4import type { AriaAttributes, CSSProperties } from 'react'
5import { useReducedMotion } from 'motion/react'
6import { useCssColorRgb } from '@/lib/hooks/use-css-color-rgb'
7
8export type OrbState = 'idle' | 'connecting' | 'listening' | 'thinking' | 'speaking' | 'error'
9
10type DataAttributeValue = string | number | boolean | null | undefined
11
12export interface OrbHtmlAttributes extends AriaAttributes {
13 id?: string
14 title?: string
15 role?: string
16 tabIndex?: number
17 [dataAttribute: `data-${string}`]: DataAttributeValue
18}
19
20export interface BarsThemeProps extends OrbHtmlAttributes {
21 state: OrbState
22 volume: number
23 size: number
24 className?: string
25 style?: CSSProperties
26 disabled?: boolean
27 interactive?: boolean
28 onClick?: () => void
29}
30
31const BAR_COUNT = 5
32const WAVE_FREQ = 1.4
33const WAVE_PHASE_STEP = (Math.PI * 2) / BAR_COUNT
34
35const STATE_COLOR_TOKEN: Record<OrbState, 'accent' | 'destructive'> = {
36 idle: 'accent',
37 connecting: 'accent',
38 listening: 'accent',
39 thinking: 'accent',
40 speaking: 'accent',
41 error: 'destructive',
42}
43
44const FALLBACK_ACCENT: [number, number, number] = [26, 115, 242]
45const FALLBACK_DESTRUCTIVE: [number, number, number] = [232, 80, 80]
46
47const BLEND_MS = 280
48
49export function BarsTheme({
50 state,
51 volume,
52 size,
53 className,
54 style,
55 disabled = false,
56 interactive = false,
57 onClick,
58 ...controlProps
59}: BarsThemeProps) {
60 const barRefs = useRef<(HTMLSpanElement | null)[]>([])
61 const containerRef = useRef<HTMLSpanElement>(null)
62 const rafRef = useRef<number>(0)
63 const smoothed = useRef<number[]>(new Array(BAR_COUNT).fill(0))
64 const volumeRef = useRef(volume)
65 const hoveredRef = useRef(false)
66 const hoverBoostRef = useRef(0)
67 const blendStartRef = useRef<number | null>(null)
68 const frozenHeightsRef = useRef<number[]>(new Array(BAR_COUNT).fill(0))
69 const prevStateRef = useRef(state)
70 const touchEndTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
71
72 const reduceMotion = useReducedMotion()
73
74 const accentRgb = useCssColorRgb('--color-accent', FALLBACK_ACCENT)
75 const destructiveRgb = useCssColorRgb('--color-destructive', FALLBACK_DESTRUCTIVE)
76 const accentRgbRef = useRef(accentRgb)
77 const destructiveRgbRef = useRef(destructiveRgb)
78 const currentColorRef = useRef<[number, number, number]>(accentRgb)
79 useEffect(() => {
80 accentRgbRef.current = accentRgb
81 }, [accentRgb])
82 useEffect(() => {
83 destructiveRgbRef.current = destructiveRgb
84// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • components/ui/bars-theme.tsx
  • lib/hooks/use-css-color-rgb.ts
  • lib/resolve-css-color.ts

Facts

Registry
nexvyn
Type
registry:ui
Access
Free
Files written
3
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on nexvyn ui.nexvyn.dev Nexvyn/Nexvyn-ui on GitHub Raw registry item This item as JSON

More from nexvyn

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
BadgebadgenexvynComponentsFree2 deps · 2 files
Bounce Sidebarbounce-sidebarnexvynComponentsFree1 dep · 2 files
BreadcrumbsbreadcrumbsnexvynComponentsFree1 dep · 2 files
CheckboxcheckboxnexvynComponentsFree1 dep · 3 files
Clipboard Fieldclipboard-fieldnexvynComponentsFreeno deps · 2 files
Color Pickercolor-pickernexvynComponentsFreeno deps · 16 files
ComboboxcomboboxnexvynComponentsFree1 dep · 2 files
Context Menucontext-menunexvynComponentsFree1 dep · 2 files
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex