# MenuSeparator A non-interactive separator between groups of menu items. ## Usage Use inside `MenuList`. ```svelte ``` ## Anatomy The `class` attribute values represent part names. Other attributes represent their corresponding props. ```svelte ``` When embedded in `MenuList`, `variant` defaults to the menu's and `styling` falls back to it. `ariaOrientation` is ARIA-only: by default a vertical menu renders a horizontal separator, and a horizontal menu renders a vertical separator. ## Props | Name | Type | Default | Description | |---|---|---|---| | `ariaOrientation` | `` | - | ARIA-only orientation; by default inferred opposite to the containing `MenuList` orientation | | `attach` | `Attachment` | - | Svelte attachment on the root separator | | `element` | `HTMLDivElement` | - | Bindable root element | | `styling` | `SVSClass` | - | Styling override | | `variant` | `SVSVariant` | `NEUTRAL` | Separator variant | Other `HTMLAttributes` are passed to `
` 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-separator` ## Behavior When embedded in `MenuList`, `variant` defaults to the menu's and `styling` falls back to it. `ariaOrientation` is ARIA-only: by default a vertical menu renders a horizontal separator, and a horizontal menu renders a vertical separator. ## Accessibility ### ARIA Roles and Attributes The component applies these automatically: - Separator (`whole` `
`): `role="separator"` and `aria-orientation`. `aria-orientation` defaults from the enclosing `MenuList` orientation, or from the `ariaOrientation` prop when supplied. ## Exports ### Types ```ts interface MenuSeparatorProps extends Omit, "children" | "role" | "aria-orientation"> { ariaOrientation?: "horizontal" | "vertical"; // inferred from MenuList orientation when absent 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-orientation are component-owned } type MenuSeparatorReqdProps = never; type MenuSeparatorBindProps = "element"; ``` ### Others No additional exports are available. ## Examples The example code uses Tailwind CSS along with `SVSClass`. ### Basic **Code** ```svelte src=MenuSeparatorBasic.svelte New file Duplicate Archive Delete ``` ### With Interactive Variant **Code** ```svelte src=MenuSeparatorPract.svelte New file Duplicate Archive Delete ```