Login
Headless auth screens for Vue 3. They emit submit / social and never fetch — sessions, CSRF tokens, OAuth SDKs, and lockout copy stay in the app. Docs demos set :framed="false" so the cover shell does not steal the layout; apps use the default framed glass card.
VdLogin
VD
Sign in
or
VdSignUp
Create an account
VdForgotPassword
Reset password
OTP + checkbox
VdOtpInput paste-fills digits and marks the first cell autocomplete="one-time-code". VdCheckbox is the boolean control (remember-me / terms); use VdCheckboxGroup for named sets.
Value: ∅
Usage
<script setup lang="ts">
import { VdLogin } from "@vanduo-oss/vd3";
const onSubmit = ({ identifier, password, remember }) => {
// App-owned: fetch, CSRF, session. The kit never calls the network.
};
</script>
<template>
<VdLogin
avatar-initials="VD"
:providers="[{ id: 'github', label: 'GitHub', icon: 'github-logo' }]"
@submit="onSubmit"
@social="(id) => signInWith(id)"
>
<template #extra>
<input type="hidden" name="_csrf" value="app-token" />
</template>
<template #links>
<a href="/forgot">Forgot password?</a>
<a href="/signup">Create an account</a>
</template>
</VdLogin>
</template>VdLogin API
| Prop / slot / event | Description |
|---|---|
:identifierType | 'email' | 'text' (default 'email'). Sets type + autocomplete. |
:identifierLabel / :passwordLabel / :submitLabel / :rememberLabel | Visible field copy. |
:remember | Show the remember-me VdCheckbox (default true). |
:loading | Submit button loading spinner. |
:error / :message | Parent-provided copy rendered with VdAlert (danger / success). |
:providers | { id, label, icon? }[] — ghost buttons that emit social with id. |
:title / :glass / :elevated / :framed | Forwarded to VdAuthCard (slots #brand, #title, #alert, default, #footer). Docs demos set framed false. |
:avatarSrc / :avatarInitials | Optional VdAvatar in the brand slot (display only). |
#extra / #links / #brand | Hidden CSRF (inside the form), footer links, brand override. |
@submit | { identifier, password, remember } — no network I/O. |
@social | Provider id string. Does not submit the form. |
VdSignUp API
| Prop / slot / event | Description |
|---|---|
:nameLabel / :emailLabel / :passwordLabel / :confirmLabel / :termsLabel / :submitLabel | Visible copy. |
:requireTerms | Block submit until the terms VdCheckbox is checked (default true). |
:loading / :error / :message / :title / :glass / :elevated / :framed | Same as VdLogin. |
:avatarSrc / :avatarInitials | Display-only VdAvatar in the brand slot. |
#extra / #links / #brand | Same slot contract as VdLogin. |
@submit | { name, email, password, terms }. Suppressed when confirm does not match (useValidate match message). |
VdForgotPassword API
| Prop / slot / event | Description |
|---|---|
:emailLabel / :submitLabel | Visible copy. |
:loading / :error / :message / :title / :glass / :elevated / :framed | Same shell as VdLogin. |
#extra / #links / #brand | Same slot contract as VdLogin. |
@submit | { email }. |
VdOtpInput API
| Prop | Description |
|---|---|
v-model (modelValue) | Joined digit string. |
:length | Cell count (default 6). |
:disabled / :name / :id / :labelledBy | Forwarded; autocomplete=one-time-code on the first cell. |
VdCheckbox API
| Prop | Description |
|---|---|
v-model (modelValue) | Boolean checked state. |
:label | Associated label (or the default slot). |
:size | 'sm' | 'md' | 'lg' (default 'md'). |
:disabled / :name / :id | Forwarded to the native checkbox. |
VdAuthCard API
| Prop / slot | Description |
|---|---|
:title | string (default "") — heading text rendered in .vd-auth-heading when #title is not overridden. |
:glass | boolean (default true) — enables frosted glass card treatment when framed. |
:elevated | boolean (default true) — enables elevated card shadow when framed. |
:framed | boolean (default true) — wraps the card in VdCover + VdCenter (max="fib-377"). When false, renders a bare VdStack for embedding inside existing containers. |
#brand | Optional brand/avatar header slot (.vd-auth-brand). |
#title | Optional custom title slot (.vd-auth-title); overrides :title. |
#alert | Optional alert banner slot (.vd-auth-alert) above the form. |
default | Main authentication form or body content. |
#footer | Optional footer links/actions slot (.vd-auth-footer). |
Accessibility
- All form inputs bind explicit
<label>elements, appropriateautocompletetokens (username,email,current-password,new-password), andaria-invalid/aria-describedbyvalidation states viauseValidate. - Error and status banners render inside
VdAlertwithrole="alert"so assistive technologies announce authentication failures immediately. VdOtpInputrenders arole="group"with per-digitaria-label="Digit {i} of {length}",inputmode="numeric",autocomplete="one-time-code"on the first cell, arrow key navigation, and multi-digit paste distribution.