Select Component revolutionizes the way users interact with dropdown menus, blending intuitive design with advanced usability, offers a seamless, user-friendly selection process.
Anatomy
Select Component features a prefix icon for visual representation, a label for context, and a placeholder for hints within the select input, which serves as the trigger for the dropdown list. The component also includes a collapse icon to expand or collapse the select box, where the options are displayed.
Properties
The Plus UI Select Component is designed with various properties to enhance its functionality and adaptability across different UI requirements. These properties are categorized into states, status, size and required each affecting how the select component looks and behaves in different scenarios.
States
Default select component is the initial state with no interaction.
Hovered select component is a change appearance when a user hovers over it with a mouse.
Pressed select component shows feedback when the user clicks or taps on the component.
Filled select component indicates an option has been selected.
Filled hovered select component reflects a hovered state when the component already has a selection.
Read-only select component is visible but not interactive; users can view the selection but not change it.
Disabled select component is completely non-interactive, typically grayed out to indicate it is not available for action.
<!-- Empty Select --><plus-selectlabel="Select an Option"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Empty state --><!-- Filled Select --><plus-selectlabel="Select an Option"placeholder="Select an option"value="Option 2"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select><!-- Readonly Select --><plus-selectlabel="Select an Option"placeholder="Select an option"readonly> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select><!-- Disabled Select --><plus-selectlabel="Select an Option"placeholder="Select an option"disabled> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
<template><!-- Empty Select --> <plus-selectlabel="Select an Option"placeholder="Select an option" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select> <!-- Empty state --><!-- Filled Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"value="Option 2" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select><!-- Readonly Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"readonly > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select><!-- Disabled Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"disabled > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select></template>
<!-- Empty Select --><plus-selectlabel="Select an Option"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Empty state --><!-- Filled Select --><plus-selectlabel="Select an Option"placeholder="Select an option"value="Option 2" <!-- Pre-selectedoption-->> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select><!-- Readonly Select --><plus-selectlabel="Select an Option"placeholder="Select an option"readonly <!-- Read-onlystate-->> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select><!-- Disabled Select --><plus-selectlabel="Select an Option"placeholder="Select an option"disabled <!-- Disabledstate-->> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
Status
Default status select component is the standard look without any validation status.
Error status select component highlights the component with colors or icons to indicate a problem with the selection, typically used for form validation.
import React from'react';import { PlusSelect, PlusSelectOption, PlusSelectOptions } from'@plusui/react';// Default Status SelectconstDefaultStatusSelect= () => ( <PlusSelectlabel="Select an Option"placeholder="Select an option"caption="This is a default select" > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect> {/* Default status */});// Error Status SelectconstErrorStatusSelect= () => ( <PlusSelectlabel="Select an Option"placeholder="Select an option"caption="This select has an error"error {/* Error status */} > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect>);exportdefault { DefaultStatusSelect, ErrorStatusSelect,};
<!-- Default Status Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This is a default select"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Default status --><!-- Error Status Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This select has an error"error> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
<template><!-- Default Status Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"caption="This is a default select" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select> <!-- Default status --><!-- Error Status Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"caption="This select has an error"error > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select></template>
<!-- Default Status Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This is a default select"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Default status --><!-- Error Status Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This select has an error"error> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
Size
Small Select Component is for limited space or minimalistic layouts.
Medium Select Component is the standard size, balancing visibility and space efficiency.
Large Select Component provides larger click areas and more visual prominence, suitable for primary interactions.
import React from'react';import { PlusSelect, PlusSelectOption, PlusSelectOptions } from'@plusui/react';// Small Size SelectconstSmallSizeSelect= () => ( <PlusSelectsize="sm"label="Select (Small)"placeholder="Select an option" > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect> {/* Small size */});// Medium Size SelectconstMediumSizeSelect= () => ( <PlusSelectsize="md"label="Select (Medium)"placeholder="Select an option" > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect> {/* Medium size */});// Large Size SelectconstLargeSizeSelect= () => ( <PlusSelectsize="lg"label="Select (Large)"placeholder="Select an option" > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect> {/* Large size */});exportdefault { SmallSizeSelect, MediumSizeSelect, LargeSizeSelect,};
<!-- Small Size Select --><plus-selectsize="sm"label="Select (Small)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Small size --><!-- Medium Size Select --><plus-selectsize="md"label="Select (Medium)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Medium size --><!-- Large Size Select --><plus-selectsize="lg"label="Select (Large)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Large size -->
<template><!-- Small Size Select --> <plus-selectsize="sm"label="Select (Small)"placeholder="Select an option" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select> <!-- Small size --><!-- Medium Size Select --> <plus-selectsize="md"label="Select (Medium)"placeholder="Select an option" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select> <!-- Medium size --><!-- Large Size Select --> <plus-selectsize="lg"label="Select (Large)"placeholder="Select an option" > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select> <!-- Large size --></template>
<!-- Small Size Select --><plus-selectsize="sm"label="Select (Small)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Small size --><!-- Medium Size Select --><plus-selectsize="md"label="Select (Medium)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Medium size --><!-- Large Size Select --><plus-selectsize="lg"label="Select (Large)"placeholder="Select an option"> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select> <!-- Large size -->
Required
The Required property makes a selection mandatory in the Plus UI Select Component, preventing form submission until an option is chosen. Essential for forms needing specific user input, it ensures no selection is missed, often highlighted with visual indicators for users.
import React from'react';import { PlusSelect, PlusSelectOption, PlusSelectOptions } from'@plusui/react';// Required SelectconstRequiredSelect= () => ( <PlusSelectlabel="Select an Option"placeholder="Select an option"caption="This field is required"required {/* Required state */} > <PlusSelectOptions> <PlusSelectOption>Option 1</PlusSelectOption> <PlusSelectOption>Option 2</PlusSelectOption> <PlusSelectOption>Option 3</PlusSelectOption> </PlusSelectOptions> </PlusSelect>);exportdefault RequiredSelect;
<!-- Required Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This field is required"required> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
<template><!-- Required Select --> <plus-selectlabel="Select an Option"placeholder="Select an option"caption="This field is required"required > <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options> </plus-select></template>
<!-- Required Select --><plus-selectlabel="Select an Option"placeholder="Select an option"caption="This field is required"required> <plus-select-options> <plus-select-option>Option 1</plus-select-option> <plus-select-option>Option 2</plus-select-option> <plus-select-option>Option 3</plus-select-option> </plus-select-options></plus-select>
Layout & Spacing
Layout and spacing within the Select Component are crafted to ensure optimal readability and ease of interaction. Adequate spacing between options prevents accidental selections, while the layout is designed to be responsive, adapting to different screen sizes and resolutions. The dropdown's width automatically adjusts to the content size or can be manually set, providing flexibility in various design contexts.
Light & Dark Mode
It seamlessly supports both light and dark modes, ensuring consistency with your application’s theme. The component automatically detects the system preference or can be toggled manually, adjusting its color scheme to provide the best visibility and reduce eye strain in any lighting condition.
Accessibility
Accessibility is a cornerstone of the Plus UI Select Component's design, ensuring that everyone, including users with disabilities, can navigate and interact with it efficiently. It adheres to WCAG guidelines, featuring keyboard navigation, screen reader support, and ARIA attributes. These features make the component not only compliant with accessibility standards but also inclusive, offering a user-friendly experience for all users.