Skip to content

SMenu <s-menu> ​

ts
import { SMenu } from 'polaris-vue-elements'

Example ​

ActionsEditDuplicateDelete
vue
<script setup>
import { SButton, SMenu, SSection } from 'polaris-vue-elements'
</script>

<template>
  <!-- SMenu only accepts Button and Section elements in its default slot; it's
       activated the same way as SPopover, via commandFor/command on a trigger. -->
  <SButton commandFor="example-menu" command="--toggle">Actions</SButton>

  <SMenu id="example-menu" accessibilityLabel="Actions menu">
    <SSection heading="Manage">
      <SButton variant="tertiary">Edit</SButton>
      <SButton variant="tertiary">Duplicate</SButton>
    </SSection>
    <SSection heading="Danger zone">
      <SButton variant="tertiary" tone="critical">Delete</SButton>
    </SSection>
  </SMenu>
</template>

Props ​

PropTypeDescription
accessibilityLabelstringA label that describes the purpose or content of the component for assistive technologies like screen readers. Use this to provide additional context when the visible content alone doesn't clearly convey the component's purpose.
idstringA unique identifier for the element.

Slots ​

SlotDescription
defaultThe items displayed within the menu. Only accepts button and section components. Use button for individual menu actions and section to group related items.

Released under the MIT License.