Skip to main content

Two State Button API Overview

Initialization

<script>
import { TwoState } from "wx-svelte-core";
</script>

<!-- minimal configuration for initialization -->
<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

cssadds a custom style to the Two State button
disableddefines whether the Two State button is disabled
iconadds an icon for the Two State button
iconactiveadds an icon for the Two State button in the pressed state
textadds a text for the Two State button
textactiveadds a text for the Two State button in the pressed state
titlesets a tooltip text with additional info about the control
typesets the type of the Two State button
valuedefines 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