SearchControl

SearchControl components let users display a search control.

View on Storybook

View source on GitHub

Import

import { SearchControl } from '@wordpress/components';

Props

NameTypeDefaultRequiredDescription
labelunknown__( 'Search' )
placeholderunknown__( 'Search' )
hideLabelFromVisionunknowntrue
sizeunknown'default'

Examples

Default

const Default = ( {
	onChange,
	...props
} ) => {
	const [ value, setValue ] = useState< string >();

	return (
		<SearchControl
			{ ...props }
			value={ value }
			onChange={ ( ...changeArgs ) => {
				setValue( ...changeArgs );
				onChange( ...changeArgs );
			} }
		/>
	);
};