Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
jscottsmith committed Nov 6, 2018
1 parent 7b4a0ed commit cb08a80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions _stories/molecules/SearchSelect/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# SearchSelect

`<SearchSelect>` allows for external options to be provided and selected through a dropdown.

| Name | Default | Description | type |
| ------------ | ----------------- | ------------------------------------------------------------------------------------------------ | -------- |
| debounceTime | 300 | Time to wait before the `onChange` handler is called | Number |
| isFocused | false | Sets the `autoFocus` input attribute to `true`, so the element will be focused on mount | Bool |
| isLoading | false | Indicate if the the loading component should render | Bool |
| onChange | | Debounced change event handler that will be called with the current value in the input | Function |
| onSelect | | Select even handler which will be called with the selected option, e.g. `{ id: 1, title: 'foo'}` | Function |
| options | [] | Array of options with the following shape `[{ id: 1, title: 'foo'}, { id: 2, title: 'bar'}]` | Array |
| placeholder | 'Start Typing...' | Placeholder value to display on an empty input | String |
| renderLoader | | Function to render a loading component such as `() => <LoadingDots size="sm" />` | Function |
| size | 'sm' | Size of the input, one of `xs`, `sm`, or `md` | String |
2 changes: 1 addition & 1 deletion components/molecules/SearchSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SearchSelect extends Component {
debounceTime: PropTypes.number,
isFocused: PropTypes.bool,
isLoading: PropTypes.bool,
onChange: PropTypes.func,
onChange: PropTypes.func.isRequired,
onSelect: PropTypes.func.isRequired,
options: PropTypes.array,
placeholder: PropTypes.string,
Expand Down

0 comments on commit cb08a80

Please sign in to comment.