Select UI framework
Get Started
React Aria
AlertApp Store ButtonAspect RatioBadgeBannerBreadcrumbButton GroupButtonCheckboxCommand MenuCompactButtonDialogDrawerEmptyFancy ButtonFile UploadHintInput OTPInputItemKbdLabelLinkButtonLoaderPopoverProgress BarProgress CircleRadio GroupRatingSelectSeparatorSkeletonSliderSocial ButtonSwitchTagTextareaToggle GroupToggleTooltip
Usage
import { Bold, Italic, Underline } from "lucide-react"
import * as ToggleGroup from "@/registry/react-aria/ui/toggle-group"
export function ToggleGroupExample() {
const [format, setFormat] = React.useState(new Set(["bold"]))
return (
<ToggleGroup.Root
selectionMode="single"
selectedKeys={format}
onSelectionChange={setFormat}
variant="primary"
appearance="outline"
>
<ToggleGroup.Item id="bold">
<Bold className="size-4" />
Bold
</ToggleGroup.Item>
<ToggleGroup.Item id="italic">
<Italic className="size-4" />
Italic
</ToggleGroup.Item>
<ToggleGroup.Item id="underline">
<Underline className="size-4" />
Underline
</ToggleGroup.Item>
</ToggleGroup.Root>
)
}Examples
Basic Toggle Group
Component toggle-group-demo not found in registry.
Ghost Appearance
Component toggle-group-ghost not found in registry.
Different Sizes
Component toggle-group-sizes not found in registry.