diff --git a/README.md b/README.md
index 183871b..4dda4f3 100644
--- a/README.md
+++ b/README.md
@@ -137,13 +137,7 @@ class App extends React.Component {
render() {
const { animal } = this.state;
- return (
-
- );
+ return ;
}
}
```
@@ -168,13 +162,7 @@ const App = () => {
setAnimal(value);
};
- return (
-
- );
+ return ;
};
export default App;
@@ -209,12 +197,7 @@ const App = () => {
};
return (
-
+
);
};
@@ -225,25 +208,27 @@ export default App;
This table shows all the options available in react-tailwindcss-select.
-| Option | Type | Default | Description |
-|-----------------------------------------------|------------|--------------------|----------------------------------------------------------------------------------------|
-| [`classNames`](#classNames) | `Object` | `undefined` | This prop allows you to style most of the components used by this library. |
-| `isClearable` | `Boolean` | `true` | Indicates if you can empty the select field. |
-| `isDisabled` | `Boolean` | `false` | Indicates if you can disable the select field. |
-| `isMultiple` | `Boolean` | `false` | Indicates if you can do a multiple selection. |
-| `isSearchable` | `Boolean` | `true` | Indicates if you can search the elements of the select field. |
-| [`formatGroupLabel`](#formatGroupLabel) | `Function` | `null` | Allows you to use a custom rendering template for each subgroup title |
-| [`formatOptionLabel`](#formatOptionLabel) | `Function` | `null` | Allows you to use a custom rendering template for each option in the list |
-| `loading` | `Boolean` | `false` | Indicates if you want a loader to appear in the field. |
-| `menuIsOpen` | `Boolean` | `false` | Indicates if you want the options menu to be displayed by default. |
-| `noOptionsMessage` | `String` | `No results found` | Default message when there is no option in the select field. |
-| [`onChange`](#onChange) | `Function` | | This callback, if present, is triggered when the select field value is modified. |
-| [`onSearchInputChange`](#onSearchInputChange) | `Function` | | This callback, if present, is triggered when the search input field value is modified. |
-| [`options`](#options) | `Array` | `[]` | All options or options groups available in the selection field. |
-| `placeholder` | `String` | `Select...` | The placeholder shown for the select field. |
-| `primaryColor` | `String` | `blue` | Default theme of the field. |
-| `searchInputPlaceholder` | `String` | `Search...` | The placeholder shown for the search input field. |
-| [`value`](#value) | `Object` | `null` | Current value of select field. |
+| Option | Type | Default | Description |
+| --------------------------------------------- | ---------- | ---------------------------------- | -------------------------------------------------------------------------------------- |
+| [`classNames`](#classNames) | `Object` | `undefined` | This prop allows you to style most of the components used by this library. |
+| `isClearable` | `Boolean` | `true` | Indicates if you can empty the select field. |
+| `isDisabled` | `Boolean` | `false` | Indicates if you can disable the select field. |
+| `isMultiple` | `Boolean` | `false` | Indicates if you can do a multiple selection. |
+| `isSearchable` | `Boolean` | `true` | Indicates if you can search the elements of the select field. |
+| [`formatGroupLabel`](#formatGroupLabel) | `Function` | `null` | Allows you to use a custom rendering template for each subgroup title |
+| [`formatOptionLabel`](#formatOptionLabel) | `Function` | `null` | Allows you to use a custom rendering template for each option in the list |
+| `loading` | `Boolean` | `false` | Indicates if you want a loader to appear in the field. |
+| `menuIsOpen` | `Boolean` | `false` | Indicates if you want the options menu to be displayed by default. |
+| `noOptionsMessage` | `String` | `No results found` | Default message when there is no option in the select field. |
+| [`onChange`](#onChange) | `Function` | | This callback, if present, is triggered when the select field value is modified. |
+| [`onSearchInputChange`](#onSearchInputChange) | `Function` | | This callback, if present, is triggered when the search input field value is modified. |
+| [`options`](#options) | `Array` | `[]` | All options or options groups available in the selection field. |
+| `placeholder` | `String` | `Select...` | The placeholder shown for the select field. |
+| `primaryColor` | `String` | `blue` | Default theme of the field. |
+| `searchInputPlaceholder` | `String` | `Search...` | The placeholder shown for the search input field. |
+| [`value`](#value) | `Object` | `null` | Current value of select field. |
+| [`autoScrollOnMobile`](#autoScrollOnMobile) | `Object` | `{enabled:false, scrollHeight:50}` | Allows you to use a custom options for auto scroll |
+| [`noHighLigthLabel`] | `Boolean` | `false` | Indicates if you can disable the label highlight |
### onChange
@@ -259,8 +244,8 @@ currentValue => {
### onSearchInputChange
-This callback, if present, is triggered when the search input field value is modified. This callback takes
-as parameter a `React.ChangeEvent`.
+This callback, if present, is triggered when the search input field value is modified. This callback
+takes as parameter a `React.ChangeEvent`.
```js
e => {
@@ -369,7 +354,7 @@ const App = () => {
// 👉 data represents each subgroup
{data.label}
-
+
{data.options.length}
// data represents each option in the list
@@ -442,11 +425,14 @@ As of version 1.6.0 of `react-tailwindcss-select` you can now use the `className
> **Info**
>
-> 👉 Note: this is not to be confused with the className prop, which will add a class to the component.
+> 👉 Note: this is not to be confused with the className prop, which will add a class to the
+> component.
-`classNames` takes an object with keys to represent the various inner components that `react-tailwindcss-select` is made up of.
+`classNames` takes an object with keys to represent the various inner components that
+`react-tailwindcss-select` is made up of.
-Each key takes a callback function or a string. If a key is not filled in, the default classes of the component will be used.
+Each key takes a callback function or a string. If a key is not filled in, the default classes of
+the component will be used.
#### All keys
@@ -456,7 +442,7 @@ interface SelectProps {
classNames?: {
menuButton?: (value?: { isDisabled?: boolean }) => string;
menu?: string;
- tagItem?: (value?: { item?: Option, isDisabled?: boolean }) => string;
+ tagItem?: (value?: { item?: Option; isDisabled?: boolean }) => string;
tagItemText?: string;
tagItemIconContainer?: string;
tagItemIcon?: string;
@@ -487,34 +473,32 @@ const options = [
];
const App = () => {
- const[animal, setAnimal] =useState(null);
+ const [animal, setAnimal] = useState(null);
const handleChange = value => {
console.log("value:", value);
setAnimal(value);
};
- return(
+ return (