Skip to content

Kbd

Key caps that go down when you press the real keys: the cap drops a pixel, its bottom edge collapses and the legend takes the accent, then it springs back and cools on release.

Download
Customize

Hold a whole combination and every cap in it stays down.

Install

npx shadcn@latest add https://obsydeui.com/r/kbd.json

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { Kbd } from '@/components/obsyde/ember/kbd/Kbd';

export function Example() {
  return (
    <Kbd keys="⌘ K, Shift Enter, Esc" />
  );
}

Files

Plain React, TypeScript and CSS. No dependencies. The download keeps these paths.

  • ember/kbd/Kbd.tsxcomponent
  • ember/kbd/kbd.cssstyles
  • ember/kbd/KbdDemo.tsxdemo
  • ember/shared/accent.tsshared
  • ember/shared/spring.tsshared
  • ember/shared/ember.cssshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
keysKeysstring'⌘ K, Shift Enter, Esc'
listenListenbooleantrue
sizeSize'sm' | 'md''md'