@app-studio/components
DropdownMenu
A versatile component for displaying a list of interactive items in a popup, triggered by another element.
View component sourceImport
ts
import { DropdownMenu } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { DropdownMenu } from '@app-studio/components';
import { Text, Vertical } from 'app-studio';
import { Button, CopyIcon, EditIcon, DeleteIcon, DownloadIcon, ShareIcon } from '@app-studio/components';
export const DefaultDropdownMenu = () => {
const handleCopy = () => alert('Copy clicked');
const handleEdit = () => alert('Edit clicked');
const handleDelete = () => alert('Delete clicked');
const handleDownload = () => alert('Download clicked');
const handleShare = () => alert('Share clicked');
const items: any[] = [
{
id: 'copy',
label: 'Copy',
icon: <CopyIcon widthHeight={16} />,
onClick: handleCopy,
},
{
id: 'edit',
label: 'Edit',
icon: <EditIcon widthHeight={16} />,
onClick: handleEdit,
},
{
id: 'divider-1',
divider: true,
},
{
id: 'delete',
label: 'Delete',
icon: <DeleteIcon widthHeight={16} />,
onClick: handleDelete,
},
{
id: 'more',
label: 'More Options',
items: [
{
id: 'download',
label: 'Download',
icon: <DownloadIcon widthHeight={16} />,
onClick: handleDownload,
},
{
id: 'share',
label: 'Share',
icon: <ShareIcon widthHeight={16} />,
onClick: handleShare,
},
],
},
{
id: 'disabled',
label: 'Disabled Option',
disabled: true,
},
];
return (
<Vertical gap={20} width="100%" maxWidth={400}>
<Text marginBottom={10}>Default Dropdown Menu</Text>
<DropdownMenu trigger={<Button>Open Menu</Button>} items={items} />
</Vertical>
);
};Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
trigger Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | See the type and source declaration for this property.Source |
items Required | DropdownMenuItem[] | — | Items displayed by the component.Source |
size | Size"sm""md""lg" | — | Size preset for the component.Source |
variant | Variant"outline""default""filled" | — | Visual treatment of the component.Source |
side | Position"bottom""left""right""top" | — | See the type and source declaration for this property.Source |
align | Alignment"start""center""end" | — | See the type and source declaration for this property.Source |
defaultOpen | boolean | — | See the type and source declaration for this property.Source |
views | DropdownMenuStyles | — | Style overrides for the named internal parts.Source |
DropdownMenu.Trigger
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
DropdownMenu.Content
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
items Required | DropdownMenuItem[] | — | Items displayed by the component.Source |
side | Position | — | See the type and source declaration for this property.Source |
align | Alignment | — | See the type and source declaration for this property.Source |
views | { menu?: ViewProps; item?: ViewProps; divider?: ViewProps; icon?: ViewProps; submenuIndicator?: ViewProps; } | — | Style overrides for the named internal parts.Source |
DropdownMenu.Item
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
item Required | DropdownMenuItem | — | See the type and source declaration for this property.Source |
views | { item?: ViewProps; icon?: ViewProps; submenuIndicator?: ViewProps; } | — | Style overrides for the named internal parts.Source |
DropdownMenu.Divider
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
views | { divider?: ViewProps; } | — | Style overrides for the named internal parts.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.