Skip to content

Password Input

Password field with show/hide toggle. Allows users to visually verify their password before submitting.

Demo

Login

Create password

Mindst 8 tegn med bogstaver og tal

Error

Installation

vue
<script setup>
import { GTPasswordInput } from '@grundtone/vue';
</script>

Usage

Login

vue
<GTPasswordInput v-model="password" label="Adgangskode" autocomplete="current-password" required />

Create password

vue
<GTPasswordInput v-model="newPassword" label="Ny adgangskode"
  help-text="Mindst 8 tegn" autocomplete="new-password" required />

Props

PropTypeDefaultDescription
modelValuestring''v-model
labelstringLabel
helpTextstringHelp text
errorTextstringError message
size'sm'|'md'|'lg''md'Size
requiredbooleanfalseRequired
disabledbooleanfalseDisabled
autocompletestring'current-password'new-password or current-password
showLabelstring'Vis'Show button text
hideLabelstring'Skjul'Hide button text

Security

  • spellcheck="false" prevents spell-jacking
  • autocapitalize="off" prevents unwanted casing
  • Always allow copy/paste
  • Do not use maxlength — show errors instead
  • Do not reveal which field was wrong on login failure