# Select ## Examples ### Default ```html ``` ### States ```html ``` ### Horizontal ```html ``` ### FullWidth ```html
``` ### WithLongContent ```html ``` ### WithLongContentHorizontal ```html ``` ### DescriptionState ```html ``` ### HintState ```html ``` ## Usage The Select component is commonly used in forms and settings where users must make a selection from a limited set of choices. Unlike text inputs, a select component restricts user input to predefined options, ensuring data consistency and reducing errors. **Use Select when:** - Users need to choose one option from a fixed set of choices. - The number of options is manageable (e.g., 5–15 options). - The choices do not require complex descriptions (if descriptions are necessary, consider a radio buttons). - A consistent, compact UI is required, and a radio button group would take too much space. - Users should not enter free text but instead select from a valid list. - Users should be able to refine results or content (e.g., selecting a category). **Do not use Select when:** - The number of options is very small (2–4); use radio buttons instead. - Users need to make multiple selections; use a checkboxes instead. - Options require additional descriptions or explanations; use a group of radio buttons with descriptions. - The selection should be immediately visible without clicking. ## Other Considerations - Use clear and concise label. - Use placeholder text like “Select a department” instead of a default selection unless a default is meaningful. - Keep option labels short and scannable. - Group related options for better readability (either alphabetically, by importance or by group). - Provide clear error messages when a selection is required but not made. - Preselect a default option when appropriate (e.g., "Select a department"). - Do not use vague labels like “Choose One” without context. - Avoid long option lists that require excessive scrolling. ## Design Rationale The Select component is designed to improve efficiency and clarity in forms while maintaining accessibility. A dropdown conserves space and simplifies decision-making for users, particularly when dealing with long lists.