devtools--btns
v0.1.0
Published
A simple React component that allows toggling between two states, used in the example for language switching (e.g., French / English) with images (e.g., flags).
Downloads
68
Readme
react-language-switch
A simple React component that allows toggling between two states, used in the example for language switching (e.g., French / English) with images (e.g., flags).
Description
The Switch
component allows toggling between two images (such as flags for different languages) based on the current state. It is ideal for creating visual switches for features like language change in a React application. The component is customizable with different images for each state and uses an onClick
function to handle state changes.
Features
- Visual switch: Allows changing states with an animation.
- Customizable: Uses custom images for each state.
- Controlled state: State changes are managed through
state
andvalue
properties.
Installation
You can install this component by adding it to your project via npm:
npm install devtools--btns