Skip to content

1jayeshpoduval/multi-select-with-search

Repository files navigation

Multiselect Search

Fully customisable component built with React, Tailwind CSS, and Motion.

Core functionality

This component allows users to select multiple options from a searchable dropdown list, making it perfect for tasks like filtering or tagging. For example, it can be used on an e-commerce website to let users search for and select categories like "Shoes," "Accessories," and "Clothing" to narrow down their search results.

Component details

The component is React-based and designed with shadcn/ui. It is powered by the headless command menu package ‘cmdk’ by Paco Coursey, which uses Radix UI components under the hood. This ensures out-of-the-box accessibility, including aria and role attributes, focus management, and keyboard navigation. It is fully customizable with Tailwind CSS, making it easy to adapt the styling to fit different project requirements.

Key features

  1. Multiselect Support Enables users to choose multiple options from the dropdown, making it ideal for tagging, filtering, and categorising items.

  2. Debounced Search Improves performance by adding a brief delay between keystrokes, reducing unnecessary re-renders and API calls during typing.

  3. Keyboard Navigation Navigate through options using arrow keys and delete selected items with the Backspace key.

  4. Customisable Styling Customise the design to match your project's aesthetic using Tailwind CSS.

  5. Smooth Animations Uses subtle animations powered by Motion (formerly Framer Motion) to enhance the user experience. The component respects accessibility preferences by disabling animations when users have enabled the "prefers-reduced-motion" setting.

Open Source

Your contributions to improving this component would be greatly appreciated. Feel free to open an issue or submit a PR

About

A multi select with search component built with shadcn and Motion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published