LogoCraftReactNative
Components

InputSearch

A text field component that allows users to search. It provides a customizable input field with support for left and right icons and different sizes. Based on React Native TextInput component.

Installation

npx @craftreactnative/ui add InputSearch

Usage

Screen.tsx
import { InputSearch } from '@/craftrn-ui/components/InputSearch';
 
export const Screen = () => (
  <InputSearch
    placeholder="Search for a destination"
    leftAccessory={
      <View style={styles.leftAccessory}>
        <Search color={theme.colors.contentTertiary} />
      </View>
    }
    rightAccessory={
      <ButtonRound
        renderIcon={size => (
          <Slider size={size} color={theme.colors.contentTertiary} />
        )}
        onPress={() => {}}
      />
    }
  />
);

Props

Inherit all props from TextInputProps.

PropTypeDefault
onPress?
() => void
-
itemLeft?
ReactNode
-
itemRight?
ReactNode
-

Dependencies

1 packages
react-native-unistyles

On this page