Skip to main content

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

cssOptional. Adds a custom style to the Two State button
disabledOptional. Defines whether the Two State button is disabled
iconOptional. Adds an icon for the Two State button
iconActiveOptional. Adds an icon for the Two State button in the pressed state
textOptional. Adds a text for the Two State button
textActiveOptional. Adds a text for the Two State button in the pressed state
titleOptional. Sets a tooltip text with additional info about the control
typeOptional. Sets the type of the Two State button
valueOptional. Defines whether a button is pressed

Two State Button Events

changeFires when the state of the Two State button changes
clickAdds a click handler to the Two State button