Skip to content

Commit ef3e5aa

Browse files
committed
Add a proper README
1 parent fb5ae5c commit ef3e5aa

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,47 @@
1+
[![NPM](https://img.shields.io/npm/v/react-select-nes-css-theme.svg)](https://www.npmjs.com/package/react-select-nes-css-theme)
2+
13
# react-select-nes-css-theme
2-
A React-Select theme created to match NES.css styles
4+
#### A lightweight (zero-dependency) [React-Select](https://github.com/JedWatson/react-select) theme created to match [NES.css](https://github.com/nostalgic-css/NES.css) styles.
5+
6+
![](example.gif)
7+
8+
#### Installation
9+
Use either
10+
```bash
11+
yarn add react-select-nes-css-theme
12+
```
13+
or
14+
```bash
15+
npm install react-select-nes-css-theme
16+
```
17+
18+
#### Usage
19+
Simply import the theme object and pass it to the `styles` prop of the `Select` component.
20+
```javascript
21+
import React, { useState } from 'react';
22+
import Select from 'react-select';
23+
24+
import nesTheme from 'react-select-nes-css-theme'; // HERE: Import the theme object
25+
26+
const StyledSelectComponent = () => {
27+
const [value, setValue] = useState();
28+
29+
return (
30+
<Select
31+
value={value}
32+
styles={nesTheme} // HERE: Pass the theme object as a prop
33+
onChange={setValue}
34+
options={[
35+
{ value: 0, label: To be' },
36+
{ value: 1, label: 'Not to be' },
37+
]}
38+
/>
39+
);
40+
};
41+
42+
export default StyledSelectComponent;
43+
```
44+
45+
## License
46+
47+
MIT Licensed. Copyright (c) Wojciech Olejnik 2018.

example.gif

84.7 KB
Loading

0 commit comments

Comments
 (0)