menu

package
v0.1.44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package menu contains Material 3 Menu components.

Reference: [Menus](https://m3.material.io/components/menus/overview) Specs: [Menus Specs](https://m3.material.io/components/menus/specs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropdownMenu(
	expanded bool,
	onDismissRequest func(),
	content api.Composable,
	options ...DropdownMenuOption,
) api.Composable

DropdownMenu Composable Uses a Popup to display content on top of other content.

func DropdownMenuItem(
	textStr string,
	onClick func(),
	options ...DropdownMenuItemOption,
) api.Composable

DropdownMenuItem Composable

Types

type Composer

type Composer = api.Composer
type DropdownMenuColors struct {
	ContainerColor graphics.Color
}

func DefaultDropdownMenuColors

func DefaultDropdownMenuColors(c Composer) DropdownMenuColors
type DropdownMenuItemColors struct {
	TextColor                 graphics.Color
	LeadingIconColor          graphics.Color
	TrailingIconColor         graphics.Color
	DisabledTextColor         graphics.Color
	DisabledLeadingIconColor  graphics.Color
	DisabledTrailingIconColor graphics.Color
}

func DefaultDropdownMenuItemColors

func DefaultDropdownMenuItemColors(c Composer) DropdownMenuItemColors
type DropdownMenuItemOption func(*DropdownMenuItemOptions)

func WithEnabled

func WithEnabled(enabled bool) DropdownMenuItemOption

func WithLeadingIcon

func WithLeadingIcon(icon api.Composable) DropdownMenuItemOption

func WithMenuItemModifier

func WithMenuItemModifier(mod ui.Modifier) DropdownMenuItemOption

func WithTrailingIcon

func WithTrailingIcon(icon api.Composable) DropdownMenuItemOption
type DropdownMenuItemOptions struct {
	Modifier     ui.Modifier
	LeadingIcon  api.Composable
	TrailingIcon api.Composable
	Enabled      bool
}

func DefaultDropdownMenuItemOptions

func DefaultDropdownMenuItemOptions() DropdownMenuItemOptions
type DropdownMenuOption func(*DropdownMenuOptions)

func WithModifier

func WithModifier(m ui.Modifier) DropdownMenuOption

func WithOffset

func WithOffset(x, y unit.Dp) DropdownMenuOption
type DropdownMenuOptions struct {
	Modifier ui.Modifier
	OffsetX  unit.Dp
	OffsetY  unit.Dp
}

func DefaultDropdownMenuOptions

func DefaultDropdownMenuOptions() DropdownMenuOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL