I would like to request the addition of a toggle component to this library. The main objective of this component is to provide a lightweight and customizable toggle functionality for React applications. The proposed toggle component should have the following features:
Toggle Functionality:
The component should provide a simple and intuitive toggle behavior, allowing users to switch between two states (e.g., on/off or true/false).
Props Handling:
The toggle component should support props to enable customization and flexibility. The following props should be included:
Default State:
The component should accept a prop to define the initial state of the toggle (e.g., defaulting to "off" or "false").
On Change Callback:
The component should allow users to provide a callback function that gets triggered whenever the toggle state changes.
This callback function can be used to handle any necessary actions based on the new toggle state.
Additional Styling:
The component should support props for customizing the visual appearance, such as specifying the color, size, and style of the toggle.
Icon Support:
The toggle component should allow the inclusion of icons associated with each state. Icons can be used to visually represent the toggle states, such as using a checkmark for "on" and a cross for "off." The component should accept props for specifying the icons to be used or provide default icons if no custom icons are provided.
Description:
I would like to request the addition of a toggle component to this library. The main objective of this component is to provide a lightweight and customizable toggle functionality for React applications. The proposed toggle component should have the following features:
Toggle Functionality:
The component should provide a simple and intuitive toggle behavior, allowing users to switch between two states (e.g., on/off or true/false).
Props Handling:
The toggle component should support props to enable customization and flexibility. The following props should be included:
Icon Support:
The toggle component should allow the inclusion of icons associated with each state. Icons can be used to visually represent the toggle states, such as using a checkmark for "on" and a cross for "off." The component should accept props for specifying the icons to be used or provide default icons if no custom icons are provided.
Mockup:
Addtional context: