All components

Select

Choose one predefined value.

Examples

Choose one predefined value

React code
import { Label, Select } from "@accelerate/react/components";

export function Example() {
  return (
    <>
      <Label htmlFor="status-filter">Status</Label>
      <Select id="status-filter" name="status">
        <option value="open">Open</option>
        <option value="review">In review</option>
        <option value="closed">Closed</option>
      </Select>
    </>
  );
}
Angular code
import { Component } from "@angular/core";
import { AccLabel, AccSelect } from "@accelerate/angular/components";

@Component({
  selector: "app-example",
  imports: [
    AccLabel,
    AccSelect,
  ],
  template: `
    <label accLabel for="status-filter">Status</label>
    <select accSelect id="status-filter" name="status">
      <option value="open">Open</option>
      <option value="review">In review</option>
      <option value="closed">Closed</option>
    </select>
  `,
})
export class Example {}

Installation

Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.

React
@accelerate/ui@0.4.0 and @accelerate/react@0.4.0
Angular
@accelerate/ui@0.4.0 and @accelerate/angular@0.2.0

Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.

Usage

Theme-styled pick list with platform keyboard, labels and form behavior. Browsers that support customizable select also style the options popup. Use Combobox for text filtering.

Import the React component Select from @accelerate/react/components. For Angular, add AccSelect to the standalone component’s imports and use <select accSelect>.

Examples use these React parts: Label, Select. The Angular examples show the corresponding directives and template hosts.

API reference

option
Supply values matching your data model.
Native behavior
Uses platform form semantics. Supported browsers apply customizable picker styles.