BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/harshkanjiya/realistic-button

Realistic Button

harshkanjiya/realistic-button
FreeComponent

A skeuomorphic realistic button with hover and active states.

Live preview

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

Install it

npx shadcn@latest add https://harshkanjiya.com/r/realistic-button.json

Source

components/realistic-button/realistic-button.tsxharshkanjiya.com/r/realistic-button.json · first 6 KB
1'use client';
2
3import { useState, useEffect } from 'react';
4import styles from './realistic-button.module.css';
5import { useSound } from '@/hooks/use-sound';
6
7type TextState = 'off' | 'drawing' | 'on';
8
9export default function RealisticButton() {
10 const [isActive, setIsActive] = useState(false);
11 const [isPressed, setIsPressed] = useState(false);
12 const [textState, setTextState] = useState<TextState>('off');
13
14 const playClick = useSound("/audio/ui-sounds/mech-key-press.mp3");
15
16 useEffect(() => {
17 if (isActive) {
18 setTextState('drawing');
19 const timer = setTimeout(() => setTextState('on'), 900);
20 return () => clearTimeout(timer);
21 } else {
22 setTextState('off');
23 }
24 }, [isActive]);
25
26 const onClick = () => {
27 playClick();
28 setIsPressed(true);
29 setIsActive(false);
30 setTimeout(() => setIsPressed(false), 200);
31 }
32
33 return (
34 <div className={`${styles.wrap} sm:scale-[0.6] scale-[0.5]`}>
35 <button
36 className={`${styles.button} ${isPressed ? styles.buttonPressed : ''} relative overflow-hidden w-[250px] h-[96px] bg-black z-20 border-transparent rounded-[24px]`}
37 onMouseEnter={() => setIsActive(true)}
38 onClick={onClick}
39 onMouseLeave={() => { setIsActive(false); setIsPressed(false); }}
40 onMouseDown={() => setIsPressed(true)}
41 onMouseUp={() => setIsPressed(false)}
42 onTouchStart={() => setIsPressed(true)}
43 onTouchEnd={() => setIsPressed(false)}
44 style={{
45 boxShadow: isActive || isPressed
46 ? 'inset 0 1px 1px rgba(255, 255, 255, 0.6), inset 0 -6px 1px -4px #ff7300, inset 0 -15px 6px -8px #cc5500,'
47 : 'inset 0 1px 1px rgb(255 255 255 / 40%), inset 0 -6px 1px -4px #ff7300, inset 0 -15px 6px -8px #ff6600',
48 transform: isPressed ? 'scale(0.94)' : 'scale(1)',
49 transition: isPressed
50 ? 'transform 0.07s ease, box-shadow 0.07s ease'
51 : 'transform 0.2s ease, box-shadow 0.3s ease',
52 }}
53 >
54 <div className={`${styles.corner} absolute opacity-10 transition-all duration-400`}></div>
55
56 <div
57// … truncated

Files it writes

  • components/realistic-button/realistic-button.tsx
  • components/realistic-button/index.ts
  • components/realistic-button/realistic-button.module.css
  • hooks/use-sound.ts

Facts

Registry
harshkanjiya
Type
registry:component
Access
Free
Files written
4
Licence
MIT
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

Docs on harshkanjiya harshkanjiya.com HarshKanjiya/harshkanjiya.com on GitHub Raw registry item This item as JSON

More from harshkanjiya

All 6 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Hello Worldhello-worldharshkanjiyaComponentsFreeno deps · 2 files
Pintch Switchpintch-switchharshkanjiyaComponentsFreeno deps · 4 files
Shutter CTAshutter-ctaharshkanjiyaComponentsFreeno deps · 2 files
ToggletoggleharshkanjiyaComponentsFreeno deps · 4 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