Refined UI

An opinionated, customizable superset of shadcn/ui

AgentsPrimitivesSkillsSkins
Guides
  • Overview
  • Get started
  • Shadcn compatibility
  • Architecture
  • Agent surface
Primitives
  • Accordion
  • Alert
  • Alert dialog
  • Aspect ratio
  • Autocomplete
  • Avatar
  • Badge
  • Button
  • Button group
  • Calendar
  • Card
  • Checkbox
  • Checkbox Group
  • Code
  • Code Diff
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Date Picker
  • Dialog
  • Drawer
  • Empty
  • Field
  • Form
  • Gradient Editor
  • Hover card
  • Input
  • Input group
  • Input OTP
  • Item
  • Kbd
  • Markdown
  • Menu
  • Menubar
  • Meter
  • Native select
  • Navigation menu
  • Number Field
  • Pagination
  • Popover
  • Progress
  • Radio group
  • Resizable
  • Scroll area
  • Select
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Table
  • Table of contents
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • Toolbar
  • Tooltip
  • Tree
  • Trigger Menu
  • Typography
Hooks
  • Use Chat Message
  • Use Chat Input
  • Use User Ask
  • Use Audio Recorder
  • Use Environment Variables
  • Use Copy To Clipboard
  • Use Tool Call
  • Use Sidebar Resize
Utils
  • cn
  • Skin
  • Contracts
  • Serialize
Extensions
  • Control Effects
  • View Transition
  • Send Aurora
  1. Primitives
  2. Kbd
Primitives

Kbd

Keyboard shortcut chip and chord group.

Composition

The preferred shape for composing the installed primitive from its exported parts.

Parts

Exported compound parts from the installed source.

Kbd
└── KbdGroup

The refined source installs this primitive from src/registry/sources/refined/ui/kbd.tsx. Install it on its own with the command above, or inspect the source below.

Registry command
npx shadcn@latest add http://127.0.0.1:3000/r/refined/kbd.json
See registry manifest

Raw code

Primary installed primitive source

Kbd slot
src/registry/sources/refined/ui/kbd.tsx
import type { ComponentProps } from "react";
import { cn } from "@/components/refined-ui/lib/cn";
import { skinSlot } from "@/components/refined-ui/skin";
​
// Refined skin slot: keyboard key chip sharing --radius-control w/ buttons/fields (⌘K hint matches corner). Pure markup, no dep.
// KbdGroup lays out a chord (⌘+K) with hairline separators.
export function Kbd({ className, ...props }: ComponentProps<"kbd">) {
return (
<kbd
data-ui="agent"
data-slot="kbd"
className={cn(
"inline-flex h-5 min-w-5 select-none items-center justify-center gap-1 rounded-[var(--radius-control)] px-1.5 font-sans text-micro font-medium text-muted-foreground ring-1 ring-inset ring-border bg-card/60 shadow-sm",
skinSlot("kbd", {}),
className,
)}
{...props}
/>
);
}
​
export function KbdGroup({ className, ...props }: ComponentProps<"span">) {
return (
<span
data-ui="agent"
data-slot="kbd-group"
className={cn("inline-flex items-center gap-1", skinSlot("kbd-group", {}), className)}
{...props}
/>
);
}
​

On this page

  • Preview
  • Composition
  • Installation
  • Source
Single keyEsc
Command palette⌘K
Send message⌘↵