diff --git a/packages/block-editor/src/components/rich-text/toolbar-button.js b/packages/block-editor/src/components/rich-text/toolbar-button.js index e7ff63189fd92..5972ff66fd82e 100644 --- a/packages/block-editor/src/components/rich-text/toolbar-button.js +++ b/packages/block-editor/src/components/rich-text/toolbar-button.js @@ -4,6 +4,35 @@ import { Fill, ToolbarButton } from '@wordpress/components'; import { displayShortcut } from '@wordpress/keycodes'; +/** + * RichTextToolbarButton component displays a button in the rich text toolbar. + * + * @param {Object} props The component props. + * @param {string} props.name Name of the button. + * @param {string} props.shortcutType Type of the shortcut. + * @param {string} props.shortcutCharacter Character of the shortcut. + * @param {Object} props.props Props to pass to the `ToolbarButton` component. + * + * @return {Element} The toolbar button element. + * + * @example + * ```jsx + * function MyRichTextToolbarButton() { + * return ( + * { + * console.log( 'Button clicked!' ); + * } + * shortCutType="primary" + * shortCutCharacter="b" + * /> + * ); + * } + * ``` + */ export function RichTextToolbarButton( { name, shortcutType,