Skip to main content

ToolbarSearchBar

iOS 26 glassmorphic search input with search icon, optional microphone, and clear button. Used inside toolbars and search accessories.

Import​

import { ToolbarSearchBar } from '@scaffald/ui';

Basic Usage​

Live Preview
<ThemeProvider initialTheme="light">
<Stack gap={16} style={{maxWidth: 400}}>
  <ToolbarSearchBar placeholder="Search" value="" />
  <ToolbarSearchBar placeholder="Search" value="Search Term" />
  <ToolbarSearchBar placeholder="Filter" value="" showMicrophone={false} />
</Stack>
</ThemeProvider>

Props​

See the TypeScript definitions for the complete props API.

PropTypeDefaultDescription
valuestring''Current search text
onChangeText(text: string) => void—Text change handler
placeholderstring'Search'Placeholder text
onFocus() => void—Focus handler
onBlur() => void—Blur handler
onCancel() => void—Cancel handler
showMicrophonebooleantrueShow mic icon
showClearbooleantrueShow clear button when text present

Accessibility​

  • accessibilityRole="search" on the text input
  • Clear button has "Clear search" accessible label
  • Placeholder text serves as accessible label

Design Tokens​

  • Glass background: rgba(235, 235, 237, 0.7) light / rgba(58, 58, 60, 0.7) dark
  • Blur: backdrop-filter: blur(30px) on web
  • Placeholder: colors.labelsVibrant[theme].secondary
  • Text: colors.labels[theme].primary

See Design Tokens for more information.

Changelog​

See GitHub Releases for version history.