Typography typographyutilitykeyboard
KBD Key Cap
Stylized keyboard shortcut indicator with a tactile UI look.
Preview
KBD Key Cap
Usage
Copy the full block below to use this component with its imports.
astro
---
import { KBDKeyCap } from 'astro-component-kit';
---
<KbdIndicator>Content</KbdIndicator> ---
import { KBDKeyCap } from 'astro-component-kit';
---
<KbdIndicator>Content</KbdIndicator> Manual Installation
If you are not using the npm package, create a new file src/components/lib/KBDKeyCap.astro and paste the following code:
astro
---
---
<kbd class="tau-kbd"><slot /></kbd>
<style>
.tau-kbd { background: #1e293b; border: 1px solid #334155; border-bottom-width: 3px; border-radius: 6px; padding: 2px 8px; color: #f1f5f9; font-family: sans-serif; font-weight: 700; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; box-shadow: 0 2px 0 rgba(0,0,0,0.4); vertical-align: middle; }
</style> ---
---
<kbd class="tau-kbd"><slot /></kbd>
<style>
.tau-kbd { background: #1e293b; border: 1px solid #334155; border-bottom-width: 3px; border-radius: 6px; padding: 2px 8px; color: #f1f5f9; font-family: sans-serif; font-weight: 700; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; box-shadow: 0 2px 0 rgba(0,0,0,0.4); vertical-align: middle; }
</style>
Quick Info
- Category
- Typography
- Filename
KBDKeyCap.astro- Dependencies
- None — pure Astro + CSS
- Tags
- typographyutilitykeyboard