Secure Field

A macOS password field (NSSecureTextField). Identical to Text Field except the input is masked. Like its AppKit prototype it has no reveal-password affordance.

Usage

vue
<script setup lang="ts">
import { MacSecureField } from 'macvue'
import { ref } from 'vue'

const password = ref('')
</script>

<template>
  <MacSecureField
    v-model="password"
    aria-label="Password"
    autocomplete="current-password"
  />
</template>

Sizes

All five macOS control sizes; regular is the default.

Disabled

API

Props

PropTypeDefault
modelValue (v-model)string
defaultValuestring
size'extra-large' | 'large' | 'regular' | 'small' | 'mini''regular'
disabledbooleanfalse
placeholderstring
namestring
requiredbooleanfalse

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

Events

EventPayload
update:modelValuestring

Exposed

NameTypeDescription
elRef<HTMLInputElement | null>The underlying input element.
focus() => voidFocuses the input.
blur() => voidRemoves focus from the input.