@types/react-tag-input
TypeScript icon, indicating that this package has built-in type declarations

6.6.6 • Public • Published

Installation

npm install --save @types/react-tag-input

Summary

This package contains type definitions for react-tag-input (https://github.com/prakhar1989/react-tags).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-tag-input.

index.d.ts

import * as React from "react";

export interface Tag {
    id: string;
    text: string;
}

export interface ReactTagsProps {
    tags?: Tag[] | undefined;
    suggestions?: Tag[] | undefined;
    delimiters?: number[] | undefined;
    placeholder?: string | undefined;
    labelField?: string | undefined;

    handleAddition: (tag: { id: string; text: string }) => void;
    handleDelete: (i: number) => void;
    handleDrag?: ((tag: { id: string; text: string }, currPos: number, newPos: number) => void) | undefined;
    handleFilterSuggestions?: ((textInputValue: string, possibleSuggestionsArray: Tag[]) => Tag[]) | undefined;
    handleTagClick?: ((i: number) => void) | undefined;

    autofocus?: boolean | undefined;
    allowAdditionFromPaste?: boolean | undefined;
    allowDeleteFromEmptyInput?: boolean | undefined;
    handleInputChange?: ((value: string) => void) | undefined;
    handleInputFocus?: ((value: string) => void) | undefined;
    handleInputBlur?: ((textInputValue: string) => void) | undefined;
    minQueryLength?: number | undefined;
    removeComponent?: React.Component<any, any> | React.FC<any> | undefined;
    autocomplete?: boolean | 1 | undefined;
    readOnly?: boolean | undefined;

    name?: string | undefined;
    id?: string | undefined;
    maxLength?: number | undefined;
    inputValue?: string | undefined;

    inline?: boolean | undefined;
    inputFieldPosition?: "top" | "bottom" | "inline" | undefined;
    inputProps?: React.InputHTMLAttributes<HTMLInputElement> | undefined;
    allowUnique?: boolean | undefined;
    allowDragDrop?: boolean | undefined;
    // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
    renderSuggestion?(tag: Tag, query: string): React.ReactElement | number | string | void;
    shouldRenderSuggestions?: ((query: string) => boolean) | undefined;

    classNames?: {
        tags?: string | undefined;
        tagInput?: string | undefined;
        tagInputField?: string | undefined;
        selected?: string | undefined;
        tag?: string | undefined;
        remove?: string | undefined;
        suggestions?: string | undefined;
        activeSuggestion?: string | undefined;
    } | undefined;
}

export class WithContext extends React.Component<ReactTagsProps> {}
export class WithOutContext extends React.Component<ReactTagsProps> {}

export default WithContext;

Additional Details

  • Last updated: Thu, 07 Dec 2023 08:08:17 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Ogglas, Jan Karres, Matthew Berryman, and Matthew Cavender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-tag-input

Weekly Downloads

7,828

Version

6.6.6

License

MIT

Unpacked Size

8.05 kB

Total Files

5

Last publish

Collaborators

  • types