react-input-chips
Version:
A package with minimum dependencies and maximum customization.
24 lines (20 loc) • 1.18 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
type AllowedKeys = 'ShiftRight' | 'ShiftLeft' | 'ControlLeft' | 'ControlRight' | 'AltRight' | 'AltLeft' | 'MetaLeft' | 'MetaRight' | 'Tab' | 'Enter' | 'Backspace' | 'Space' | 'Comma' | 'Period' | 'Slash' | 'Semicolon' | 'ArrowLeft' | 'ArrowRight';
interface TInputChips {
chips: string[];
inputValue: string;
setChips: React.Dispatch<React.SetStateAction<string[]>>;
setInputValue: React.Dispatch<React.SetStateAction<string>>;
keysToTriggerChipConversion?: AllowedKeys[];
validate?: () => boolean;
disabled?: boolean;
placeholder?: string;
nextPlaceholder?: string;
removeBtnSvg?: React.ReactElement<React.SVGProps<SVGSVGElement>>;
chipStyles?: React.CSSProperties;
containerStyles?: React.CSSProperties;
backspaceToRemoveChip?: boolean;
errorMsg?: string;
}
declare const InputChips: ({ chips, setChips, inputValue, setInputValue, keysToTriggerChipConversion, validate, disabled, placeholder, nextPlaceholder, removeBtnSvg, chipStyles, containerStyles, backspaceToRemoveChip, errorMsg, }: TInputChips) => react_jsx_runtime.JSX.Element;
export { InputChips };