shadcn.io is not affiliated with official shadcn/ui
Touch-first and accessibility-focused interfaces need bigger targets. This React example is an outline Toggle Group on Base UI with size="lg" set on the group, so bold, italic and underline are each one step taller than the default, with more padding around the icons. Multiple selection lets the formats combine.
Preview
Installation
FAQ
When should I use large toggle groups?
Use lg when the group is the main control on the screen, when there are only a few options, or when people use it with touch: tablet editors, kiosks, presentation tools. Avoid it in dense toolbars, where the extra size takes room without helping.
Are large toggle groups better for accessibility?
Larger targets are easier to hit for people with limited dexterity and easier to see for people with low vision. In most styles lg is still a little under the 44 pixel touch target, so keep spacing between the items as well. The names and pressed states are announced the same at every size.
How much horizontal space do large toggle groups require?
Each item is wider and taller than at the default size, and the group's spacing adds a gap between them. Three icon-only items fit easily even on a phone; with more, or with text labels, set orientation="vertical" or split the options into separate groups.
Should I use larger icons with large toggle groups?
Not necessarily. The items keep the icon at its usual size (size-4 in most styles) and put the extra size into padding, which is what makes them easier to hit. If an icon looks lost, give it size-5, but don't let it fill the button.
Related
- Small Toggle GroupA small outline formatting toggle group
- Default Size Toggle GroupAn outline formatting toggle group at the
- Large ToggleA large icon-only toggle for underline
- Default Toggle GroupA toggle group for bold, italic and
- Disabled Toggle GroupA disabled toggle group of formatting
- Outline Toggle GroupAn outline toggle group for bold, italic