Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property:
set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it,
or on the Style of one instance to restyle it - and any instance nested inside it, which inherits the value too; a parameter changes one alone,
as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps
one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or
font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component
falls back to the theme token beside it.
| Name |
Default value |
Description |
|---|
| --bit-ToggleButton-color |
Per Variant: --bit-clr-pri-text (Fill), --bit-clr-pri (Outline, Text) |
Foreground of the unchecked toggle button at rest. The checked state paints its own, so setting this one alone never changes how the state reads. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-color, --bit-ToggleButton-outline-color and --bit-ToggleButton-text-color are read ahead of it. |
| --bit-ToggleButton-background |
Per Variant: --bit-clr-pri (Fill), transparent (Outline, Text) |
Background of the unchecked toggle button at rest, and the fallback of its resting border color. The Color parameter (or OffColor) wins over it in Fill; the transparent background of Outline and Text is its alone. Shared by the three variants: --bit-ToggleButton-fill-background, --bit-ToggleButton-outline-background and --bit-ToggleButton-text-background are read ahead of it. |
| --bit-ToggleButton-border-color |
--bit-ToggleButton-background, then per Variant |
Border color of the unchecked toggle button at rest. The Outline variant is the one that draws it in the role color while the background stays transparent. The Color parameter (or OffColor) wins over it, except over the transparent border of Text. Shared by the three variants: --bit-ToggleButton-fill-border-color, --bit-ToggleButton-outline-border-color and --bit-ToggleButton-text-border-color are read ahead of it. |
| --bit-ToggleButton-hover-color |
Per Variant: the resting foreground (Fill), --bit-clr-pri-text (Outline, Text) |
Foreground while hovered, on pointer devices only, and the one an unchecked Outline or Text toggle button with FixedColor wears in every state. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-hover-color, --bit-ToggleButton-outline-hover-color and --bit-ToggleButton-text-hover-color are read ahead of it. |
| --bit-ToggleButton-hover-background |
--bit-clr-pri-hover |
Background while hovered, and the fallback of the hovered border color. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-hover-background, --bit-ToggleButton-outline-hover-background and --bit-ToggleButton-text-hover-background are read ahead of it. |
| --bit-ToggleButton-hover-border-color |
--bit-ToggleButton-hover-background |
Border color while hovered. Set it on its own to keep an outline steady under a changing background. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-hover-border-color, --bit-ToggleButton-outline-hover-border-color and --bit-ToggleButton-text-hover-border-color are read ahead of it. |
| --bit-ToggleButton-active-color |
--bit-ToggleButton-hover-color |
Foreground while pressed. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-active-color, --bit-ToggleButton-outline-active-color and --bit-ToggleButton-text-active-color are read ahead of it. |
| --bit-ToggleButton-active-background |
--bit-clr-pri-active |
Background while pressed, and the fallback of the pressed border color. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-active-background, --bit-ToggleButton-outline-active-background and --bit-ToggleButton-text-active-background are read ahead of it. |
| --bit-ToggleButton-active-border-color |
--bit-ToggleButton-active-background |
Border color while pressed. The Color parameter (or OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-active-border-color, --bit-ToggleButton-outline-active-border-color and --bit-ToggleButton-text-active-border-color are read ahead of it. |
| --bit-ToggleButton-checked-color |
--bit-clr-pri-text |
Foreground while checked, in every variant. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-hover-color |
--bit-ToggleButton-checked-color |
Foreground while checked and hovered, on pointer devices only. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-active-color |
--bit-ToggleButton-checked-hover-color |
Foreground while checked and pressed. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-background |
--bit-clr-pri-dark |
Background while checked, and the fallback of the checked border color. It is what separates the two states visually, so it stays worth keeping distinct from the resting background. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-border-color |
--bit-ToggleButton-checked-background |
Border color while checked. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-hover-background |
--bit-clr-pri-dark-hover |
Background while checked and hovered. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-hover-border-color |
--bit-ToggleButton-checked-hover-background |
Border color while checked and hovered. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-active-background |
--bit-clr-pri-dark-active |
Background while checked and pressed. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-checked-active-border-color |
--bit-ToggleButton-checked-active-background |
Border color while checked and pressed. The Color parameter (or OnColor) wins over it. |
| --bit-ToggleButton-disabled-color |
--bit-clr-pri-dis-text |
Foreground when Disabled is true; also the focus ring color of a disabled toggle button kept focusable with AllowDisabledFocus. The Color parameter (or OnColor / OffColor) wins over it. Shared by the three variants: --bit-ToggleButton-fill-disabled-color, --bit-ToggleButton-outline-disabled-color and --bit-ToggleButton-text-disabled-color are read ahead of it. |
| --bit-ToggleButton-disabled-background |
Per Variant: --bit-clr-pri-dis (Fill), transparent (Outline, Text) |
Background when Disabled is true. The Color parameter (or OnColor / OffColor) wins over it in Fill; the transparent background of Outline and Text is its alone. Shared by the three variants: --bit-ToggleButton-fill-disabled-background, --bit-ToggleButton-outline-disabled-background and --bit-ToggleButton-text-disabled-background are read ahead of it. |
| --bit-ToggleButton-disabled-border-color |
--bit-ToggleButton-disabled-background, then per Variant |
Border color when Disabled is true. The Color parameter (or OnColor / OffColor) wins over it, except over the transparent border of Text. Shared by the three variants: --bit-ToggleButton-fill-disabled-border-color, --bit-ToggleButton-outline-disabled-border-color and --bit-ToggleButton-text-disabled-border-color are read ahead of it. |
| --bit-ToggleButton-fill-color |
--bit-ToggleButton-color |
Foreground at rest of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-background |
--bit-ToggleButton-background |
Background at rest of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-border-color |
--bit-ToggleButton-border-color |
Border color at rest of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-hover-color |
--bit-ToggleButton-hover-color |
Foreground while hovered (pointer devices only) of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-hover-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-hover-background |
--bit-ToggleButton-hover-background |
Background while hovered (pointer devices only) of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-hover-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-hover-border-color |
--bit-ToggleButton-hover-border-color |
Border color while hovered (pointer devices only) of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-hover-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-active-color |
--bit-ToggleButton-active-color |
Foreground while pressed of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-active-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-active-background |
--bit-ToggleButton-active-background |
Background while pressed of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-active-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-active-border-color |
--bit-ToggleButton-active-border-color |
Border color while pressed of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-active-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-fill-disabled-color |
--bit-ToggleButton-disabled-color |
Foreground when disabled of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-disabled-color so a theme can set this variant apart from the other two. It also draws the focus ring of a disabled toggle button of this variant, checked or not, while AllowDisabledFocus keeps it in the tab order. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-fill-disabled-background |
--bit-ToggleButton-disabled-background |
Background when disabled of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-disabled-background so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-fill-disabled-border-color |
--bit-ToggleButton-disabled-border-color |
Border color when disabled of an unchecked Fill toggle button alone, read ahead of --bit-ToggleButton-disabled-border-color so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-outline-color |
--bit-ToggleButton-color |
Foreground at rest of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-background |
--bit-ToggleButton-background |
Background at rest of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) leaves it alone. |
| --bit-ToggleButton-outline-border-color |
--bit-ToggleButton-border-color |
Border color at rest of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-hover-color |
--bit-ToggleButton-hover-color |
Foreground while hovered (pointer devices only) of an unchecked Outline toggle button alone, and the one it wears in every state with FixedColor, read ahead of --bit-ToggleButton-hover-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-hover-background |
--bit-ToggleButton-hover-background |
Background while hovered (pointer devices only) of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-hover-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-hover-border-color |
--bit-ToggleButton-hover-border-color |
Border color while hovered (pointer devices only) of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-hover-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-active-color |
--bit-ToggleButton-active-color |
Foreground while pressed of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-active-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-active-background |
--bit-ToggleButton-active-background |
Background while pressed of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-active-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-active-border-color |
--bit-ToggleButton-active-border-color |
Border color while pressed of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-active-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-outline-disabled-color |
--bit-ToggleButton-disabled-color |
Foreground when disabled of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-disabled-color so a theme can set this variant apart from the other two. It also draws the focus ring of a disabled toggle button of this variant, checked or not, while AllowDisabledFocus keeps it in the tab order. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-outline-disabled-background |
--bit-ToggleButton-disabled-background |
Background when disabled of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-disabled-background so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) leaves it alone. |
| --bit-ToggleButton-outline-disabled-border-color |
--bit-ToggleButton-disabled-border-color |
Border color when disabled of an unchecked Outline toggle button alone, read ahead of --bit-ToggleButton-disabled-border-color so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-text-color |
--bit-ToggleButton-color |
Foreground at rest of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-background |
--bit-ToggleButton-background |
Background at rest of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) leaves it alone. |
| --bit-ToggleButton-text-border-color |
--bit-ToggleButton-border-color |
Border color at rest of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) leaves it alone. |
| --bit-ToggleButton-text-hover-color |
--bit-ToggleButton-hover-color |
Foreground while hovered (pointer devices only) of an unchecked Text toggle button alone, and the one it wears in every state with FixedColor, read ahead of --bit-ToggleButton-hover-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-hover-background |
--bit-ToggleButton-hover-background |
Background while hovered (pointer devices only) of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-hover-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-hover-border-color |
--bit-ToggleButton-hover-border-color |
Border color while hovered (pointer devices only) of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-hover-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-active-color |
--bit-ToggleButton-active-color |
Foreground while pressed of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-active-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-active-background |
--bit-ToggleButton-active-background |
Background while pressed of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-active-background so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-active-border-color |
--bit-ToggleButton-active-border-color |
Border color while pressed of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-active-border-color so a theme can set this variant apart from the other two. The Color parameter (or OffColor) wins over it. |
| --bit-ToggleButton-text-disabled-color |
--bit-ToggleButton-disabled-color |
Foreground when disabled of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-disabled-color so a theme can set this variant apart from the other two. It also draws the focus ring of a disabled toggle button of this variant, checked or not, while AllowDisabledFocus keeps it in the tab order. The Color parameter (or OnColor / OffColor) wins over it. |
| --bit-ToggleButton-text-disabled-background |
--bit-ToggleButton-disabled-background |
Background when disabled of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-disabled-background so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) leaves it alone. |
| --bit-ToggleButton-text-disabled-border-color |
--bit-ToggleButton-disabled-border-color |
Border color when disabled of an unchecked Text toggle button alone, read ahead of --bit-ToggleButton-disabled-border-color so a theme can set this variant apart from the other two. The Color parameter (or OnColor / OffColor) leaves it alone. |
| --bit-ToggleButton-checked-disabled-opacity |
--bit-opa-dis |
Dimming of a disabled toggle button that is checked. It keeps the checked colors rather than taking the disabled ones, since a setting greyed out at "on" and one greyed out at "off" are different facts, so the disabled variables above do not reach it; set it to 1 to remove the dimming and leave it in its checked colors at full strength, and restyle it through the checked variables. |
| --bit-ToggleButton-focus-color |
--bit-clr-pri-focus |
Color of the keyboard focus ring. The Color parameter (or OnColor / OffColor) wins over it. While it is unset, the focus ring is the library's own --bit-shd-focus-ring, so replacing that token re-shapes it too. |
| --bit-ToggleButton-radius |
--bit-shp-radius-button |
Corner radius of the box, which the background and the focus ring follow. Set it to 999px for the pill-shaped toggle buttons of a filter row. |
| --bit-ToggleButton-border-width |
--bit-shp-brd-width |
Thickness of the border. The Fill and Text variants draw theirs in the background color, so thickening it only shows on Outline unless a border color is set with it. |
| --bit-ToggleButton-min-width |
--bit-siz-ctrl-min-width |
Smallest width of the box. An icon-only toggle button falls back to its minimum height rather than to the control minimum, which is what keeps it square, and a FullWidth one drops the minimum altogether, since a button measured by its container should not be pushed out of one narrower than it. A value set here is honoured in both cases. |
| --bit-ToggleButton-min-height |
--bit-siz-ctrl-md |
Smallest height of the box, which is what lines a toggle button up with the other controls of its size and keeps the smallest one above the 24px minimum pointer target of WCAG 2.2. It is a floor, not a height: a wrapped label still grows the box. It is also the minimum width of an icon-only toggle button. The Size parameter wins over it. |
| --bit-ToggleButton-padding |
--bit-siz-ctrl-pad-y-md --bit-siz-ctrl-pad-x-md, --bit-siz-ctrl-pad-y-md when icon-only |
Padding of the box. The Size parameter wins over it. |
| --bit-ToggleButton-gap |
spacing(0.5), 0 when there is no text |
Room between the check mark, the icon and the text. |
| --bit-ToggleButton-font-size |
--bit-tpg-fs-sm |
Font size of the text. The Size parameter wins over it. |
| --bit-ToggleButton-font-weight |
--bit-tpg-font-weight |
Font weight of the text. Raising it on the checked state alone is not possible from here, since one box carries both states; use Styles.Checked for that. |
| --bit-ToggleButton-icon-size |
The text size, or spacing(2.35) when icon-only |
Size of the icon and the check mark. With a label beside it the glyph rides the text by default, which is what keeps the two lined up at any font scale. The Size parameter wins over it on an icon-only toggle button. |
| --bit-ToggleButton-spinner-size |
spacing(2.35) |
Diameter of the spinner shown in the loading state. The Size parameter wins over it. |
| --bit-ToggleButton-loading-label-font-size |
--bit-tpg-fs-xs |
Font size of the LoadingLabel beside the spinner, one step of the ramp below the text of the toggle button. The Size parameter wins over it. |