# MenuGroup
A labeled group for related items inside a `MenuList`.
## Usage
Use inside `MenuList`, grouping `MenuItem`s.
```svelte
```
## Anatomy
The `class` attribute values represent part names. Other attributes represent their corresponding props.
```svelte
` via rest props; `class` is merged onto the root.
## Styling
To learn more, see [Styling](/docs/styling).
### Variant Management
No automatic switching.
### Default Class Name
`svs-menu-group`
## Behavior
When embedded in `MenuList`, `variant` defaults to the menu's and `styling` falls back to it; local `styling` wins.
## Accessibility
### ARIA Roles and Attributes
The component applies these automatically:
- Group (`whole` `
`): `role="group"` and `aria-labelledby` pointing to the rendered label part.
Provide the required `label` prop for the group's accessible name; the component renders it and wires it with `aria-labelledby`.
## Exports
### Types
```ts
interface MenuGroupProps extends Omit
, "children" | "role"> {
children: Snippet<[string]>; // Snippet<[variant]>; grouped MenuItems
label: string | Snippet<[string]>; // required accessible name, rendered and referenced by aria-labelledby
attach?: Attachment;
element?: HTMLDivElement; // bindable
styling?: SVSClass;
variant?: SVSVariant; // (VARIANT.NEUTRAL)
// other HTMLAttributes are passed to via ...rest; `class` is merged onto root
// role and aria-labelledby are component-owned
}
type MenuGroupReqdProps = "children" | "label";
type MenuGroupBindProps = "element";
```
### Others
No additional exports are available.
## Examples
The example code uses Tailwind CSS along with `SVSClass`.
### Basic
**Code**
```svelte src=MenuGroupBasic.svelte
```
### With Interactive Variant
**Code**
```svelte src=MenuGroupPract.svelte
```