@navinc/base-react-components
Version:
Nav's Pattern Library
24 lines (19 loc) • 791 B
Markdown
All form-element components expect to be controlled components. This makes them
immediately compatible with form managers like formik or redux-form, as well as
within any stateful component.
Use the `<SearchInput />` component just as you would for any `input` type that
accepts textual input (`radio`, `checkbox` have their own respective
components). All props get passed on to the underlying `input`.
In addition to native form element attributes, all form-element components
implement these props
isInvalid: Boolean -- Indicates whether the value of the field is valid
(`false`) or invalid (`true`)
```
<SearchInput
NoResults={({ query }) => `look bro I got your ${query}`}
Result={({ result }) => result}
resultToQuery={(result) => result}
results={[]}
value='abc'
/>
```