@potok/switch
v0.0.12
Published
Potok.io UI Switch component
Downloads
11
Readme
Switch component
Install
yarn add @potok/switch
Usage
import Switch from "@potok/switch";
const Example = () => (
<div>
<Switch value={true} enabledContent="Enabled" disabledContent="Disabled" />
</div>
);
Example
const CreateIcon = require("@potok/icons/glyph/clear/add").default;
const FavIcon = require("@potok/icons/glyph/misc/fav").default;
initialState = { checked: false, iconChecked: true };
<>
<div>
<Switch
enabledContent="Enabled"
disabledContent="Disabled"
value={state.checked}
onChange={e => setState({ checked: e.target.checked })}
/>
</div>
<div style={{ marginTop: 10 }}>
<Switch
enabledContent="Some enabled text"
disabledContent="Some disabled text"
value={true}
disabled
/>
</div>
</>;