10% off on all-access. Use code SUPER10.
d :
h :
m :
Logo

Keyboard

A mac style keyboard component with mechanical keys sound effects.

Installation

Run the following command

npx shadcn@latest add @aceternity/keyboard

Add sound file

Download the sound files and place them in your public/sounds/ folder:

Examples

Keyboard Demo With Sound

Keyboard Demo Without Sound

Keyboard Demo With Preview

Props

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the container
enableSoundbooleanfalseEnable keyboard sound effects on key press
showPreviewbooleanfalseShow keystroke preview animation above keyboard

Notes

  • Sound requires /sounds/sound.ogg file in the public folder
  • Event listeners only active when keyboard is visible in viewport
  • Responsive scaling: 0.8x (mobile) → 2x (xl screens)

Build websites faster and 10x better than your competitors with

Aceternity UI Pro

Next.js 15, Tailwind CSS v4 and Motion for react powered templates

100+ templates and blocks combined

Ready to copy paste component blocks, save days of development time

Aceternity UI Pro Demo - Light Mode
Logo
Aceternity UI

Access an ever-growing collection of premium, meticulously crafted templates and Component Blocks.

A product by Aceternity
Building in public at @mannupaaji

© 2026 Aceternity Labs LLC. All Rights Reserved.