0.0.19 • Published 6 years ago

@potok/icon-switch v0.0.19

Weekly downloads
1
License
-
Repository
-
Last release
6 years ago

Switch component

Install

yarn add @potok/icon-switch

Usage

import IconSwitch from '@potok/icon-switch';
import ApplicantFavIcon from '@potok/icons/glyph/misc/fav';
import ApplicantMoveIcon from '@potok/icons/glyph/misc/move';

const Example = () => (
  <div>
    <IconSwitch
      value={true}
      enabledIcon={<ApplicantFavIcon />}
      disabledIcon={<ApplicantMoveIcon />}
    />
  </div>
);

Example

const Locked = require('@potok/icons/glyph/clear/locked').default;
const Unlocked = require('@potok/icons/glyph/clear/unlocked').default;
const Lock = require('@potok/icons/glyph/clear/lock').default;
initialState = { checked: false };

<>
  <div>
    <IconSwitch
      enabledIcon={<Locked primaryColor="#fff" size="xsmall" />}
      disabledIcon={<Unlocked primaryColor="#fff" size="xsmall" />}
      label="Controllable"
      value={state.checked}
      onChange={e => setState({ checked: e.target.checked })}
    />
  </div>

  <div style={{ marginTop: 20 }}>
    <IconSwitch
      enabledIcon={<Lock primaryColor="#fff" size="xsmall" />}
      disabledIcon={<Lock primaryColor="#fff" size="xsmall" />}
      label="Uncontrollable"
    />
  </div>

  <div style={{ marginTop: 20 }}>
    <IconSwitch
      enabledIcon={<Locked primaryColor="#fff" size="xsmall" />}
      disabledIcon={<Unlocked primaryColor="#fff" size="xsmall" />}
      label="Disabled"
      value={true}
      disabled
    />
  </div>
</>;
0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.1.0

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago