New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@potok/icon-switch

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@potok/icon-switch

Potok.io UI Icon Switch component

  • 0.0.19
  • latest
  • npm
  • Socket score

Version published
Maintainers
6
Created

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>
</>;

FAQs

Package last updated on 22 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts