You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to implement upcoming features such as the Time Range Picker and the Filters we’ll require to use a Select component, we’ll need to decide whether implementing the Select component ourselves or using a third party library.
Requirements
The Select component should include the next set of features
It should be Accessibility rich
It should be usable by keyboard
It should be a lightweight library
It should be a well maintained library
It should be highly customizable
It should allow autocompletion
It should allow multi-select
Implementing component ourselves
Implementing the Select component by ourselves will require that we fulfill the requirements that would mostly be already fulfilled by a third party library, it provides the advantage that we would have fully control around the component and any related bug would be in our hands to fix.
This would imply implementing by ourselves at least
Customization
Accessibility
Autocompletion
Multi-select
Customization
Ideally we would expose our customers with an API to fully customize the Select component’s styles, using a third party library would make this process a lot easy since we can expose the library’s API to our customers similar to what we do with Chart.js, implementing this ourselves would require:
Defining a customization API for the component
Allow customizing every part of the component
Colors
Text and fonts
Focus indicators
Option selected state
Providing customers with a primitive version of the component so they can style from scratch
The component should respond to browser preferences
Upon customization the component will require to update ARIA attributes accordingly
Accessibility
The component will require providing with full accessibility support
The component should be readable by a screen reader
The component should be usable only with the keyboard
The component should be fully responsive and work on mobile devices
The component should include the correct ARIA attributes
The component should ensure customization does not affect accessibility
Autocompletion
The component will require support for autocompletion
The API should allow enabling/disabling autocompletion
Typing in the input should filter the available options
Multi-select
The component will require support for selecting multiple options
The API should allow enabling/disabling auto-select
Selection an option should include the option value in the input
The input view for multiple options should be customizable
It should be a well maintained library (✅ Last commit less than a day ago)
It should be highly customizable ✅
It should allow autocompletion ✅
It should allow multi-select ✅
Note: Base-UI is a more modern and lightweight version of Material-UI that also allows better customization, it’s maintained by Material-UI and could be a better option to consider
Pros
Cons
Material-UI is a popular library (90.3k stars on Github)
It requires installing the entire library to use the Select component
Only 111 open issues related to Select on Github
Material-UI is not a lightweight library
Material-UI provides a Base-UI library which provides a basic set of components that are more customizable and lightweight (2.94 MB) This library also doesn’t require to install emotion.
Base-UI is currently in beta.
Material-UI contains other components that we could use for future use cases
Material-UI requires installing emotion, which would add more weight to the bundle size
January 2024: We decided to use Base-UI as it provides the best balance within our requirements, and the bundle size can be addressed with tree-shaking
The text was updated successfully, but these errors were encountered:
Problem statement
In order to implement upcoming features such as the Time Range Picker and the Filters we’ll require to use a Select component, we’ll need to decide whether implementing the Select component ourselves or using a third party library.
Requirements
The Select component should include the next set of features
Implementing component ourselves
Implementing the Select component by ourselves will require that we fulfill the requirements that would mostly be already fulfilled by a third party library, it provides the advantage that we would have fully control around the component and any related bug would be in our hands to fix.
This would imply implementing by ourselves at least
Customization
Ideally we would expose our customers with an API to fully customize the Select component’s styles, using a third party library would make this process a lot easy since we can expose the library’s API to our customers similar to what we do with Chart.js, implementing this ourselves would require:
Accessibility
The component will require providing with full accessibility support
Autocompletion
The component will require support for autocompletion
Multi-select
The component will require support for selecting multiple options
Using a third-party library
Radix
React-select
Material-UI
Note: Base-UI is a more modern and lightweight version of Material-UI that also allows better customization, it’s maintained by Material-UI and could be a better option to consider
Comparison
Candidate stats
*- for the past month
Notes
The text was updated successfully, but these errors were encountered: