Chips Input
React.js
easy
25 mins
Description
In this task, you are asked to create a Chips Input component that allows users to input a series of tags or keywords. The component will display these tags as "chips" (small labels), which users can add and remove dynamically.
Features:
- Input Field: Users can type text into an input field.
- Add Chips: When the user presses the "Enter" key, the typed text will be added as a new chip (tag). Empty or whitespace-only chips should not be added
- Remove Chips: Users can delete a chip by clicking the "X" button next to it.
- Horizontal Display: The chips should be displayed in a horizontal list.
- Persistence: The list of chips should be maintained even when the component re-renders.
Important Points:
- The input field should be of type text.
- Button should be labeled "X" to delete chips
- If two chips have the same name, deleting one should NOT delete both.
- Make sure to use onKeyDown event handler instead of onKeyPress because onKeyPress is deprecated.
Reference UI

Preview what you need to build
Companies:
amazon
flipkart
phonepe
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!
