Gathering detailed insights and metrics for @nvis/react-windowed-select
Gathering detailed insights and metrics for @nvis/react-windowed-select
Gathering detailed insights and metrics for @nvis/react-windowed-select
Gathering detailed insights and metrics for @nvis/react-windowed-select
An integration of react-window with react-select to efficiently render large lists.
npm install @nvis/react-windowed-select
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
138 Commits
20 Branches
1 Contributors
Updated on Aug 26, 2020
Latest Version
2.0.3
Package Id
@nvis/react-windowed-select@2.0.3
Unpacked Size
111.88 kB
Size
34.00 kB
File Count
5
NPM Version
6.9.0
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
22
An integration of react-window
with react-select
to efficiently render large lists.
The easiest way to use react-windowed-select
is to install it from npm:
npm install react-windowed-select
Then use it in your app:
1import React from "react"; 2import WindowedSelect from "react-windowed-select"; 3 4const options = []; 5 6for (let i = 0; i < 10000; i += 1) { 7 options.push({ 8 label: `Option ${i}`, 9 value: i 10 }); 11} 12 13function App () { 14 return <WindowedSelect options={options} />; 15}
For more examples, check out the Storybook.
react-windowed-select
is just a wrapper around react-select
.
All props passed to the WindowedSelect
component are forwarded to the default exported Select
component
from react-select
.
The number of options beyond which the menu will be windowed.
All of the named exports from react-select
are re-exported from react-windowed-select
for easy access to features
that allow you to customize your Select component.
1import { components, createFilter } from 'react-windowed-select'; 2import React from "react"; 3 4const options = [ 5 { value: 1, label: 'Foo' }, 6 { value: 2, label: 'Bar '}, 7]; 8 9const customFilter = createFilter({ ignoreAccents: false }); 10const customComponents = { 11 ClearIndicator: (props) => <components.ClearIndicator {...props}>clear</components.ClearIndicator> 12}; 13 14function App () { 15 return ( 16 <WindowedSelect 17 components={customComponents} 18 isClearable={true} 19 filterOption={customFilter} 20 options={options} 21 /> 22 ); 23}
By default, react-windowed-select
wraps the standard Select component from react-select
.
If you want to add windowing to the Async or Creatable Select components from react-select
, use the WindowedMenuList
:
1import { WindowedMenuList } from 'react-windowed-select'; 2import CreatableSelect from 'react-select/creatable'; 3 4function App () { 5 return ( 6 <CreatableSelect 7 components={{ MenuList: WindowedMenuList }} 8 // ...other props 9 /> 10 ); 11}
You can still use the styles API from react-select
to customize how your Select component looks.
The height property of the Option
, GroupHeading
, NoOptionsMessage
and/or LoadingMessage
components is used to determine the total height of the windowed menu and the following defaults are provided:
Component | Default Height |
---|---|
Option | 35px |
GroupHeading | 25px |
NoOptionsMessage | 35px |
LoadingMessage | 35px |
To override these values, use the styles
prop like you would with a regular react-select
component.
1<WindowedSelect 2 options={options} 3 styles={{ 4 option: (base) => ({ 5 ...base, 6 height: 60, // must be type number 7 padding: '20px 12px', 8 }), 9 }} 10/>
Grouped options are not fully supported.
In order to ensure proper scrolling and focus behavior, options nested inside the Group
component are flattened. This changes the component structure within MenuList
in the following way:
MenuList
│
└───Group
│ │
| └───GroupHeading
|
└───Option 1
|
└───Option 2
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
109 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More