Cards & content / Badges & tags
Inline Keycap Hint
Tiny rounded keycap chips with a subtle inset shadow, set inline within body copy to show shortcuts.
Rebuilt from arc.net in the Obsidian Farewell Editorial style.
npx shadcn@latest add https://justyoink.it/r/obsidian-farewell-editorial/blocks/keycap-inline.json
Looks exactly like arc.net: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/obsidian-farewell-editorial/mine/keycap-inline.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: before, keys, after, altKeys, tail. Each keys array renders as a row of inline keycap chips within the paragraph.
components/keycap-inline.tsx
export default function InlineKeycapHint({ before = "Press", keys = ["⌘", "K"], after = "to open the quick switcher, or", altKeys = ["⇧", "P"], tail = "to jump between profiles." }: { before?: string; keys?: string[]; after?: string; altKeys?: string[]; tail?: string }) { const Keys = ({ items }: { items: string[] }) => ( <span className="mx-0.5 inline-flex items-center gap-0.5 align-baseline"> {items.map((k, i) => ( <kbd key={i} className="inline-flex h-[1.4em] min-w-[1.6em] items-center justify-center rounded-md border border-hairline bg-surface-tint px-1.5 font-sans text-caption text-ink shadow-inset-soft"> {k} </kbd> ))} </span> ); return ( <p className="max-w-md font-sans text-body text-muted"> {before} <Keys items={keys} /> {after} <Keys items={altKeys} /> {tail} </p> ); }export default function InlineKeycapHint({ before = "Press", keys = ["⌘", "K"], after = "to open the quick switcher, or", altKeys = ["⇧", "P"], tail = "to jump between profiles." }: { before?: string; keys?: string[]; after?: string; altKeys?: string[]; tail?: string }) { const Keys = ({ items }: { items: string[] }) => ( <span className="mx-0.5 inline-flex items-center gap-0.5 align-baseline"> {items.map((k, i) => ( <kbd key={i} className="inline-flex h-[1.4em] min-w-[1.6em] items-center justify-center rounded-md border border-border bg-primary px-1.5 font-sans text-obsidian-caption text-primary-foreground shadow-obsidian-inset-soft"> {k} </kbd> ))} </span> ); return ( <p className="max-w-md font-sans text-obsidian-body text-muted-foreground"> {before} <Keys items={keys} /> {after} <Keys items={altKeys} /> {tail} </p> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.