Search

Jump to any page.

Actions

Kbd

Key caps that never mirror under RTL.

Search⌘KToggle sidebar⌘BNight mode D
pnpm dlx shadcn@latest add @paragon/kbd
Brings incn
registry/paragon/ui/kbd.tsx
import { cn } from "cn"

/** A key cap. Always reads left to right, so shortcuts never mirror under RTL. */
function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
  return (
    <kbd
      data-slot="kbd"
      dir="ltr"
      className={cn(
        "pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-[0.3125rem] bg-card px-1 font-sans text-[0.6875rem] font-medium text-muted-foreground shadow-[0_1px_0_var(--border)] ring-1 ring-border select-none dark:bg-input/20 [&_svg:not([class*='size-'])]:size-3",
        className
      )}
      {...props}
    />
  )
}

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

export { Kbd, KbdGroup }