Skip to content

Latest commit

 

History

History
154 lines (82 loc) · 3.22 KB

File metadata and controls

154 lines (82 loc) · 3.22 KB

@hoststack/ui v0.2.0


@hoststack/ui / components / IMenu

Interface: IMenu

Defined in: components.ts:577

Menu component props - dropdown menu with nested options

Example

<Menu
  trigger={<Button>Menu</Button>}
  options={[
    { label: "Edit", value: "edit", icon: <EditIcon /> },
    { label: "Delete", value: "delete", icon: <DeleteIcon /> }
  ]}
  onSelection={(value, label) => console.log(value, label)}
/>

Properties

ariaLabel?

optional ariaLabel: string

Defined in: components.ts:579

Accessible label for the menu container


children?

optional children: ReactNode | (close) => ReactNode

Defined in: components.ts:581

Additional content to render in the menu - can be ReactNode or a function that receives the close function


css?

optional css: CSS

Defined in: components.ts:583

Custom CSS styles


initial?

optional initial: string

Defined in: components.ts:585

Initially selected option value


onSelection()?

optional onSelection: (value, label) => void

Defined in: components.ts:587

Callback when menu option is selected

Parameters

value

string

label

string

Returns

void


options

options: object[]

Defined in: components.ts:589

Array of menu options

icon?

optional icon: ReactNode

iconPosition?

optional iconPosition: "left" | "right"

label

label: string

value

value: string


trigger

trigger: ReactNode

Defined in: components.ts:596

Element that triggers the menu


triggerCSS?

optional triggerCSS: CSS

Defined in: components.ts:598

Custom CSS styles for the trigger


wrapperCSS?

optional wrapperCSS: CSS

Defined in: components.ts:600

Custom CSS styles for the menu wrapper


logo?

optional logo: ReactNode

Defined in: components.ts:602

Logo to display in the menu header