use topcoat::{ Result, view::{Attributes, Child, StaticClass, View, class, component, view}, }; /// Classes that draw a key label in a bordered box. const KBD: StaticClass = class!("keycap"); /// A keyboard key label rendered as ``. /// /// Pass the key name as children and use [`kbd_group`] for a shortcut with several /// keys. `attrs` are forwarded to the ``, with extra classes added to its classes. /// /// ```ignore /// view! { /// kbd_group(kbd("Ctrl") kbd("K")) /// } /// ``` #[component] pub async fn kbd( #[default] mut attrs: Attributes, #[default] child: Child<'_>, ) -> Result { Ok(view! { (child) }) } /// A row of key labels for one keyboard shortcut. The keys stay on one line. #[component] pub async fn kbd_group( #[default] mut attrs: Attributes, #[default] child: Child<'_>, ) -> Result { Ok(view! { (child) }) }