Pop-Up Button

A macOS pop-up button (NSPopUpButton). The two AppKit modes ship as separate components: MacPopUpButton chooses and displays one value, MacPullDownButton runs a command and does not retain a selection. Both share the trigger scale and the menu material; only their selection and command semantics differ.

pop up
pull down

Usage

vue
<script setup lang="ts">
import {
  MacPopUpButton,
  MacPopUpButtonItem,
  MacPullDownButton,
  MacPullDownButtonItem,
} from 'macvue'
import { ref } from 'vue'

const color = ref('red')
</script>

<template>
  <MacPopUpButton
    v-model="color"
    aria-label="Color"
  >
    <MacPopUpButtonItem value="red">
      Red
    </MacPopUpButtonItem>
    <MacPopUpButtonItem value="green">
      Green
    </MacPopUpButtonItem>
  </MacPopUpButton>
</template>

Use the command-oriented companion without modelling a selected value:

vue
<MacPullDownButton aria-label="Actions">
  <MacPullDownButtonItem @select="createDocument">
    New
  </MacPullDownButtonItem>
  <MacPullDownButtonItem @select="openDocument">
    Open…
  </MacPullDownButtonItem>
</MacPullDownButton>

Sizes

All five macOS control sizes; regular is the default. The matrix keeps Pop-Up and Pull-Down triggers side by side so their native menu registration can be compared at every size.

mini
small
regular
large
extraLarge

Liquid Glass

Liquid Glass is experimental and disabled by default. The open menu uses the stable CSS material until an ancestor explicitly sets data-macvue-glass="on"; data-macvue-glass="off" and reduced transparency keep the fallback.

Because the menu teleports to body by default, keep it inside the glass boundary with :teleport-to="false", or provide a portal target inside that boundary. See the Liquid Glass guide for the opt-in boundary, fallbacks and prior art.

pop up
pull down

Disabled

Disable the whole control or individual items.

Scoped themes and portals

The menu teleports to body by default. When the control lives inside a locally scoped data-macvue-appearance, accent, or glass boundary, set :teleport-to="false" to render the menu beside the trigger and preserve that inherited context. A selector can be supplied as a custom portal target.

API

MacPopUpButton Props

PropTypeDefault
modelValue (v-model)generic acceptable value
defaultValuegeneric acceptable value
open (v-model:open)boolean
defaultOpenboolean
size'extra-large' | 'large' | 'regular' | 'small' | 'mini''regular'
disabledbooleanfalse
requiredbooleanfalse
namestring
autocompletestring
bystring | ((a, b) => boolean)
dir'ltr' | 'rtl'inherited
placeholderstring''
teleportTostring | falsebody

With name set, the button participates in native form submission.

MacPopUpButton Events

EventPayload
update:modelValueselected value
update:openboolean

MacPopUpButton Slots

SlotDescription
defaultMacPopUpButtonItem children.
valueCustom trigger label; receives selectedLabel and modelValue.

MacPopUpButton Exposed

NameTypeDescription
elRef<HTMLButtonElement | null>The semantic trigger button.
focus() => voidFocuses the trigger.
blur() => voidRemoves focus from the trigger.

MacPopUpButtonItem Props

PropTypeDefault
valuegeneric acceptable value— (required)
disabledbooleanfalse
textValuestringitem text

Set textValue when the item content is not plain text. An empty-string value is reserved for clearing the selection and is not a valid item value.

MacPopUpButtonItem Slots

SlotDescription
defaultItem label; may contain custom inline content.

MacPopUpButtonItem Exposed

NameTypeDescription
elRef<HTMLElement | null>The underlying menu item element.
focus() => voidFocuses the item.
blur() => voidRemoves focus from the item.

MacPullDownButton Props

PropTypeDefault
open (v-model:open)boolean
defaultOpenboolean
size'extra-large' | 'large' | 'regular' | 'small' | 'mini''regular'
disabledbooleanfalse
dir'ltr' | 'rtl'inherited
labelstring''
teleportTostring | falsebody

MacPullDownButton Events

EventPayload
update:openboolean

MacPullDownButton Slots

SlotDescription
defaultMacPullDownButtonItem commands.
triggerReplaces label; without either, the trigger is the compact chevron-only form.

MacPullDownButton Exposed

NameTypeDescription
elRef<HTMLButtonElement | null>The semantic trigger button.
focus() => voidFocuses the trigger.
blur() => voidRemoves focus from the trigger.

MacPullDownButtonItem Props

PropTypeDefault
disabledbooleanfalse
textValuestringitem text

MacPullDownButtonItem Events

EventPayload
selectEvent — cancellable

MacPullDownButtonItem Slots

SlotDescription
defaultCommand label.

MacPullDownButtonItem Exposed

NameTypeDescription
elRef<HTMLElement | null>The underlying menu item element.
focus() => voidFocuses the item.
blur() => voidRemoves focus from the item.