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/duration-picker

Duration Picker

rare-ui/duration-picker
FreeComponent

A gooey, spring-animated picker for entering a duration in hours and minutes.

Install it

npx shadcn@latest add https://rareui.com/r/duration-picker.json

Source

components/ui/duration-picker.tsxrareui.com/r/duration-picker.json · first 6 KB
1'use client'
2
3import { Slot } from '@radix-ui/react-slot'
4import { getSvgPath } from 'figma-squircle'
5import { interpolate } from 'flubber'
6import { motion, useMotionValue, useReducedMotion, useSpring, useTransform, useVelocity, type MotionStyle, type MotionValue } from 'motion/react'
7import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'
8import useMeasure from 'react-use-measure'
9
10import { cn } from '@/lib/utils'
11
12const PEN_PATH = 'M3.78181 16.3092L3 21L7.69086 20.2182C8.50544 20.0825 9.25725 19.6956 9.84119 19.1116L20.4198 8.53288C21.1934 7.75922 21.1934 6.5049 20.4197 5.73126L18.2687 3.58024C17.495 2.80658 16.2406 2.80659 15.4669 3.58027L4.88841 14.159C4.30447 14.7429 3.91757 15.4947 3.78181 16.3092Z'
13const TICK_PATH = 'M7.959 20.513L1.592 12.872L3.128 11.592L8.041 17.487L20.947 3.587L22.413 4.948L7.959 20.513Z'
14
15const OPEN_GAP = 8
16const CORNER_RADIUS = 12
17const GAP_SPRING = { stiffness: 200, damping: 28, mass: 1 }
18const ICON_SPRING = { stiffness: 200, damping: 28 }
19const WIDTH_SPRING = { stiffness: 250, damping: 31 }
20const SWAY_SPRING = { stiffness: 200, damping: 24 }
21const ERROR_SPRING = { stiffness: 700, damping: 9 }
22
23export type DurationValue = {
24 hours: number
25 minutes: number
26}
27
28export type DurationPickerProps = Omit<
29 React.ComponentProps<'div'>,
30 'onChange' | 'defaultValue' | 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onAnimationStart' | 'onAnimationEnd'
31> & {
32 value?: DurationValue
33 defaultValue?: DurationValue
34 onChange?: (value: DurationValue) => void
35 onConfirm?: (value: DurationValue) => void
36 onEditingChange?: (editing: boolean) => void
37 defaultEditing?: boolean
38 maxHours?: number
39 maxMinutes?: number
40 hoursLabel?: string
41 minutesLabel?: string
42 disabled?: boolean
43}
44
45type SquircleSegmentProps = {
46 asChild?: boolean
47 cornerSmoothing?: number
48 leftRadius: number | MotionValue<number>
49 rightRadius: number | MotionValue<number>
50 className?: string
51 style?: MotionStyle
52 children: React.ReactNode
53}
54
55const MotionSlot = motion.create(Slot)
56
57const radiusValue = (radius: number | MotionValue<number>) =>
58 typeof radius === 'number' ? radius : radius.get()
59
60const SquircleSegment = ({ asChild, cornerSmoothing = 1, leftRadius, rightRadius, className, style, children }: SquircleSegmentProps) => {
61 const Component = asChild ? MotionSlot : motion.div
62 const [ref, bounds] = useMeasure()
63 const width = useMotionValue(0)
64 const height = useMotionValue(0)
65
66// … truncated

What it pulls in

npm packages

  • motion
  • figma-squircle
  • flubber
  • react-use-measure
  • @radix-ui/react-slot

Other registry items

  • utils

Files it writes

  • components/ui/duration-picker.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
today

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
Bounce Sidebarbounce-sidebarrare-uiComponentsFree1 dep
Code Blockcode-blockrare-uiComponentsFree3 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