Playground GitHub npm

Keycap

Keyboard-hint cap for HUDs — size × tone (affirm/deny).

ui hud

Preview

Installation

npx slintcn@latest add keycap

Usage

import { Keycap, KeycapSize, KeycapTone } from "slintcn/components/keycap.slint";

Keycap { text: "⌘"; tone: KeycapTone.on-glass; }

Properties

text in string

Label inside the keycap (e.g. `⇧`, `K`).

size in KeycapSize

Height + padding — sm, md, lg.

tone in KeycapTone

Surface treatment — `on-glass` or `on-solid`.

API

KeycapSizesmmd
KeycapToneon-glowon-glassmutedaffirm-on-glowdeny-on-glowaffirm-on-glassdeny-on-glass

Dependencies

theme only

Installed automatically as transitive dependencies of slintcn add keycap.