Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-select

Select

Free

One option from a short closed list, for React and Tailwind CSS. Free, MIT.

Choose a period — by the pointer, by searching the list, or by the arrows and Enter — and the figures under it change; a second select sorts them by most or least recorded, or by name; in the third, search a study the list lacks and choose “Create …” to make it. Pick a look to draw both as the small field, the menu field, the pill (and its small form), the property chip or the ghost chip: each opens the same list. The figures are our own sample numbers held in the page, the same for every study; a study made lives in the page only; the chosen period and order stay as the look changes.

When to use

  • One option from a short closed list.
  • Also called: dropdown or picker.

When not to use

  • To type and search a long list, use Combobox.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Select on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/meadow-select
PROMPT
Add the Goop Select to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { SelectValueMedia, SelectValueDescription, SelectGroup } from '@/components/ui/goop/select';

import { useState } from 'react';
import {
  Select,
  SelectContent,
  SelectDescription,
  SelectIcon,
  SelectItem,
  SelectSeparator,
  SelectTrigger,
  SelectValue,
} from '@/components/ui/goop/select';
import { ShortcutKey } from '@/components/ui/goop/shortcut-key';

function SitePicker() {
  const [site, setSite] = useState('');
  return (
    <Select value={site} onValueChange={setSite} name="site">
      <SelectTrigger aria-label="Survey site">
        <SelectValue placeholder="Pick a site" />
        <SelectIcon />
      </SelectTrigger>
      <SelectContent aria-label="Survey sites" searchPlaceholder="Find a site">
        <SelectItem value="north">North meadow</SelectItem>
        <SelectItem value="ridge" keywords={['R-7']}>
          Ridge path
        </SelectItem>
        <SelectSeparator />
        <SelectItem value="marsh">
          Marsh edge
          <SelectDescription>Closed in winter</SelectDescription>
        </SelectItem>
      </SelectContent>
    </Select>
  );
}

function ReportLanguage() {
  return (
    <Select defaultValue="en-gb">
      <SelectTrigger variant="ghost" aria-label="Report language">
        <SelectValue />
        <SelectIcon />
      </SelectTrigger>
      <SelectContent aria-label="Languages" search={false}>
        <SelectItem value="en-gb">
          English (UK)
          <ShortcutKey>1</ShortcutKey>
        </SelectItem>
        <SelectItem value="nl">
          Nederlands
          <ShortcutKey>2</ShortcutKey>
        </SelectItem>
        <SelectItem value="de">
          Deutsch
          <ShortcutKey>3</ShortcutKey>
        </SelectItem>
      </SelectContent>
    </Select>
  );
}
  • Fits: account, board, flow, inbox, record, settings (their recipes).
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

  • Each option with its sentence: select--options.md
  • State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-placeholder
Parts
PartWhat it is
SelectTriggerThe closed select a person clicks to choose a value; its props: select--trigger.md
SelectValueThe chosen value's words inside the trigger, cut with an ellipsis when it is narrower; its props: select--value.md
SelectValueMediaThe chosen value's mark before its words, the caller's own (an avatar drawn its own way), in the box the trigger's look takes (14 or 16 px, the icon grey)
SelectValueDescriptionMuted words after the value, such as a note that the chosen option is the default one
SelectIconThe chevron that says the trigger opens a choice
SelectContentThe list the trigger opens; its props: select--content.md
SelectDescriptionA row's caption, a second line under its words
SelectItemOne option of the list; its props: select--item.md
SelectGroupA group of the select's options under its heading (the list's group heading)
SelectSeparatorA hairline between options, the list's full width, 3 px from the rows on either side; hidden while searching
  • Class recipes (cva): selectTriggerVariants (SelectTrigger)

SelectContent

The list the trigger opens.

TSX
import { SelectContent } from '@/components/ui/goop/select';

Options

  • noneRowLabel?: string — The words of the row that sets an optional select back to none; "No <searchLabel>", else "Clear", by default.
  • createLabel?: (words: string) => string — The words of the row offering to create the words searched for (the root's onCreate); Create “<words>”.
  • creatingLabel?: (words: string) => string — The words of the loading row while a create waits; Creating “<words>” by default.
  • searchPlaceholder?: string — The search field's placeholder words, none by default; they name the field when nothing else does.
  • hint?: ReactNode — The key hint at the search field's end (the theme's ShortcutKeys).
  • search?: boolean = true — The search field shown over the rows (the default) or, false, clipped to nothing: typing still filters.
  • searchLabel?: string — The search field's name for assistive technology; left out, the trigger's own name.
  • empty?: ReactNode — The words the list shows while no row matches, under the field; none by default.
  • Also takes: container?: HTMLElement | null

SelectItem

One option of the list.

TSX
import { SelectItem } from '@/components/ui/goop/select';

Options

  • value: string — The value it picks.
  • Also takes: onSelect?: (value: string) => void; disabled?: boolean; keywords?: string[]; submenu?: boolean = false; icon?: IconName; mark?: ReactNode; action?: ReactNode

Select: every option

TSX
import { Select } from '@/components/ui/goop/select';

Options

  • modal?: boolean = true — Whether the open list holds the focus and hides the page from assistive technology (the default).
  • optional?: boolean = false — The value may be none: the list opens with a row at its top ("No priority", SelectContent's noneRowLabel) that sets it back to '', the trigger's empty look (a chip's dashed outline).
  • onCreate?: (words: string) => string | undefined | PromiseLike<string | undefined> — Makes an option from the words a person searched for when no row matches them: the list offers them as its one row ("Create “…”", SelectContent's createLabel), and Enter or a click calls this with the words, trimmed.
  • Also takes: value?: string; defaultValue?: string; onValueChange?: (value: string) => void; open?: boolean; defaultOpen?: boolean = false; onOpenChange?: (open: boolean) => void; name?: string; required?: boolean; disabled?: boolean; form?: string
  • State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-placeholder

SelectTrigger

The closed select a person clicks to choose a value.

TSX
import { SelectTrigger } from '@/components/ui/goop/select';

Options

  • shape: field (default), pill, chip
  • size: sm, md (default), lg
  • variant: default (default), ghost, menu, filled
  • iconOnly?: boolean | 'narrow' = false — A chip as its icon alone: true always; 'narrow' while its row, which must carry the class @container/chip-row, is under 672 px.
  • Also takes: asChild?: boolean

SelectValue

The chosen value's words inside the trigger, cut with an ellipsis when it is narrower.

TSX
import { SelectValue } from '@/components/ui/goop/select';

Options

  • mark?: ReactNode — An icon drawn before the value's words whatever the value is (a property's own icon); left out, the chosen option's own mark is drawn there, so the mark always matches the value.
  • placeholderMark?: ReactNode — The icon beside the placeholder while nothing is chosen (a priority's dashed line); none by default.

Keyboard

KeyWhat it does
EnterOpen the list, the chosen row active
SpaceOpen the list, the chosen row active
ArrowDownOpen the list, the chosen row active
typingFilter the open list's rows, the first match active
ArrowDown ArrowUpMove the active row
Home EndThe first or last row active
EnterPick the active row, close, the focus back on the trigger
EscapeClose the list, the focus back on the trigger

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write your own.

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/select.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-select

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.