ActionButton14 props
Toggle Button
ToggleButton switches between selected and unselected states to represent a persistent on/off choice. Use it standalone for binary actions like bold, mute, or favorite, or insid...
공식 문서 열기Preview
Import
import {ToggleButton} from '@astryxdesign/core/ToggleButton';Astryx 문서 권장 방식대로 root barrel이 아니라 컴포넌트 subpath에서 가져옵니다.
When to use
ToggleButton switches between selected and unselected states to represent a persistent on/off choice. Use it standalone for binary actions like bold, mute, or favorite, or insid...
toggletogglebuttonpressedtoolbarformattingsegmentedbutton-groupexclusive
Important props
pressedChangeAction(isPressed: boolean) => void | Promise<void>optional
sizesm | md | lgoptional
Theming targets
astryx-toggle-button-group
Best practices
- DoUse a filled or colored icon for the pressed state so users can see the current state at a glance: an outline star vs a solid star, for example.
- DoKeep the label identical between pressed and unpressed states. Let the visual treatment (icon, weight, background) communicate the change.
- DoWrap related toggles in a ToggleButtonGroup with an accessible label so screen readers announce them as a connected set.
- Do notDon't use a ToggleButton for one-time actions like "Submit" or "Delete"; those are regular Buttons, not toggles.