2018-09-24 15:36:35 +00:00
|
|
|
```jsx
|
|
|
|
import { Search } from '@woocommerce/components';
|
|
|
|
|
2018-09-26 17:13:28 +00:00
|
|
|
const MySearch = withState( {
|
|
|
|
selected: [],
|
2018-10-10 03:58:34 +00:00
|
|
|
inlineSelected: [],
|
|
|
|
} )( ( { selected, inlineSelected, setState } ) => (
|
|
|
|
<div>
|
|
|
|
<H>Tags Below Input</H>
|
|
|
|
<Section component={ false }>
|
|
|
|
<Search
|
|
|
|
type="products"
|
|
|
|
placeholder="Search for a product"
|
|
|
|
selected={ selected }
|
|
|
|
onChange={ items => setState( { selected: items } ) }
|
|
|
|
/>
|
|
|
|
</Section>
|
|
|
|
<H>Tags Inline with Input</H>
|
|
|
|
<Section component={ false }>
|
|
|
|
<Search
|
|
|
|
type="products"
|
|
|
|
placeholder="Search for a product"
|
|
|
|
selected={ inlineSelected }
|
|
|
|
onChange={ items => setState( { inlineSelected: items } ) }
|
|
|
|
inlineTags
|
|
|
|
/>
|
|
|
|
</Section>
|
|
|
|
</div>
|
2018-09-26 17:13:28 +00:00
|
|
|
) );
|
2018-09-24 15:36:35 +00:00
|
|
|
```
|