Toggle & ToggleGroup Component
Description
The Toggle
component represents a selectable button that can be used alone or inside a ToggleGroup
for grouped selection. It supports exclusive selection (single toggle active) and multiple selection modes.
Props - Toggle
Prop | Type | Default | Description |
---|---|---|---|
value |
any |
- | Unique identifier for the toggle. |
isActive |
boolean |
false |
Defines whether the toggle is active. |
disabled |
boolean |
false |
Disables interaction with the toggle. |
onClick |
(event) => void |
- | Click handler for the toggle. |
Props - ToggleGroup
Prop | Type | Default | Description |
---|---|---|---|
value |
string |
- | The currently selected value (for exclusive mode). |
onChange |
(event, value) => void |
- | Handles toggle state changes. |
exclusive |
boolean |
true |
If true, allows only one toggle to be active at a time. |
Example Usage
Useful Links
🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core