Markdown:
Components

MenuSeparator

A non-interactive separator between groups of menu items.

Usage

Use inside MenuList.

Svelte
<MenuList>
  <MenuSeparator {...props} />
</MenuList>

Anatomy

The class attribute values represent part names. Other attributes represent their corresponding props.

Svelte
<div class="whole" {...rest} role="separator" aria-orientation={ariaOrientation}></div>

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

NameTypeDefaultDescription
ariaOrientation<enum>-ARIA-only orientation; by default inferred opposite to the containing MenuList orientation
attachAttachment-Svelte attachment on the root separator
elementHTMLDivElement-Bindable root element
stylingSVSClass-Styling override
variantSVSVariantNEUTRALSeparator variant

Other HTMLAttributes are passed to <div> via rest props; class is merged onto the root.

Styling

To learn more, see 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 <div>): role="separator" and aria-orientation.

aria-orientation defaults from the enclosing MenuList orientation, or from the ariaOrientation prop when supplied.

Exports

Types

TypeScript
interface MenuSeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "role" | "aria-orientation"> {
  ariaOrientation?: "horizontal" | "vertical"; // inferred from MenuList orientation when absent
  attach?: Attachment<HTMLDivElement>;
  element?: HTMLDivElement; // bindable
  styling?: SVSClass;
  variant?: SVSVariant; // (VARIANT.NEUTRAL)
  // other HTMLAttributes are passed to <div> 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

With Interactive Variant

Preset for Demo
Enter variant as you like