ButtonGroup
This component is deprecated. Use `ToggleGroupControl` instead.
Design guidelines
Usage
Selected action
Do
Only one option in a button group can be selected and active at a time. Selecting one option deselects any other.
Best practices
- Be clearly and accurately labeled.
- Clearly communicate that clicking or tapping will trigger an action.
- Use established colors appropriately. For example, only use red buttons for actions that are difficult or impossible to undo.
- Have consistent locations in the interface.
States
Active and available button groups
Development guidelines
Usage
import { Button, ButtonGroup } from '@wordpress/components';
const MyButtonGroup = () => (
<ButtonGroup>
<Button variant="primary">Button 1</Button>
<Button variant="primary">Button 2</Button>
</ButtonGroup>
);
Related components
- For individual buttons, use a
Buttoncomponent.
这篇文档对你有帮助吗?
谢谢你的反馈!