Dropdown
Anchored provider-owned overlay with consumer-rendered trigger, collision-aware placement, item semantics, and dismissal lifecycle.
Dropdown owns measurement, positioning, open state, dismissal, and overlay rendering. The consumer owns the trigger's visual presentation.
Basic usage
<Dropdown
items={[
{ label: "Details", value: "details", icon: "info" },
{ label: "Delete", value: "delete", destructive: true },
]}
onSelect={(value, item) => handleAction(value, item)}
trigger={({ onPress, isOpen, disabled }) => (
<Button onPress={onPress} disabled={disabled}>
{isOpen ? "Close" : "Actions"}
</Button>
)}
/>ARCUI does not clone or inspect the returned trigger element.
Trigger contract
The render prop receives:
{
onPress: () => void;
isOpen: boolean;
disabled: boolean;
}Use those values to keep custom trigger presentation and semantics synchronized with Dropdown ownership.
| Trigger value | Meaning |
|---|---|
onPress | Toggle the provider-owned Dropdown. |
isOpen | Whether this Dropdown is currently presented by the Host. |
disabled | Mirrors the Dropdown disabled state for custom trigger semantics. |
Items
Each item requires a human-readable label and stable unique value.
{
label: "Archive",
value: "archive",
icon: "check",
disabled: false,
destructive: false,
separator: true,
}Duplicate values are an identity invariant and are rejected clearly.
onSelect is called only for an enabled item and receives both its value and the complete item object.
Color priority is:
color
-> complete darkColor + lightColor pair
-> semantic destructive/normal Dropdown tokensPlacement
bottom-start
bottom-end
top-start
top-endDefault: bottom-end.
Placement is preferred rather than absolute. ARCUI measures the trigger and available safe viewport and may flip vertically when the opposite side provides more usable space.
Scrolling and size
maxVisibleItems limits the normal number of item heights before internal scrolling. Larger accessibility text can naturally require more height per item and remains constrained by the available safe viewport.
Dismissal
Dropdown closes through its provider-owned lifecycle on enabled-item selection, trigger toggle, passive outside dismissal, availability changes, and supported platform lifecycle events.
Testing
Use testID where the public component contract exposes it so application tests can target the ARCUI-owned root without depending on visual implementation details. Component-specific stable descendants may use documented suffixes.
For provider setup and the dedicated react-native-arc-ui/testing entrypoint, see Testing.
API Reference
IDropdown
| Prop | Type | Default | Description |
|---|---|---|---|
| items | readonly TDropdownItem[] | required | — |
| onSelect | (value: string, item: TDropdownItem) => void | required | Called after an enabled item is selected. The full item is provided so consumers do not need to search their items array again when metadata is required. |
| trigger | (props: TDropdownTriggerProps) => ReactNode | required | Render prop for the trigger. ARCUI does not clone or inspect the returned element. |
| placement? | TDropdownPlacement | "bottom-end" | Preferred placement. ARCUI may flip vertically when the opposite side provides more usable viewport space. |
| maxVisibleItems? | number | — | Maximum number of normal item heights visible before scrolling. Larger accessibility text may naturally require more height per item and is still constrained by the available viewport. |
| disabled? | boolean | — | — |
| style? | StyleProp<ViewStyle> | — | Style applied to the trigger measurement wrapper. |
| testID? | string | — | — |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
TDropdownItem
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | required | Human-readable item label. |
| value | string | required | Stable item identity returned through onSelect. Values must be unique within a Dropdown. Duplicate values are rejected as an identity invariant. |
| icon? | IIcon["type"] | — | — |
| disabled? | boolean | — | — |
| destructive? | boolean | — | Uses the semantic destructive item colors. Explicit color overrides still take precedence. |
| separator? | boolean | — | Renders a separator below this item. |
| color? | string | — | Fixed label and icon color in both themes. Takes precedence over darkColor/lightColor and semantic tokens. |
| darkColor? | string | — | Theme-aware label and icon colors. Both values must be supplied for the pair to override semantic Dropdown tokens. |
| lightColor? | string | — | — |
| testID? | string | — | Optional item-level test identifier. When omitted, Dropdown derives one from its own testID and value. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
TDropdownTriggerProps
| Prop | Type | Default | Description |
|---|---|---|---|
| onPress | () => void | required | Toggles the Dropdown. The trigger owns its visual presentation while ARCUI owns measurement, positioning, open state, and dismissal. |
| isOpen | boolean | required | Whether this Dropdown is currently presented by the host. |
| disabled | boolean | required | Mirrors the Dropdown disabled state so custom triggers can expose the same interaction state visually and semantically. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
The generated table above covers ARCUI-owned public props from the source-aligned type snapshot. Native inherited surfaces remain available where the public type extends React Native props.
Motion
Dropdown open/close and floating presentation use ARCUI overlay motion; trigger/open semantics and item selection remain React/host-owned.
See Motion for the library-wide model.
Performance
Keep application semantics at normal React update cadence. ARCUI components avoid using React state as a frame-by-frame animation driver; use the component callbacks and let Reanimated own continuous visual work.
See Performance for broader guidance.
Accessibility
ARCUI uses native roles, labels, semantic accessibility state, centralized font scaling, and localizable ARCUI-owned strings where the component owns behavior text. Consumer accessibility overrides remain available when they do not conflict with component correctness.
See Accessibility for the library-wide model.
Theming
This component resolves its normal presentation from ARCUI tokens and active theme context. Prefer token configuration for system-wide design changes and component props for genuine instance-level exceptions.
Relevant token areas include:
colors.*.dropdown
sizings.dropdown
radius.dropdown
border.dropdown
dropdownAnimations
zIndexTop-level token overrides are shallow. Compose changed built-in namespaces from defaultTokens rather than relying on recursive merge behavior.
Try it live
Open the existing React Native Snack to explore Dropdown interactively.