Two State Button API Overview
Initialization
import { TwoState } from "@svar-ui/react-core";
// minimal configuration for initialization
export default function App() {
return <TwoState>Click Me</TwoState>;
}
tip
- Visit the Features Guide to learn more about the control's functionality.
- Explore the samples to visualize the available features.
Two State Button Properties
| css | Optional. Adds a custom style to the Two State button |
| disabled | Optional. Defines whether the Two State button is disabled |
| icon | Optional. Adds an icon for the Two State button |
| iconActive | Optional. Adds an icon for the Two State button in the pressed state |
| text | Optional. Adds a text for the Two State button |
| textActive | Optional. Adds a text for the Two State button in the pressed state |
| title | Optional. Sets a tooltip text with additional info about the control |
| type | Optional. Sets the type of the Two State button |
| value | Optional. Defines whether a button is pressed |
Two State Button Events
| change | Fires when the state of the Two State button changes |
| click | Adds a click handler to the Two State button |