Keycap
This source is documented by the existing examples linked below.
src/components/Keycap.astroUsage contract
- Reuse this composition from its source and demo. Keep its existing semantic structure and locale/data contracts.
- Reuse this composition from its source and demo. Keep its existing semantic structure and locale/data contracts.
- Reuse this composition from its source and demo. Keep its existing semantic structure and locale/data contracts.
- Reuse this composition from its source and demo. Keep its existing semantic structure and locale/data contracts.
- Reuse this composition from its source and demo. Keep its existing semantic structure and locale/data contracts.
Examples
- keycaps
<div class="flex flex-col gap-4"><div class="flex items-center gap-2 text-xs text-ink-muted"><Keycap>C</Keycap><Keycap>K</Keycap><Keycap>S</Keycap><Keycap>W</Keycap><Keycap>L</Keycap><Keycap>T</Keycap><Keycap title="Enter">↵</Keycap><Keycap>Esc</Keycap><Keycap>?</Keycap></div><p class="flex flex-wrap items-center gap-6 text-xs text-ink-muted"><span class="inline-flex items-center gap-2">{t(locale,'case.chapters')} <Keycap>C</Keycap></span><span class="inline-flex items-center gap-2">{t(locale,'case.preRead')} <Keycap>K</Keycap></span><span class="inline-flex items-center gap-2">{t(locale,'case.readCase')} <Keycap>R</Keycap></span><span class="inline-flex items-center gap-2">Story <Keycap>S</Keycap> / <Keycap>W</Keycap></span></p></div> - keyboard-help
<button hidden type="button" data-keyboard-help aria-haspopup="dialog" aria-expanded="false" aria-keyshortcuts="?" class="inline-flex min-h-8 items-center gap-2 rounded-control border border-line px-3 text-sm hover:bg-sunken focus-visible:outline-2 focus-visible:outline-ring"><Keycap>?</Keycap>{t(locale,'island.label')}</button> <KeyboardHelp client:load title={t(locale,'island.label')} close={t(locale,'case.close')} enabled={t(locale,'keys.enabled')} hint={t(locale,'keys.hint')} native={t(locale,'keys.native')} sections={{reading:t(locale,'keys.reading'),page:t(locale,'keys.page'),focus:t(locale,'keys.focus')}} shortcuts={[{key:'?',label:t(locale,'keys.help')},{key:'L',label:t(locale,'island.lang')},{key:'T',label:t(locale,'island.theme')}]}/> - main-surface
<Surface root="Home" first={ui.work}> <Section section="demo-a" title={ui.work} count="03"><Fragment slot="meta"><Keycap>J</Keycap><Keycap>K</Keycap><em>{ui.navigate}</em></Fragment><RowList items={rows}/></Section> <Section section="demo-b" title={ui.about}><p class="ds-main__pad">{en?'One header for the whole surface; it names the section one is reading.':'Ein Kopf für die ganze Fläche; er nennt den Abschnitt, in dem man gerade liest.'}</p></Section> </Surface> - main-cmd
<div class="sx-cmd sx-cmd--demo" data-demo-static> <div class="sx-cmd__in"> <p class="sx-cmd__top"><Zeichen icon="search" size={16}/><span class="sx-cmd__q">{ui.cmdPlaceholder}</span><Keycap>Esc</Keycap></p> <ul class="sx-cmd__list">{places.slice(0,6).map((p,i)=><li aria-selected={i===0?'true':'false'}><span class="sx-cmd__g">{p.g}</span><span class="sx-cmd__t">{p.t}</span><span class="sx-cmd__s">{p.s}</span></li>)}</ul> <p class="sx-cmd__foot"><span><Keycap>↑</Keycap><Keycap>↓</Keycap>{ui.choose}</span><span><Keycap title="Enter">↵</Keycap>{ui.open}</span><span class="sx-cmd__keys"><Keycap>?</Keycap>{ui.keys}</span></p> </div> </div> - main-keys
<div class="sx-cmd sx-cmd--demo" data-demo-static> <div class="sx-cmd__in"> <p class="sx-cmd__top"><b>{ui.keysTitle}</b><Keycap>Esc</Keycap></p> <dl class="sx-keys">{ui.keyRows.map(([k,d])=><div><dt>{k.split(' ').map(x=>{const c=cap(x);return <Keycap title={c.t}>{c.k}</Keycap>;})}</dt><dd>{d}</dd></div>)}</dl> <label class="sx-keys__off"><input type="checkbox" data-keys-off-demo disabled/><span><b>{ui.keysOff}</b><small>{ui.keysOffHint}</small></span></label> </div> </div>
API
Extracted from the source with the TypeScript parser. Inherited and imported types remain references; implementation is authoritative.
interface Props { class?: string; title?: string }Astro.props
Bindings and defaults read from source; these do not add inferred types.
class = ''title
Slots: default
Source usage
Website reference
This is static source evidence. A reachable module may contain conditional or unused branches. External consumers and staged static pages are outside this scan. No status authorizes deletion.
Website
- src/pages/en/work/[id].astro
- src/components/case/CasePage.astro
- src/components/Keycap.astro
Documentation
- src/pages/design-system/[category].astro
- src/components/ds/DesignSystemPage.astro
- src/components/ds/ControlDemos.astro
- src/components/Keycap.astro
Preview
- src/pages/en/vorschlag/home-b.astro
- src/components/site/pages/HomeBPage.astro
- src/components/Keycap.astro
Consumers in source
Direct static, dynamic and type imports. Imports do not prove that a branch renders or that a proposal is published.
- src/components/case/CaseBar.astro:7 import
- src/components/case/CaseHead.astro:6 import
- src/components/case/CaseHero.astro:17 import
- src/components/case/CaseOverview.astro:9 import
- src/components/case/CasePage.astro:2 import
- src/components/case/PlatformHeroOverview.astro:6 import
- src/components/ds/ControlDemos.astro:4 import
- src/components/ds/MainPageDemos.astro:10 import
- src/components/preview/StoryScrollCue.astro:4 import
- src/components/ShortcutIsland.astro:3 import
- src/components/site/CommandPalette.astro:7 import
- src/components/site/mix/Person.astro:15 import
- src/components/site/pages/HomeBPage.astro:10 import
- src/components/site/pages/HomePage.astro:12 import
- src/components/site/pages/WorkPage.astro:9 import
- src/components/site/platform-overview/OverviewActions.astro:3 import
- src/components/story/StoryAuto.astro:5 import
- src/components/story/StoryDock.astro:5 import
- src/components/story/StoryStart.astro:9 import