Oros UI

Search documentation

Search Oros UI pages and components.

Autocomplete

Suggests matching options as someone types.

Installation

Install Autocomplete from Oros with shadcn CLI 4.13.0.

pnpm dlx shadcn@4.13.0 add @oros/autocomplete

Usage

import {
  Autocomplete,
  AutocompleteValue,
  AutocompleteInput,
  AutocompleteTrigger,
  AutocompleteIcon,
  AutocompleteClear,
} from "@/components/ui/autocomplete"

Open the Source tab in the preview for a complete working example.

Anatomy

ExportResponsibility
AutocompleteThe root component that owns the primary structure and state.
AutocompleteValueDisplays or exposes the current value.
AutocompleteInputCaptures or exposes the current value.
AutocompleteTriggerControls opening, selection, or disclosure behavior.
AutocompleteIconA composable part of the component anatomy.
AutocompleteClearA composable part of the component anatomy.
AutocompletePortalMoves overlay content to a stable document layer.
AutocompleteBackdropA composable part of the component anatomy.
AutocompletePositionerPositions floating content relative to its anchor.
AutocompletePopupA composable part of the component anatomy.
AutocompleteArrowA composable part of the component anatomy.
AutocompleteListA composable part of the component anatomy.
AutocompleteRowA composable part of the component anatomy.
AutocompleteItemRepresents one option or repeated child.
AutocompleteCollectionA composable part of the component anatomy.
AutocompleteGroupGroups related items into one logical set.
AutocompleteGroupLabelProvides a visible label for its related control or value.
AutocompleteSeparatorVisually and semantically separates related groups.
AutocompleteEmptyA composable part of the component anatomy.
AutocompleteStatusA composable part of the component anatomy.
AutocompletePrimitiveA composable part of the component anatomy.
useAutocompleteFilterReads or controls the component's shared state.

API Reference

Autocomplete exports 22 named entries. Component exports accept the props of their underlying HTML element or Base UI component, plus an optional className, unless the source defines a more focused type.

  • Autocomplete Component
  • AutocompleteValue Component
  • AutocompleteInput Component
  • AutocompleteTrigger Component
  • AutocompleteIcon Component
  • AutocompleteClear Component
  • AutocompletePortal Component
  • AutocompleteBackdrop Component
  • AutocompletePositioner Component
  • AutocompletePopup Component
  • AutocompleteArrow Component
  • AutocompleteList Component
  • AutocompleteRow Component
  • AutocompleteItem Component
  • AutocompleteCollection Component
  • AutocompleteGroup Component
  • AutocompleteGroupLabel Component
  • AutocompleteSeparator Component
  • AutocompleteEmpty Component
  • AutocompleteStatus Component
  • AutocompletePrimitive Component
  • useAutocompleteFilter Hook

Accessibility

  • Provide Autocomplete with a visible label or an equivalent programmatic accessible name.
  • Expose disabled, required, selected, and invalid states through the component API instead of color alone, and keep keyboard focus visible.

Source

Autocomplete is maintained by Oros and follows the same conventions as the rest of the library. Installing it adds the component source and required dependencies to your app. The Source tab above shows a complete usage example.