Shortcut component is used to display keyboard shortcuts, and it can be customized with a custom display and aria label if needed.
import { Shortcut } from '@wordpress/components';
LinksPermalink to this section
PropsPermalink to this section
| Name | Default | Description |
|---|---|---|
className |
Classname to apply to the shortcut. | |
shortcut |
Shortcut configuration |
ExamplesPermalink to this section
DefaultPermalink to this section
const Default = ( props ) => {
return <Shortcut shortcut="Ctrl + S" { ...props } />;
};
With Aria LabelPermalink to this section
const WithAriaLabel = ( props ) => {
return <Shortcut shortcut="Ctrl + S" { ...props } />;
};