1.0.33 • Published 4 years ago

@tractorzoom/virtualized-select v1.0.33

Weekly downloads
124
License
ISC
Repository
github
Last release
4 years ago

@tractorzoom/virtualized-select

React virtualized select element using react-window

Commitizen friendly jest Prettier Renovate enabled semantic-release Storybook

Publish Status PR Verify Status

Live Examples with Storybook

Install

npm i --save @tractorzoom/virtualized-select

Usage

import React from 'react'
import VirtualizedSelect from '@tractorzoom/virtualized-select'

const MyComponent = () => (
    <VirtualizedSelect
        onChange={(selectedItem) => console.log('selectedItem: ', selectedItem)}
        options={[{
            label: 'Item 1',
            value: 1,
        }, {
            label: 'Item 2',
            value: 2,
        }, {
            label: 'Item 3',
            value: 3,
        }]}
    />
)

export default MyComponent

Virtualized Select Props

valuerequireddescription
isDisablednobool value that disables select element
isRequirednobool value that when enabled add red required border to select
onChangeyesfunction called when selection changes
optionsyeslist of options for select
placeholdernostring to display inside select when no current selection; defaults to Select...
valuenoobject that matches the Option object that is selected

Option Props

valuerequireddescription
labelyesstring displayed in drop down
subtitlenostring displayed as subtext in drop down
valueyesidentifier for option

Contributing

We welcome improvements and fixes via PRs. Review the contributing guidelines below before getting started.

Code Style

We use Prettier with pre-commit hooks to format the majority of our code style preferences.

Committing

We use commitlint to ensure our commit messages are consistent and semantic. Commitlint is enable through a pre-commit hook with husky. For assistance with making commit messages that abide by our configuration, use npm run commit to step through the commitizen wizard to commit staged changes.

Storybook

We use Storybook to create our examples for our component. If you are adding or editing props to the VirtualizedSelect component, ensure that you have added or updated any stories effected to document the functionality of the component.

Testing

Using Jest for testing. Prefer the use of Jest Snapshots and react-test-renderer.

npm run test
1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.27

4 years ago