Kbd
Display keyboard button or keys combination
Import
Source
Docs
Package
Usage
Use kbd html element to describe keyboard actions and shortcuts:
⌘ + shift + M
<Kbd>⌘</Kbd> + <Kbd>shift</Kbd> + <Kbd>M</Kbd>
Example
Usage example with TextInput component – Kbd is used to describe keyboard shortcut to focus input:
Ctrl+K
import React from 'react';import { Kbd, TextInput } from '@mantine/core';import { MagnifyingGlassIcon } from '@modulz/radix-icons';function Demo() {const rightSection = (<div style={{ display: 'flex', alignItems: 'center' }}><Kbd>Ctrl</Kbd><span style={{ margin: '0 5px' }}>+</span><Kbd>K</Kbd></div>);return (<TextInputplaceholder="Search"icon={<MagnifyingGlassIcon />}rightSectionWidth={90}rightSection={rightSection}styles={{ rightSection: { pointerEvents: 'none' } }}/>);}
Built by Vitaly Rtishchev and these awesome people