UNPKG

@rws-aoa/react-library

Version:

RWS AOA Design System

51 lines 1.11 kB
type Action = /** * The path that the menu item links to on click */ { onClick?: never; to: string; } /** * The onClick function for situations where you don't want to navigate to another page (e.g. logout) */ | { onClick(): void; to?: never; }; export type AoaSetting = Action & { /** * Optional divider to be shown below menu item */ divider?: boolean; /** * The label of the menu item */ label: string; }; interface UserMenuProps { /** * A list of the user menu items */ readonly settings: AoaSetting[]; /** * Username to be displayed on the left of the settings menu icon */ readonly username?: string; } /** * Constructs a user menu using pre-defined Rijks styling * * @param props - Props to pass to the user menu * @example * ```jsx * <AoaUserMenu * settings={[ * { label: "Logout", onClick: () => console.log("Logout") } * ]} * /> * ``` */ export declare function AoaUserMenu(props: UserMenuProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=UserMenu.d.ts.map