Toggle
Description
A toggle key is a key that is used to turn a function on or off, or to switch between two functions.
System Dependencies
Installation
The package can be installed via npm:
npm install empower-inputs --save
Standard Toggle
Â
Configuration
import { InputSelectionHandler} from 'empower-inputs';
let [formElement, setFormElement] = useState({
sampleToggle: {
id: "sampleToggle",
label: "Sample Toggle",
type: 'toggle',
value: false,
required: true,
disabled: false
},
});
..............
return (
<>
<InputSelectionHandler
config={formElement.sampleToggle}
onChanged={(e) => inputChangedHandler(e, 'sampleToggle')}
/>
</>
)
 Properties
Parent Parameter | Sub Parameter | Data Type | Constraint |
---|---|---|---|
config | Â | JSON Object | Required |
 | id | String | Required |
 | type | String | Required |
 | label | String | Optional |
 | value | Array Object | Required |
 | placeholder | String | Optional |
 | readOnly | Boolean | Optional |
 | required | Boolean | Boolean |
 | disabled | Boolean | Boolean |
customClass | Â | String | Optional |
onChanged | Â | Event Method | Required |
References
Repository Link: https://bitbucket.org/empowerteams/empower-inputs
NPM Package: npm: empower-inputs
Demo Repo: git@bitbucket.org:empowerteams/mfe-sub-application-template.git