UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

shadcn/ui/Kbd

Data display
1 of 2
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

2 versions·2 libraries

  • shadcn/ui
  • HextaUI

Kbd

npx shadcn@latest add https://ui.shadcn.com/r/styles/new-york-v4/kbd.json
Open in v0 Docs Repo
Library
shadcn/ui
License
MIT
Stack
React · Tailwind CSS
Packages
cn
Size
29 lines
Demo
From shadcn/ui

Code

registry/new-york-v4/ui/kbd.tsx

import { cn } from "cn"

function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
  return (
    <kbd
      data-slot="kbd"
      className={cn(
        "pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none",
        "[&_svg:not([class*='size-'])]:size-3",
        "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
        className
      )}
      {...props}
    />
  )
}

function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <kbd
      data-slot="kbd-group"
      className={cn("inline-flex items-center gap-1", className)}
      {...props}
    />
  )
}

export { Kbd, KbdGroup }

More like this

Input Otp

shadcn/ui·Inputs & forms

Spinning Text

Magic UI·Text effects

GitHub Stars Button

Animate UI·BackgroundsMIT+

Toolbar Expandable

Motion Primitives·Navigation

Carousel

HextaUI·Media & 3D

Grid Pattern

Magic UI·Backgrounds

Carousel

shadcn/ui·Media & 3D

Glyph Background

Animate UI·BackgroundsMIT+

Border Trail

Motion Primitives·Cursor & effects

Drape Background

Kokonut UI·Backgrounds

Animated Grid Pattern

Magic UI·Backgrounds

8-bit Avatar

8bitcn·Media & 3D

Scroll Index

Kokonut UI·Text effects

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders