AutoCompleteSuggestionItem

Renders an item in the autocomplete list.

Best Practices

  • Keep items compact to avoid pushing the list off-screen.
  • Use triggerType to adjust item layout based on suggestion type.
  • Avoid heavy rendering logic; memoize if items include images.
  • Ensure tap targets are large enough for mobile UX.
  • Use the SDK types for itemProps to avoid runtime mismatches.

General Usage

Customize AutoCompleteSuggestionItem and pass it via AutoCompleteSuggestionItem on Channel.

See Customizing autocomplete suggestions for details.

import {
  Channel,
  AutoCompleteSuggestionItem,
  WithComponents,
} from "stream-chat-react-native";

const AutoCompleteSuggestionItemComponent = () => (
  <AutoCompleteSuggestionItem />
);

<WithComponents
  overrides={{
    AutoCompleteSuggestionItem: AutoCompleteSuggestionItemComponent,
  }}
>
  <Channel channel={channel} />
</WithComponents>;

Props

PropDescriptionType
itemPropsSuggestion data object. CommandSuggestion and UserSuggestion come from stream-chat; Emoji is defined in the SDK.Suggestion(CommandSuggestion | Emoji | UserSuggestion)
triggerTypeThe trigger that determines which autocomplete list to show.'command' | 'emoji' | 'mention'