https://github.com/frontekip/tcomb-checkbox-switch
Switch checkboxes for tcomb form.
https://github.com/frontekip/tcomb-checkbox-switch
boolean checkbox form react switch tcomb tcomb-form
Last synced: 8 months ago
JSON representation
Switch checkboxes for tcomb form.
- Host: GitHub
- URL: https://github.com/frontekip/tcomb-checkbox-switch
- Owner: Frontekip
- Created: 2023-10-28T08:52:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-28T10:33:30.000Z (over 2 years ago)
- Last Synced: 2025-02-28T03:16:20.521Z (about 1 year ago)
- Topics: boolean, checkbox, form, react, switch, tcomb, tcomb-form
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tcomb-checkbox-switch
**tcomb-checkbox-switch** is an addon package that transforms the standard checkbox in tcomb-form into a switch-style input.
## Installation
First, install the package in your project using the following command:
npm install tcomb-checkbox-switch
or if you use yarn:
yarn add tcomb-checkbox-switch
## Usage
After adding the package to your project, you can use it as follows:
```JS
import t from "tcomb-form";
import CheckboxSwitch from 'tcomb-checkbox-switch'; // <-- import package
const Schema = t.struct({
is_active: t.Boolean,
});
const Options = {
is_active: {
label: "Is Active",
factory: CheckboxSwitch, // <-- Add factory
},
};
```
This code creates a switch-style input for a boolean value named `is_active`.
## Features
If you wish to contribute to the development of this package, please apply to the project on GitHub.
If you encounter any issues or have suggestions related to this package, please contact us via the GitHub Issues section.