Package Exports
- @tryferos/dropdown
- @tryferos/dropdown/dist/index.cjs
- @tryferos/dropdown/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tryferos/dropdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Dropdown Components
Install the package for npm here.
This is a react component delivering various Editable Dropdowns that you can use in your projects, which also adds types support using Typescript.
The project is build using React, Typescript and Tailwindcss. Tailwindcss is compiled into css, meaning you do not need it as a depedency.
All files are bundled into 3 seperate files for both cjs, esm and dts using the Rollup bundler. (commonjs, esmodules and declaration for ts types).
đ¯ Features
- â Typescript support
- â FULLY Customizable to your needs
- â Light/dark mode toggle
- â Search option
- â Animations option
đ Installation
Install @tryferos/dropdown using
npm install @tryferos/dropdown@1.3.2Remember that you need to have react and react-dom already installed
npm install react@^18.0.1 react-dom@^18.0.1This package is build using react 18, you can use with different versions of react at your own risk.
npm install @tryferos/dropdown@1.3.2 --forceImport the components
import { SimpleDropdown, CategorizedDropdown } from "@tryferos/dropdown";đŦ Options & Types
title: string;
animation?: {
animate?: boolean;
animateChildren?: boolean;
delayPerChild?: 0.1 | 0.2 | 0.3 | 0.4 | 0.5;
animateChildrenUntilIndex?: number;
};
maxHeight?: string;
minWidth?: string;
maxWidth?: string;
darkMode?: boolean;
rounded?: boolean;
shadow?: boolean;
size?: string; //in percentage without %
openByDefault?: boolean;
showTitleIfClosed?: boolean;
search?: boolean;
closeOnClickOutside?: boolean;
placeholder?: string;
onSearchChange?: (value: string) => void;
closeOnSelect?: boolean;
//For Simple Dropdowns
items: Array<T>;
onSelect: (item: T) => void;
selected: T;
//For Categorized Dropdowns
categories: Array<{
title: string;
items: Array<{
item: T;
disabled?: boolean;
}>;
}>;
selected: {
item: T,
category: {
title: string;
}
}
onSelect: ({item: T, category: {title: string}}) => void