npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@easyfeedback/switches

v1.0.6

Published

Switches are used as an alternative for the Checkbox component.

Downloads

5

Readme

Switches

Table of Contents

Installation

yarn add @easyfeedback/switches
# or
npm i @easyfeedback/switches

Switch

The Switch component is used as an alternative for the Checkbox component. You can switch between enabled or disabled states.

Import component

import { Switch } from '@easyfeedback/switches'

General usage

<Switch label="My Setting" />

With labels

Use the labelPlacement property to add a visible label the switch.
If labelPlacement is not set the label will add to the aria-label attribute.

You can set the value to start or end.

<HStack>
  <Switch label="left labelled" labelPlacement="start" />
  <Switch label="right labelled" labelPlacement="end" />
</HStack>

With a color scheme

Use the colorScheme property to change the color variant of the switch.

<Switch label="My switch has a blue color" colorScheme="blue" />

Sizes

Use the size property to change the width and height of the switch.

You can set the value to sm, md or lg.

<HStack>
  <Switch label="sm" size="sm" />
  <Switch label="md" size="md" />
  <Switch label="lg" size="lg" />
</HStack>

Props

| Name | Description | type | Default | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | -------- | | label | Defines the string that labels the checkbox element. Even if it is not displayed on the screen, it is used in the aria-label attribute. | string | - | | colorScheme | [Optional] The color scheme of the switch. | {the chakra color schemes} | 'teal' | | id | [Optional] The id assigned to the input element. | string | - | | labelPlacement | [Optional] The position of the label. | 'start' \| 'end' | - | | size | [Optional] The size of switch. | 'sm' \| 'md' \| 'lg' | 'md' |

ViewsSwitch

The Switch component is used as an alternative for the Checkbox component. You can switch between enabled or disabled states.

Import component

import { ViewsSwitch } from '@easyfeedback/switches'

General usage

<ViewsSwitch />

// or

<ViewsSwitch onChange={(event) => {}} />

Props

| Name | Description | type | Default | | -------- | --------------------------------------------------------------------------- | ------------------------------------------------ | ------- | | onChange | [Optional] Callback when the state (controlled or un-controlled) changes. | (event: ChangeEvent<HTMLInputElement>) => void | - |