ToolbarGroup

In this article

A ToolbarGroup can be used to create subgroups of controls inside a Toolbar.

Usage

import { Toolbar, ToolbarGroup, ToolbarButton } from '@wordpress/components';
import { paragraph, formatBold, formatItalic, link } from '@wordpress/icons';

function MyToolbar() {
    return (
        <Toolbar label="Options">
            <ToolbarGroup>
                <ToolbarButton icon={ paragraph } label="Paragraph" />
            </ToolbarGroup>
            <ToolbarGroup>
                <ToolbarButton icon={ formatBold } label="Bold" />
                <ToolbarButton icon={ formatItalic } label="Italic" />
                <ToolbarButton icon={ link } label="Link" />
            </ToolbarGroup>
        </Toolbar>
    );
}

Props

ToolbarGroup will pass all HTML props to the underlying element.