shadcn.io is not affiliated with official shadcn/ui
Some toggles are the main controls on the screen and should be easy to see and hit. This React example is an underline Toggle on Base UI with size="lg", one step taller than the default with more padding around the icon. Use it in touch-first layouts, presentation and kiosk screens, or simplified editors with only a few controls.
Preview
Installation
FAQ
When should I use large toggle buttons?
Use lg when there are few toggles and they're the main action, or when people use the screen with touch. Avoid it in dense toolbars, where the extra height and padding take space without helping.
Are large toggles better for accessibility?
A bigger target is easier to hit for people with limited dexterity and easier to see for people with low vision. In most styles, though, lg is still a little under the 44 pixel touch target, so on touch screens also leave space between toggles. The name and pressed state are announced the same at every size.
Should I use larger icons with large toggles?
Not necessarily. The Toggle keeps the icon at its usual size (size-4 in most styles) and the extra size goes into padding, which is what makes the target easier to hit. If the icon looks lost, give it size-5, but don't let it fill the button.
Can I group multiple large toggles together?
Yes, with the Toggle Group and size="lg", as the Large Toggle Group example does. Large items take more width, so keep a group to a few options, or set orientation="vertical" to stack them in a narrow space.
Related
- Small ToggleA small icon-only toggle for bold in a
- Default Size ToggleAn icon-only italic toggle at the default
- Large Toggle GroupA large outline formatting toggle group
- Default ToggleAn icon-only toggle that turns bold on
- Disabled ToggleA disabled icon-only toggle for underline
- Outline ToggleAn outline toggle for italic with a