0.6.0 • Published 1 year ago

@foundationcomponentrepo/switches v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@foundationcomponentrepo/switches

Base switches component for foundation

Install

npm install --save @foundationcomponentrepo/switches

Props

type : string

The type prop is to pass the type of the switch. It is either selected or success.

select : bool

The select prop is to pass the initial state of the switch.

disabled : bool

The disabled prop is pass the disabled state ( true or false ) of the switch.

onClick : func

This onClick prop is an optional prop used to retrive the select state of the switch.

Example:

const sampleFunction = (e: any) => {
    console.log(e.target.checked)   // Prints the select state of the switch
}

<Switches type="selected" onClick={sampleFunction}>

You can add your own function and pass it through this prop.

License

MIT © unplatforms