react-icons/bs#BsSearch TypeScript Examples

The following examples show how to use react-icons/bs#BsSearch. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: formElements.tsx    From DevC-benin-jobs with GNU General Public License v3.0 5 votes vote down vote up
SearchInput: React.FC<SearchInputProps> = ({
  placeholder,
  value,
  onChange,
  name,
  type,
  className,
  containerClassName,
  inputClassName,
  disabled = false,
  ...rest
}) => {
  const ref = useRef<HTMLDivElement>(null);
  const interact = useCallback((type: 'blur' | 'focus'): void => {}, []);
  return (
    <label
      className={`d-flex column margin-bottom-sm ${className}`}
      style={{ width: '100%' }}>
      <div
        ref={ref}
        className={`d-flex align-items-center nowrap form-control search-input-container bg-transparent ${containerClassName}`}>
        <button
          type="button"
          className="padding-vertical-xs padding-horizontal-sm padding-right-sm search-btn">
          <BsSearch size={20} className="color-primary-dark" />
        </button>
        <input
          onBlur={(): void => interact('blur')}
          onFocus={(): void => interact('focus')}
          type={type}
          name={name}
          value={value}
          onChange={onChange}
          placeholder={placeholder}
          disabled={disabled}
          className={`search-field flex-equal padding-vertical-sm padding-horizontal-sm font-sm font-weight-500 ${inputClassName}`}
          {...rest}
        />
      </div>
    </label>
  );
}