Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Field examples · Selects

Select with Groups Field for React

A timezone select whose options are grouped by region under headings.

Framework
UI library

A long list made scannable. The timezone Select splits its options into North America and Europe, each a group with a heading, and a FieldDescription under the trigger.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How are the timezones split into regions?

Two SelectGroups divide the list. North America holds Eastern, Central, Mountain, and Pacific. Europe holds London, Central Europe, and Eastern Europe. The region name is a SelectLabel inside the group.

What shows before a timezone is chosen?

The placeholder Select timezone shows until an item is selected. It's the placeholder on SelectValue.

Where is the helper text?

FieldDescription comes after the Select and reads Choose your local timezone. FieldLabel above the select is Timezone.

How does the Timezone label connect?

FieldLabel names the select. Its htmlFor matches the SelectTrigger's id. The group headings organize the items under that label.

Is the label beside the trigger?

No. orientation is unset, so Timezone stays above the select. max-w-md caps the field.

Can someone select a region name?

The region name is the group heading. The selectable rows are the SelectItems under it.