Skip to main content
PROYECTOVIVIANA

ToggleButton

The props declared for ToggleButton, generated from the types @proyecto-viviana/ui ships.

Import

import { ToggleButton } from "@proyecto-viviana/ui";

Props

Props for ToggleButton in @proyecto-viviana/ui
PropTypeDefaultDescription
childrennumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—The content to display in the button.
size'S' | 'M' | 'L' | 'XL' | 'XS''M'The size of the button.
staticColor'white' | 'black' | 'auto'—The static color style to apply. Useful when the ToggleButton appears over a color background.
isQuietfalse | true—Whether the button should be displayed with a quiet style.
isEmphasizedfalse | true—Whether the selected ToggleButton should be emphasized.
stylesStyleString—Spectrum-defined generated classes.
UNSAFE_classNamestring—Additional CSS class name. Use only as a last resort.
UNSAFE_styleJSX.CSSProperties—Additional inline styles. Use only as a last resort.
slotstring | false—A slot name for the component. HTML `slot` may be `false` to omit. solidaria-components
ref((el: HTMLButtonElement) => void) | { current?: HTMLButtonElement | null | undefined; }—Ref for the underlying button element. solidaria-components
idKey—Preferred group key prop, parity with RAC item id usage. solidaria-components
onChange(isSelected: boolean) => void—Handler called when the button's selection state changes. solidaria
aria-controlsstring—Identifies the element (or elements) whose contents or presence are controlled by the button. solidaria
aria-currentfalse | true | 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'—Indicates the current "pressed" state of toggle buttons. solidaria
aria-describedbystring—The id of the element that describes the button. solidaria
aria-detailsstring—The id of the element that provides detailed, extended description for the button. solidaria
aria-disabledfalse | true | 'true' | 'false'—Indicates that the button is perceivable but disabled. solidaria
aria-expandedfalse | true | 'true' | 'false'—Whether the popup is expanded. solidaria
aria-haspopupfalse | true | 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'—Whether the button has a popup. solidaria
aria-labelstring—The accessible label for the button. solidaria
aria-labelledbystring—The id of the element that labels the button. solidaria
isDisabledboolean | Accessor<boolean>—Whether the button is disabled. solidaria
onPress(e: PressEvent) => void—Handler called when the press is released over the target. solidaria
onPressStart(e: PressEvent) => void—Handler called when a press interaction starts. solidaria
onPressEnd(e: PressEvent) => void—Handler called when a press interaction ends. solidaria
onPressUp(e: PressEvent) => void—Handler called when a press is released over the target. solidaria
onPressChange(isPressed: boolean) => void—Handler called when the press state changes. solidaria
preventFocusOnPressfalse | true—Whether the button should not receive focus on press. solidaria
autoFocusfalse | true—Whether the element should receive focus on render. solidaria
excludeFromTabOrderfalse | true—Whether to exclude the button from the tab order. solidaria
isSelectedboolean | Accessor<boolean>—Whether the button is selected (controlled). solidaria
defaultSelectedfalse | true—The default selected state (uncontrolled). solidaria
toggleKeyKey—Key used when inside ToggleButtonGroup selection state. solidaria-components

Declared in packages/viviana-ui/src/button/ToggleButton.tsx.

Props marked solidaria or solidaria-components come from the headless layer underneath and behave the same in both registers. Components that wrap a DOM element also accept that element's standard attributes, which are left out here on purpose — listing them would bury the props that are actually ours.