BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/rare-ui/bounce-sidebar

Bounce Sidebar

rare-ui/bounce-sidebar
FreeComponent

A vertical navigation list with a bouncy, spring-animated active indicator.

Install it

npx shadcn@latest add https://rareui.com/r/bounce-sidebar.json

Source

components/ui/bounce-sidebar.tsxrareui.com/r/bounce-sidebar.json
1"use client";
2
3import { useEffect, useLayoutEffect, useRef, useState, type ComponentProps } from "react";
4import Link from "next/link";
5import { motion, useAnimate } from "motion/react";
6import { arc } from "motion";
7import { cn } from "@/lib/utils";
8
9const MotionLink = motion.create(Link);
10
11const useIsomorphicLayoutEffect =
12 typeof window !== "undefined" ? useLayoutEffect : useEffect;
13
14export type BounceSidebarItem = string | { label: string; href?: string };
15
16export type BounceSidebarProps = Omit<ComponentProps<"ul">, "onChange"> & {
17 items: BounceSidebarItem[];
18 value?: number;
19 defaultValue?: number;
20 onChange?: (index: number) => void;
21 dotColor?: string;
22};
23
24export function BounceSidebar({
25 items,
26 value,
27 defaultValue = 0,
28 onChange,
29 dotColor = "#FC4C01",
30 className,
31 ...props
32}: BounceSidebarProps) {
33 const [internalValue, setInternalValue] = useState(defaultValue);
34 const activeIndex = value ?? internalValue;
35
36 const [dot, animate] = useAnimate<HTMLSpanElement>();
37 const itemRefs = useRef<(HTMLLIElement | null)[]>([]);
38 const prevY = useRef<number | null>(null);
39
40 const [dotSize, setDotSize] = useState(6);
41 const [ready, setReady] = useState(false);
42 useEffect(() => {
43 const dpr = window.devicePixelRatio || 1;
44 setDotSize(Math.round(6 * dpr) / dpr);
45 }, []);
46
47 useIsomorphicLayoutEffect(() => {
48 let cancelled = false;
49 const snap = () => {
50 const el = itemRefs.current[activeIndex];
51 if (cancelled || !el || !dot.current) return;
52 const dpr = window.devicePixelRatio || 1;
53 const size = Math.round(6 * dpr) / dpr;
54 const toY =
55 Math.round((el.offsetTop + el.offsetHeight / 2 - size / 2) * dpr) / dpr;
56 animate(dot.current, { x: 0, y: toY }, { duration: 0 });
57 prevY.current = toY;
58 setReady(true);
59 };
60
61 snap();
62 const raf = requestAnimationFrame(snap);
63 document.fonts?.ready.then(snap);
64 return () => {
65 cancelled = true;
66 cancelAnimationFrame(raf);
67 };
68 }, []);
69
70 useEffect(() => {
71 const el = itemRefs.current[activeIndex];
72 if (!el || !dot.current) return;
73
74 const dpr = window.devicePixelRatio || 1;
75 const toY =
76 Math.round((el.offsetTop + el.offsetHeight / 2 - dotSize / 2) * dpr) /
77 dpr;
78
79 if (prevY.current === null) {
80 animate(dot.current, { x: 0, y: toY }, { duration: 0 });
81 prevY.current = toY;
82 return;
83 }
84
85 const fromY = prevY.current;
86 const delta = toY - fromY;
87 prevY.current = toY;
88// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • utils

Files it writes

  • components/ui/bounce-sidebar.tsx

Facts

Registry
rare-ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-07
Last confirmed
yesterday

Go to the source

rareui.com swamimalode07/rare-ui on GitHub Raw registry item This item as JSON

More from rare-ui

All 13 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Code Blockcode-blockrare-uiComponentsFree3 deps
Duration Pickerduration-pickerrare-uiComponentsFree5 deps
Emoji Reactionemoji-reactionrare-uiComponentsFree4 deps
Family Drawerfamily-drawerrare-uiComponentsFree2 deps
Fluid Orbfluid-orbrare-uiComponentsFreeno deps
Folder Componentfolder-componentrare-uiComponentsFree1 dep
GitHub Activitygithub-activityrare-uiComponentsFree1 dep
Gravity Lettersgravity-lettersrare-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

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.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 KitGrade

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 KitGrade

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 KitGrade

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