LoginForm
Usage
Use the MeLoginForm component to render a full login form with built-in validation, configurable labels, and customizable slots for title, description, footer, and reCAPTCHA.
<template>
<MeLoginForm
title="Sign in"
description="Enter your credentials to continue."
/>
</template>
Header
The header section includes an optional locale selector, a title, and a description. Each can be customized via props or slots.
Custom Title & Description
Use title and description props or their named slots for full control.
Don't have an account? Sign up
Need help? Click here
<template>
<MeLoginForm
title="Welcome back"
description="Please sign in to your account."
/>
</template>
Locale Select
The locale selector is hidden by default. Set showLocaleSelect to true to show it and pass a locales array (empty by default — you must populate it with the languages you want to offer). Use localePlaceholder to customize the placeholder text.
Don't have an account? Sign up
Need help? Click here
<template>
<MeLoginForm
show-locale-select
:locales="[
{ code: 'pt-BR', name: 'Português', dir: 'ltr', messages: {} },
{ code: 'en-US', name: 'English', dir: 'ltr', messages: {} }
]"
title="Sign in"
/>
</template>
Remember Me & Forgot Password
The remember me checkbox and forgot password link appear in the same row below the password field. Customize their labels and href via props.
Don't have an account? Sign up
Need help? Click here
<template>
<MeLoginForm
remember-me-label="Keep me logged in"
forgot-password-label="Reset password"
forgot-password-href="/reset"
/>
</template>
Footer
The footer displays sign up and help links. Use props to change the labels or slots for full customization.
Don't have an account? Sign up
Need help? Click here
<template>
<MeLoginForm
sign-up-href="/register"
help-href="/support"
/>
</template>
Loading State
Pass the loading prop to disable the form and show a loading indicator on the submit button.
Don't have an account? Sign up
Need help? Click here
<template>
<MeLoginForm
loading
title="Sign in"
/>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
title | 'Sign in' | string The title displayed in the form header. |
description | '' | string The description displayed below the title. |
showLocaleSelect | false | boolean Show or hide the locale selector in the header. |
localePlaceholder | 'Language' | string Placeholder text for the locale selector. |
locales | [] | MeLoginFormLocaleItem[] Array of locale objects ( code, name, dir, messages) for the locale selector. Empty by default; the user must populate it. |
rememberMeLabel | 'Remember me' | string Label for the remember me checkbox. |
forgotPasswordLabel | 'Forgot your password?' | string Label for the forgot password link. |
forgotPasswordHref | '#/forgot-password' | string URL for the forgot password link. |
signUpHref | '#/signup' | string URL for the sign up link. |
helpHref | '#/help' | string URL for the help link. |
showRecaptchaPlaceholder | true | boolean Show a placeholder when no reCAPTCHA is provided via slot. |
loading | false | boolean Disables the form and shows a loading state on the submit button. |
Slots
| Slot | Description |
|---|---|
title | Custom content for the form title. |
description | Custom content for the form description. |
recaptcha | Inject a reCAPTCHA widget (replaces the placeholder). |
footer | Replace the entire footer section. |
signup-text | Custom content for the sign up paragraph. |
help-text | Custom content for the help paragraph. |
Events
| Event | Type |
|---|---|
submit | [payload: { email: string, password: string, rememberMe?: boolean }] |
forgotPassword | [] |
signUp | [] |
help | [] |