Skip to content

MenuSection

MenuSection groups rows in a Menu under an optional title. It can collapse.

Usage

Call Components.MenuSection with a scope and a table of properties:

C.MenuSection(scope, {
    Title = "Account",
    Icon = "user",
    Collapsible = true,
    Items = {
        { Text = "Profile" },
        { Text = "Sign out", Color = "error" },
    },
})

Properties

Name Type Required Default Description
Theme ThemeRef ❌ The contextual theme Theme to use for this component instead of the one from Theme.Provide.
LayoutOrder UsedAs<number> ❌ 0 Position in a parent UIListLayout or UIGridLayout.
Size UsedAs<UDim2> ❌ - Size of the component.
Visible UsedAs<boolean> ❌ true Whether the component is shown.
ZIndex UsedAs<number> ❌ - Z index of the component.
Title UsedAs<string> ❌ - Title above the group.
Icon string ❌ - Lucide icon before the title.
Items { any } ❌ - Rows of the group. See MenuButton. Use Children to compose rows yourself.
Children any ❌ - Rows and other content.
Collapsible boolean ❌ false Let the user collapse the group by pressing the title.
DefaultExpanded boolean ❌ true Whether a collapsible group starts open.
Expanded UsedAs<boolean> ❌ - Whether the group is open. Follows the state you pass.
Compact boolean ❌ true Use the 40 px rows. Set false for the taller 44 px rows.

Callbacks

Name Description
OnExpandedChanged: (boolean) -> () Runs with the new state when the group opens or closes.
OnClose: () -> () Passed to the rows so that pressing one closes the menu.

See also