- This app is currently in a broken state. You must create your component and add it to
ReactDOM.renderinsrc/index.jsto get started. - Using React and CSS, create a
Typeaheadcomponent that takes alistprop. - Use the
colorsListlist defined insrc/index.jsas the value for thelistprop.- Please do not change
colorsListor its contents. - If you want to go above and beyond, you can add other features or use another list that you receive from an async query, as long as it still meets all the same requirements when the
colorsListis passed as thelistprop.
- Please do not change
- Send the link to a public repository with your project submission to your recruitment contact.
- Use of propTypes and/or other typing systems
- Responsive design
- Tasteful styling
- Tasteful animations are a bonus
- Use of styling frameworks (Material, Bootstrap, Tailwind, etc.)
- Styling writing libraries and pre-processors (Styled Components, SCSS, etc) are welcome but not expected.
- Copy/Pasted code from other source code
- As the user types in the input field, a list of options should appear below it.
- The list should only appear when input is not empty. Whitespace is considered empty.
- The list should contain items from the
listprop that start with the user entered value. Matching should be case insensitive. Every new character typed should filter the list.
- Clicking on a list item should populate the input with the selected item's value and hide the list.
- As the user types, the matching substring within the dipslayed options should be bold. The rest of the string should not be bold.
- Ex. When the user types
bl,blinblack,blanchedalmond,blue, andbluevioletshould be bold. The rest of each word should not be bold.
- Ex. When the user types
- For visible options, style the substring the user has entered as bold.
- Mousing over a list item should highlight it, at least darkening its background color. Other styling is up to you.
- The input and list should also be navigable using the keyboard.
- Using
tabandshift+tab, the user should be able to move focus to and from the different list items.- With the cursor in the input, pressing the
tabkey should move focus to the first item with the default browser focus style. - Subsequent presses of the "tab" key should focus the next item in the list.
- Pressing the
shift+tabkeys should focus the previous item in the list. - Pressing the
shift+tabkey when the first item is focused should focus the input again. - Mousing over other list items should highlight them while the keyboard- focused item remains focused.
- Pressing the
tabkey when no list is visible should move focus away from the input.
- With the cursor in the input, pressing the
- Pressing the
enterorreturnkey when an item is focused should populate the input with the focused item's value, hide the list, and focus the input again. - Pressing the
escapekey should close the list.
- Using
- Clicking outside the input or the list should close the list.
- Clone this repository and run
npm installto install dependencies. - From the project directory,
npm startruns the app in development mode. - Open http://localhost:3000 to view it in the browser.
This project was bootstrapped with Create React App.