Socket
Socket
Sign inDemoInstall

react-timezone-picker

Package Overview
Dependencies
8
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-timezone-picker

React Timezone Picker


Version published
Weekly downloads
86
decreased by-45.22%
Maintainers
1
Install size
13.5 kB
Created
Weekly downloads
 

Readme

Source

React Timezone Picker

gzip size npm version npm downloads

This is a React component for selecting a timezone. The implementation is one file, it can be styled, and it has no dependencies.

Install

  • Npm: npm install react-timezone-picker
  • Yarn: yarn add react-timezone-picker

Use

import React from 'react';
import TimezonePicker from 'react-timezone-picker';

const MyComponent() => {
        return (
            <TimezonePicker onChange={console.log} />
        )
    })

Use With Options

import React from 'react';
import TimezonePicker from 'react-timezone-picker';

const MyComponent() => {
        return (
            <TimezonePicker
                onChange={console.log}
                defaultValue={'America/New_York'}
                unselectLabel="No Timezone"
                style={{
                    borderRadius: '0.5rem',
                    background: 'teal',
                    color: 'white',
                }}
            />
        )
    })

Options

Customize timezone picker by passing these, or any other props valid on the <select /> element, to the component:

PropDescription
onChangeinitial open state of the modal
defaultValuethe value the timezone picker is initially set to
valuepass a value into the picker making it a controlled component
unselectLabelthe label for selecting undefined (the undefined option does not appear without a label specified)
stylestyles for the element

See the examples and the examples source code for more snippets to copy.

Help

If there are any examples you'd like to see or use cases I didn't cover, please file an issue.

Keywords

FAQs

Last updated on 12 Mar 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc