Skip to content

shadcn.io is an independent project built on shadcn/ui

Large Toggle Group for Ark UI

A large outline group of bold, italic and underline. The buttons are taller than the default, and none start pressed.

Three large outline icon buttons: bold, italic and underline. They are taller than the default size. None start pressed.

Use the large size when the formats are the main controls, such as on a touch screen. The default size of a Toggle Group fits a normal toolbar. Ark UI in React does not apply bold, italic or underline.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Anatomy

Toggle Group anatomy: root, item

Usage

<ToggleGroup
  aria-label="Text formatting"
  multiple
  size="lg"
  variant="outline"
>
  <ToggleGroupItem aria-label="Toggle bold" value="bold">
    <BoldIcon aria-hidden="true" />
  </ToggleGroupItem>
  <ToggleGroupItem aria-label="Toggle italic" value="italic">
    <ItalicIcon aria-hidden="true" />
  </ToggleGroupItem>
  <ToggleGroupItem aria-label="Toggle underline" value="underline">
    <UnderlineIcon aria-hidden="true" />
  </ToggleGroupItem>
</ToggleGroup>

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.

Do large toggle groups work well on mobile devices?

Yes, they're the best fit of the three sizes for touch. The limit is width: keep the group to a few items, or stack it with orientation="vertical" on narrow screens.

Should large toggle groups scale down on desktop?

Not if there's room. Large targets help desktop users with screen magnifiers or alternative pointing devices too. Choose the default size instead when the toolbar has many controls, and keep one size per toolbar.

API Reference

Toggle Group

Sets aria-label="Text formatting", multiple, size="lg", variant="outline", aria-label="Toggle bold" and value="bold". The rest is on the Toggle Group page.