MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Select

Function Select

starters/docs/src/Select.tsx:28–50  ·  view source on GitHub ↗
({
  label,
  description,
  errorMessage,
  children,
  items,
  ...props
}: SelectProps<T, M>)

Source from the content-addressed store, hash-verified

26}
27
28export function Select<T, M extends 'single' | 'multiple' = 'single'>({
29 label,
30 description,
31 errorMessage,
32 children,
33 items,
34 ...props
35}: SelectProps<T, M>) {
36 return (
37 <AriaSelect {...props}>
38 {label && <Label>{label}</Label>}
39 <Button>
40 <SelectValue />
41 <ChevronDown />
42 </Button>
43 {description && <Description>{description}</Description>}
44 <FieldError>{errorMessage}</FieldError>
45 <Popover hideArrow className="select-popover">
46 <SelectListBox items={items}>{children}</SelectListBox>
47 </Popover>
48 </AriaSelect>
49 );
50}
51
52export function SelectListBox<T>(props: ListBoxProps<T>) {
53 return <DropdownListBox {...props} />;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected