doc-burger

Input Switch

A component for toggling betwene to selections

An input switch is a user interface element that allows users to toggle between two states, typically representing a binary choice.

input-switch component of Peaka

Key Features

Input switches offer the following key features:

  • Value: The value of an input switch can be either true or false. When the switch is on, its value is true; otherwise, its value is false.

  • Styles: Customize the initial styles of the input switch to match your application's design.

  • Disabled: When enabled, the "Disabled" option makes the input switch unchangeable, preventing user interaction.

How to Use Input Switchs

To use input switches in your application, follow these steps:

  1. Value: Utilize the "Value" property to set or retrieve the state of the input switch (true or false).

  2. Disabled State: Use the "Disabled" property to make the input switch unchangeable when necessary.

Use Cases

Input switches are commonly used in various scenarios, including:

  • Binary choices: Allow users to make binary decisions or enable/disable certain features or settings.

  • Preference settings: Implement input switches in user profiles or settings to toggle between specific options.

  • Form inputs: Include input switches in forms to collect user preferences or consent.

  • Status indicators: Use input switches to indicate the on/off status of certain elements or actions.

Input switches simplify user interactions by providing a straightforward way to make binary choices and improve the usability of your application.