Registry Index

Search the catalog

Type to search items across every indexed registry, or pick a page.

ComponentReactregistry:ui2 dependencies

SearchField

search-field

Search pill: a rounded-full text input with a leading magnifier and a trailing clear button.

Live, loading

Starting the live preview…

Runs in a sandboxed frame on a separate origin, in its registry's own theme. Mounted with no props — an item that paints an empty box is given its name as text, and some items need input to show anything.

Notes from the author

Use this instead of hand-rolling the pill-with-magnifier-and-clear recipe. Controlled (value/onChange) and i18n-agnostic - pass translated label, clearLabel and placeholder; label is the accessible name, since a placeholder is not a label. Pass tabbable={shown} when a HeaderStandIn keeps it mounted but collapsed, so a zero-width field never catches Tab. size sm (h-9) sits flush in dense chrome; md (h-10) matches the control baseline - applies only to variant solid (the default). variant frosted is a floating blurred pill for a bar over scrolling content, always h-12 regardless of size.
1 other registry

Similar components

Other registries' take on search-field.

@whiskeyjack

More from @whiskeyjack