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

@potok/icon-switch

Package Overview
Dependencies
Maintainers
6
Versions
56
Alerts
File Explorer

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.17
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-96.55%
Maintainers
6
Weekly downloads
 
Created
Source

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 26 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc