Autocomplete/Autocomplete.tsx

sistent · src/base/Autocomplete/Autocomplete.tsx · typescript · Apache-2.0
ui

Material UI autocomplete wrapper for text input suggestions

// Source: https://github.com/layer5io/sistent | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import {
  Autocomplete as MuiAutocomplete,
  AutocompleteProps as MuiAutocompleteProps
} from '@mui/material';
import React from 'react';

export type AutocompleteProps<
  T,
  Multiple extends boolean = false,
  DisableClearable extends boolean = false,
  FreeSolo extends boolean = false
> = MuiAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>;

export const Autocomplete = React.forwardRef<HTMLDivElement, AutocompleteProps<unknown>>(
  (props, ref) => {
    return <MuiAutocomplete {...props} ref={ref} />;
  }
);

export default Autocomplete;

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key