alouette
Version:
A modern, customizable design system built on top of NativeWind v5 with configurable defaults
49 lines • 1.93 kB
TypeScript
import { type ReactNode, type Ref } from "react";
import type { View as RNView } from "react-native";
import type { Accent } from "../../core/AlouetteConfig";
import { type PopoverProps } from "../containers/Popover";
export interface MenuTriggerParams {
ref: Ref<RNView>;
onPress: () => void;
"aria-haspopup": "menu";
"aria-expanded": boolean;
}
export interface MenuProps {
/** Renders the pressable that opens the menu; spread the params onto it. */
render: (params: MenuTriggerParams) => ReactNode;
/** Names the menu for assistive tech. */
label: string;
/**
* Rendered above the items, outside the `menu` element — an identity row, a
* section title. A menu owns menu items only, so a loose text node inside it
* is announced as one.
*/
header?: ReactNode;
accent?: Accent;
/**
* Which edge of the trigger the panel lines up with — `end` (the default)
* suits a small trigger at the end of a row, `start` a full-width one.
* Anchored web only.
*/
align?: PopoverProps["align"];
/**
* `top` opens the panel above the trigger, for one pinned at the bottom of
* the viewport. Anchored web only.
*/
side?: PopoverProps["side"];
/**
* `content` (the default) sizes the panel to its items, for a trigger
* narrower than them; `anchor` makes it exactly as wide as a full-width
* trigger. Anchored web only.
*/
width?: PopoverProps["width"];
onOpenChange?: (open: boolean) => void;
children: ReactNode;
}
/**
* A pressable that opens a list of actions: anchored under its trigger on web,
* an overlay on native. Prefer it over a row of buttons for actions that are
* secondary, rare or destructive.
*/
export declare function Menu({ render, label, header, accent, align, side, width, onOpenChange, children, }: MenuProps): ReactNode;
//# sourceMappingURL=Menu.d.ts.map