API and Development
IconToggle swaps between two SVGAsset values to represent on/off or mode changes while reusing tooltip and interactable affordances.
Pass className to merge additional classes onto the icon-toggle container (for example, when a parent like Pill needs to size or align the dismiss control).
Name | Type | Default | Description |
|---|---|---|---|
|
| — | SVG icon displayed in the unchecked state. |
|
| — | SVG icon displayed in the checked state. |
|
| — | When true, applies an active/pressed visual state. |
|
| — | — |
|
|
| HTML element tag to render. |
|
| — | Controlled checked state of the toggle. |
|
| — | Additional CSS class name(s) applied to the element. |
|
| — | Corner radius treatment for the tooltip surface; defaults from brand package when omitted. |
|
|
| Delay in milliseconds before the tooltip appears |
|
| — | When true, disables interaction and applies a disabled visual state. |
|
| — | Custom font size for the icons. |
|
|
| When true, the tooltip is unmounted entirely rather than closed via
|
|
| — | URL for anchor-based interactables. Changes the rendered element to an |
|
| — | — |
|
| — | Choose to inject interactivity into a child element such as a Div element |
|
|
| Visual style variant for the interactive element. |
|
| — | — |
|
| — | — |
|
|
| When true, renders with a fully rounded (pill / circular) border radius. Opt-in only; the default is the standard icon-toggle corner radius. Intended for floating toolbars and FAB-style controls, such as the staff panel FAB toolbar. |
|
| — | The selector of the element to render the portal for the tooltip. If not provided, the tooltip will render in the default location (body). Use this to render the tooltip inside a specific container (e.g., ".radix-themes" for theme inheritance). |
|
|
| Prevents the tooltip from closing when the trigger is clicked. Useful for read-only elements where clicking should have no effect. |
|
| — | Relationship for anchor-based interactables (for example |
|
| — | ARIA role attribute for the interactive element. |
|
| — | — |
|
| — | Overrides the default tab order for non-disabled elements. Pass |
|
| — | Target for anchor-based interactables (for example |
|
| — | Accessible label for the control and its tooltip text. Applied as
|
|
| — | Optional tooltip text to display on hover (uses Radix Tooltip) |
|
| — | Position of the tooltip relative to the element, defaults to "top" |
|
|
| Color variant applied when the toggle is checked. |
|
|
| Wraps children in a span to reliably capture mouse enter/leave events.
Primarily needed with |
Interactive examples and edge cases for this component are in Storybook.
Pass the boolean pill prop to opt in to a fully rounded (pill / circular) border radius, intended for floating toolbars and FAB-style controls such as the staff panel FAB toolbar. pill works with any IconToggleType; combine it with type={IconToggleType.Secondary} to reproduce the FAB-toolbar variant (unchecked: Alt icon + hover background; checked: --color-intent-accent-bg fill with --color-icon-base glyph).