Kbd

Display keyboard button or keys combination
Import

Usage

+ shift + M
import { Kbd } from '@mantine/core';
function Demo() {
return (
<>
<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 { Kbd, TextInput } from '@mantine/core';
import { Search } from 'tabler-icons-react';
function Demo() {
const rightSection = (
<div style={{ display: 'flex', alignItems: 'center' }}>
<Kbd>Ctrl</Kbd>
<span style={{ margin: '0 5px' }}>+</span>
<Kbd>K</Kbd>
</div>
);
return (
<TextInput
placeholder="Search"
icon={<Search size={16} />}
rightSectionWidth={90}
rightSection={rightSection}
styles={{ rightSection: { pointerEvents: 'none' } }}
/>
);
}