BridgeBeta
  • Brand
  • Digital Assets
    Foundations
    Icons
    Components
    Templates
  • Resources
    Design Tokens
    How-tos
    Best Practices
    Libraries
    Accessibility
    Products List
  • Support
    • Overview
    • Actions
      • Overview
      • Button
      • ContextMenu
      • Link
    • Controls
      • Overview
      • Checkbox
      • Tag
      • Toggle
    • Forms
      • Overview
      • DatePicker
      • FileUploader
      • Input
      • NumberInput
      • RadioButton
      • Search
      • Select
      • Slider
      • TextArea
      • TextInput
    • Hooks
      • useIsomorphicLayoutEffect
      • useMediaQuery
      • useSettings
    • Navigation
      • Overview
      • AnchorNavigation
      • BannerNavigation
      • Breadcrumb
      • Footer
      • InfoBar
      • MainNavigation
      • SecondaryNavigation
      • StepNavigation
      • SubNavigation
    • Overlay
      • Overview
      • Credits
      • Modal
      • ModalWrapper
      • Notification
      • Tooltip
    • Structure
      • Overview
      • Accordion
      • AuthLayout
      • Avatar
      • Callout
      • Card
      • ContentSwitcher
      • Empty
      • Hero
      • InlineLoading
      • Item
      • List
      • Loading
      • mdxComponents
      • Module
      • Pagination
      • ReadMore
      • Story
      • Table
      • Tabs
      • Text
      • Unit
      • User
      • WFPCoreProvider
      • Wrapper
Components
Forms
Search

Search

  • Design
  • Code
  • Props

Search

Editable Example

import { Search } from "@wfp/react";

() => {
  return (
    <Search
      name="search"
      onClear={function P() {}}
      placeholder="search here"
    />
  );
};

PropDefaultDescriptionValue

small

boolean
–

true to use the small version of Search

disabled

boolean
–

Specify if the control should be disabled, or not

name

string
–

Provide a name for the control

placeholder

string
–

Specify the placeholder attribute for the input

readOnly

boolean
–

If the input is read-only, the user cannot change its value but focus and tabIndex are still applied (sets aria-readonly as well)

required

boolean
–

Specify if the control is required (sets aria-invalid as well)

value

string
–

onChange

(event?: ChangeEvent<HTMLInputElement>,value?: string) => void
–

The new value is available first arg 'searchValue' and evt object if needed is on second arg. i.e. const handleChange = (searchValue, evt) => { console.log("searchValue", searchValue); // a string console.log("evt", evt); // the whole event object }

defaultValue

string |number
–

className

string
–

id

string
–

Provide a unique identifier for the control

formItemClassName

string
–

Specify an optional className to be applied to the form-item node

inputWrapperClassName

string
–

Provide a custom className that is applied directly to the underlying <input> or <textarea> node

hideLabel

boolean
–

Specify whether you want the underlying label to be visually hidden

light

boolean
–

closeButtonLabelText

string
–

The text for the close Button

hideControls

boolean
–

kind

"main" |"small" |"light" |"banner" |"large"
–

Specify a style for the search input

onSearchIconClick

() => void
–

wrapperClassName

string
–

An optional class to apply additional styling to the wrapper

rounded

boolean
–

onClear

() => void
–

Provide a function that is called when the search input is cleared

helperText

ReactNode
–

Provide text that is used alongside the control label for additional help

labelText

ReactNode
–

Provide the text that will be read by a screen reader when visiting this control

invalid

any
–

Specify whether the control is currently invalid. Either a boolean in combination with invalidText or an object( eg. { message: "Message", …otherErrorProperties }) can be passed.

invalidText

any
–

Provide the text that is displayed when the control is in an invalid state

additional

ReactNode
–

Provide the content that will be shown in addition to the label (e.g. units, currency, etc.) This content will be placed after the label

inline

boolean
–

Renders the input as inline element for horizontal forms

addonBefore

ReactNode
–

Additional helper in front of the input, e.g. a currency symbol (sets aria-describedby as well)

addonAfter

ReactNode
–

Additional helper behind the input, e.g. a currency symbol (sets aria-describedby as well)

components

AddonBeforeAddonAfterLabelHelperTextInlineErrorMessage
–

Supports replacement components

On this page

  • Search

References

  • Storybook
Storybook
Figma library
Contact us
2025 © World Food Programme