Class Kbd


@Bean(typeName="kbd") public class Kbd extends HtmlElementMixed
DTO for an HTML <kbd> element.

The kbd element represents user input, typically keyboard input but can also represent other types of input such as voice commands or menu selections. It is commonly styled with a monospace font to distinguish it from regular text and often appears in documentation, tutorials, and help pages.

Examples:

// Simple keyboard shortcut Kbd simple = kbd("Ctrl+S"); // Keyboard combination with nested kbd elements P shortcut = p( "Press ", kbd("Ctrl"), " + ", kbd("C"), " to copy." ); // Menu selection instruction P menu = p( "Select ", kbd("File"), " → ", kbd("Save As...") ); // Command line input P command = p( "Type ", kbd("npm install"), " to install dependencies." ); // With styling Kbd styled = kbd("Enter") ._class("key-highlight") .title("Press Enter to submit"); // Multiple key sequence P sequence = p( "To exit, press ", kbd("Esc"), " or ", kbd("Ctrl"), " + ", kbd("Q") );

The following convenience methods are provided for constructing instances of this bean:

See Also: