Skip to content

Commit 155f52e

Browse files
committed
First release
1 parent b743495 commit 155f52e

File tree

7 files changed

+184
-149
lines changed

7 files changed

+184
-149
lines changed

README.md

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
# react-multi-select-advanced
22

3-
[![Top Language](https://img.shields.io/github/languages/top/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced) [![MIT License](https://img.shields.io/github/license/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced) [![Issues](https://img.shields.io/github/issues-raw/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced/issues) [![Minified Size](https://img.shields.io/bundlephobia/min/react-multi-select-advanced)](https://www.npmjs.com/package/react-multi-select-advanced) [![Downloads](https://img.shields.io/npm/dt/react-multi-select-advanced)](https://www.npmjs.com/package/react-multi-select-advanced)
3+
[![Open Source](https://badgen.net/badge/open-source/❤%EF%B8%8F/green?icon=github)](https://github.com/senerdude/react-multi-select-advanced) [![Top Language](https://img.shields.io/github/languages/top/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced) [![MIT License](https://img.shields.io/github/license/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced) [![Issues](https://img.shields.io/github/issues-raw/senerdude/react-multi-select-advanced)](https://github.com/senerdude/react-multi-select-advanced/issues) [![Minified Size](https://img.shields.io/bundlephobia/min/react-multi-select-advanced)](https://www.npmjs.com/package/react-multi-select-advanced) [![Downloads](https://img.shields.io/npm/dt/react-multi-select-advanced)](https://www.npmjs.com/package/react-multi-select-advanced) [![Storybook](https://img.shields.io/badge/Storybok-Playground-ff69b4)](https://lifetoweb.com/react-multi-select-advanced/)
44

5-
## Description
5+
## Description
66

77
The React Multi-select Advanced component is a powerful tool that can handle massive data sets without any struggle.
88
It comes with various customizable features that make it very easy to use, so you can tailor it to your specific needs.
99

10-
If you like it put a ⭐ on it. [![Stars](https://img.shields.io/github/stars/senerdude?style=social)](https://github.com/senerdude/react-multi-select-advanced)
10+
Like Beyoncé said, If you liked it, then you should a put a ⭐ on it. [![Stars](https://img.shields.io/github/stars/senerdude/react-multi-select-advanced?style=social)](https://github.com/senerdude/react-multi-select-advanced)
1111

1212
## Features
1313

14-
- Typescript: Types included, ensuring compatibility with your project.
15-
- Zero dependency: No need to worry about other libraries.
16-
- Powerful: Handles massive data sets without problem.
17-
- Responsive: Ensures that the component fit all device resolutions depending on parent component.
18-
- Customizable: Allow you to add custom class and change button, icons as components.
19-
- Auto direction: Ensures that list items open in the correct direction based on their placement on the page.
20-
- Localization: Easy to integrate any language.
21-
- Keyboard navigation: Supports keyboard arrows and tab.
22-
- Highlight keywords: Highlights entered text on list results.
23-
- Match priority: If label starts with keyword, shows first.
24-
- [Storybook](https://lifetoweb.com/react-multi-select-advanced/) : Document and test playground.
14+
<div style="font-size: 16px">
2515

26-
## Getting Started
16+
- **Typescript**: Types included, ensuring compatibility with your project.
17+
- **Zero dependency**: No need to worry about other libraries.
18+
- **Powerful**: Handles massive data sets without problem.
19+
- **Responsive**: Ensures that the component fit all device resolutions depending on parent component.
20+
- **Customizable**: Allow you to add custom class and change button, icons as components.
21+
- **Auto direction**: Ensures that list items open in the correct direction based on their placement on the page.
22+
- **Localization**: Easy to integrate any language.
23+
- **Keyboard navigation**: Supports keyboard arrows and tab.
24+
- **Highlight keywords**: Highlights entered text on list results.
25+
- **Match priority**: If label starts with keyword, shows first.
26+
- **[Storybook](https://lifetoweb.com/react-multi-select-advanced/)** : Document and test playground.
27+
28+
</div>
29+
30+
## Getting Started
2731

2832
## 1. Installation
2933

30-
npm
34+
##### npm
3135
```
3236
npm install react-multi-select-advanced
3337
```
3438

35-
yarn
39+
##### yarn
3640
```
3741
yarn add react-multi-select-advanced
3842
```
@@ -41,7 +45,10 @@ yarn add react-multi-select-advanced
4145

4246
## 2. Basic Usage
4347

48+
<table style="font-size: 14px">
49+
4450
```js
51+
4552
import { useState } from 'react'
4653

4754
// Import component / and types if need it.
@@ -91,62 +98,78 @@ function App() {
9198
}
9299

93100
export default App
101+
94102
```
95103

104+
</table>
105+
96106
----
97107

98108
## 3. Props
99109

110+
<table style="font-size: 14px">
111+
112+
100113
| Prop | Type | Default | Description |
101114
|:--------- | :---: | :---: |:---- |
102115
| `className` | `string` | | Options data
103116
| `options` | `array` | `[]` | Options data
104117
| `selectedValues` | `array` | `[]` | Pre-selected options
105-
| Input
106-
| `name` | `string` | Unique Id | input name
107-
| `id` | `string` | name or Unique Id | input id
118+
| **Input**
119+
| `name` | `string` | auto | input name
120+
| `id` | `string` | auto | input id
108121
| `label` | `string` | | Add label to top of input
109122
| `disabled` | `boolean` | | Disables search input
110123
| `invalid` | `boolean` | | If true border color turns to red
111124
| `inputDelay` | `number` | `1000` | Input delay (ms)
112125
| `placeholder` | `string` | | Input placeholder
113-
| Filter
126+
| **Filter**
114127
| `filterShowLoading` | `boolean` | `true` | Show/hide loading indicator or component
115128
| `filterLimit` | `number` | | Maximum dropdown display limit
116129
| `filterHighlightKeyword` | `boolean` | `false` | Highlights matching keyword. Suggested to use with filterLimit because of performance.
117130
| `filterOrderByMatchRank` | `boolean` | `false` | Gives match score if label starts with search keyword. Suggested to use with filterLimit because of performance.
118-
| Selected Items
131+
| **Selected Items**
119132
| `selectionLimit` | `number` | | Limits selected items
120133
| `selectionMaxVisibleItems` | `number` | | Limits selected display items and adds 'x more..' or MoreItemsComponent after items.
121134
| `selectionLabelMaxWidth` | `number` | | Limits max width of display label and wrap with ellipsis
122135
| `selectionShowClear` | `boolean` | `false` | Shows clear all button after selected items if selected count more than 2
123136
| `selectionShowDeleteButton` | `boolean` | `true` | Shows remove button inside the selected items
124-
| Language
137+
| **Language**
125138
| `languageOverwrite` | `object` | | Please see 4. Localization
126-
| Custom components
139+
| **Custom components**
127140
| `LoadingComponent` | `JSX.Element` | | Custom loading indicator
128141
| `ClearButtonComponent` | `JSX.Element` | | Custom clear all button
129142
| `DeleteButtonComponent` | `JSX.Element` | | Custom delete button
130143
| `MoreItemsComponent` | `JSX.Element` | | Custom more items
131-
| Callback
144+
| **Callback**
132145
| `onChange` | `function` | | Callback function will invoked on selected options are changed.
146+
147+
148+
</table>
133149
----
134150

135151
## 4. Localization
136152

137153
Easy to localize component by passing object to prop `languageOverwrite`. Default values are as below.
138154

139-
```json
155+
```js
140156
{
141-
"selectionLimitReached" : "Max selection limit reached.",
142-
"selectionShowClearText": "Clear All",
143-
"selectionDeleteTitle": "Remove selection",
144-
"moreItemsText": "{{count}} more items..."
157+
selectionLimitReached : 'Max selection limit reached.',
158+
selectionShowClearTitle: 'Clear All',
159+
selectionDeleteTitle: 'Remove',
160+
moreItemsText: '{{count}} more items...'
145161
}
146162
```
147163

164+
----
165+
148166
## 5. License
149167

150-
MIT
168+
MIT Licensed. Copyright © Lifetoweb 2022.
169+
170+
----
171+
172+
## Happy coding 😊
173+
174+
151175

152-
### Happy coding 😊

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.4.2",
2+
"version": "1.0.0",
33
"name": "react-multi-select-advanced",
44
"description": "React multi select filter input with advanced features",
55
"author": "Sener <[email protected]> (http://lifetoweb.com)",

src/App.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
display: grid;
33
max-width: 600px;
44
margin: 0 auto;
5-
font-family: Verdana, Geneva, Tahoma, sans-serif;
5+
font-family: 'Roboto', '-apple-system', 'BlinkMacSystemFont', 'Helvetica Neue', 'Helvetica' , 'sans-serif';
66
}

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function App() {
4242

4343
<h1>React Multi Select Advanced</h1>
4444

45-
<MultiSelectAdvanced label="Select cities from 42802 cities all around the world" options={options.cities} selectedValues={selectedItems} onChange={handleChange} />
45+
<MultiSelectAdvanced label="Select cities from all around the world" placeholder="Type a city name" selectionShowDeleteButton={true} selectionMaxVisibleItems={10} selectionShowClear={true} options={options.cities} selectedValues={selectedItems} onChange={handleChange} />
4646

4747
</div>
4848
</div>

0 commit comments

Comments
 (0)