UNPKG

@mtg-rio/mui-mentions

Version:

@mention people in a MUI TextField

23 lines (22 loc) 982 B
import React, { ReactNode } from 'react'; import { BaseSuggestionData, SuggestionData } from './types'; interface SuggestionProps<T extends BaseSuggestionData> { /** The id of the suggestion. */ id: string; /** The search string generating the suggestion list. */ query: string; /** The index of the suggestion. */ index: number; /** The suggestion itself. */ suggestion: SuggestionData<T>; /** Whether the suggestion is focused by the user. */ focused?: boolean; /** A function to customize the suggestion renderer. */ renderSuggestion?: (props: SuggestionProps<T>) => JSX.Element; /** Called when the suggestion is clicked. */ onClick?: React.MouseEventHandler<HTMLDivElement>; /** Called when the user mouses over the suggestion. */ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>; } declare function Suggestion<T extends BaseSuggestionData>(props: SuggestionProps<T>): ReactNode; export default Suggestion;