Suggestions
Purpose
The Suggestions component is used to display a list of "did you mean" style suggestions within an instant search or similar area.
Usage
import React from "react";
import { Suggestions } from "@usereactify/search";
import { ExampleSuggestions } from "./ExampleSuggestions";
export const Component: React.FC = () => {
return (
<Suggestions
field="title"
render={ExampleSuggestions}
/>
);
};
Props
type SuggestionsProps = {
/** The field which should be used for suggestions */
field: "title";
/** Render method */
render?: React.FC<{
suggestions: Array<{
text: string;
}>;
}>;
};
Last updated
Was this helpful?