---
title: "PasswordField"
description: "Password input with v-model support. Wraps the Polaris <s-password-field> web component."
canonical_url: "https://shopify.yan.ad/components/forms/password-field"
---
# PasswordField

> Password input with v-model support. Wraps the Polaris <s-password-field> web component.

## Live preview

<polaris-preview example="password-field">



</polaris-preview>

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        modelValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Bound value (use with <code>
        v-model
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Input label
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        maxLength
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Maximum character length
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        minLength
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Minimum character length
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        placeholder
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Placeholder text
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Error message
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        details
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Help text below the input
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        autocomplete
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Autocomplete attribute
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Default value (uncontrolled)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labelAccessibilityVisibility
      </code>
    </td>
    
    <td>
      <code>
        'visible' | 'exclusive'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Label visibility for assistive tech
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        readOnly
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Makes the field read-only
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        required
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Marks the field as required
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disabled
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Disables the field
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Element ID
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Form field name
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Payload
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        update:modelValue
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Emitted when value changes (v-model)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        input
      </code>
    </td>
    
    <td>
      <code>
        InputEvent
      </code>
    </td>
    
    <td>
      Native input event
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        change
      </code>
    </td>
    
    <td>
      <code>
        InputEvent
      </code>
    </td>
    
    <td>
      Native change event
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        focus
      </code>
    </td>
    
    <td>
      <code>
        InputEvent
      </code>
    </td>
    
    <td>
      Emitted on focus
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        blur
      </code>
    </td>
    
    <td>
      <code>
        InputEvent
      </code>
    </td>
    
    <td>
      Emitted on blur
    </td>
  </tr>
</tbody>
</table>

## Slots

<table>
<thead>
  <tr>
    <th>
      Slot
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      Additional content
    </td>
  </tr>
</tbody>
</table>

## Polaris Element

Renders as `<s-password-field>`. See [Polaris PasswordField docs](https://shopify.dev/docs/api/app-home/web-components/forms/password-field).


## Sitemap

See the full [sitemap](https://shopify.yan.ad/sitemap.md) for all pages.
