Skip to main content

SearchAccessory

Combines a ToolbarSearchBar with an optional SegmentedControl for scope filtering. Designed for iPad navigation bar layouts.

Import​

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

Basic Usage​

Live Preview
<ThemeProvider initialTheme="light">
<Stack gap={24} style={{maxWidth: 600}}>
  <SearchAccessory
    placeholder="Search"
    scopes={[
      { label: 'All', value: 'all' },
      { label: 'Photos', value: 'photos' },
    ]}
    selectedScope="all"
  />
  <SearchAccessory placeholder="Search Messages" />
</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
scopes{ label, value }[]—Scope filter tabs
selectedScopestring—Currently selected scope
onScopeChange(scope: string) => void—Scope change handler
showMicrophonebooleantrueShow mic icon

Accessibility​

  • Search input and segmented control are independently focusable
  • Scope tabs provide tab semantics

Changelog​

See GitHub Releases for version history.