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

react-simple-wheel-picker

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-wheel-picker

react-simple-wheel-picker You can set up simple and flexible wheel picker

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
465
decreased by-22.37%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-wheel-picker

demo

You can set up simple and flexible wheel picker



Overview

  • This package is simple and flexible wheel picker for React
  • This package move like same as native applications picker
  • This package support accessibility

Usage

  • npm i react-simple-wheel-picker or yarn add react-simple-wheel-picker
  • Look at simple example below or please check example if you want to know more detail usage
import WheelPicker from 'react-simple-wheel-picker';

const data = [
	{
		id: '1',
		value: 'test1'
	},
	{
		id: '2',
		value: 'test2'
	},
	{
		id: '3',
		value: 'test3'
	},
	{
		id: '4',
		value: 'test4'
	},
	{
		id: '5',
		value: 'test5'
	}
];

const Sample = () => {
	const handleOnChange = target => {
		console.log(target);
	};
	return (
		<WheelPicker
			data={data}
			onChange={handleOnChange}
			height={150}
			width={100}
			titleText="Enter value same as aria-label"
			itemHeight={30}
			selectedID={data[0].id}
			color="#ccc"
			activeColor="#333"
			backgroundColor="#fff"
		/>
	);
};

Normal Props

propstyperequiredescription
dataArray<{id: string, value: string | number}>trueIt should be array of object that have id and value
selectedIDstringtrueYou can set default data id
onChangefunction(data: PickerData): voidtrueYou can get value or id
heightnumbertrueYou can specify height to wheel picker
itemHeightnumbertrueYou can specify item height to wheel picker item
widthnumberfalseYou can specify width to wheel picker
idNamestringfalseYou can specify id name to have relation to htmlFor label element
colorstringfalseYou can specify color to picker value
activeColorstringfalseYou can specify active color to picker value
fontSizenumberfalseYou can specify font size to picker value
backgroundColorstringfalseYou can specify background color to wheel picker
shadowColorstringfalseYou can specify shadow color to wheel picker
focusColorstringfalseYou can specify focus color that is painted border color when WheelPicker is focused
refWheelPickerReffalseYou can refer element to use focus or blur function by specifying ref props

Accessibility Props

propstyperequiredescription
titleIDstringfalseYou can specify titleID that it is linked with aria-labelledby
titleTextstringfalseYou can specify titleText that it is linked with aria-label
requiredbooleanfalseYou can specify required that it is linked with aria-required

If you want to know more about accessibility, you can check here.

Accessibility for this package

  • Support aria-* and role options
  • Support keyboard operation

Keywords

FAQs

Package last updated on 08 May 2020

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