Skip to content

Auth Card

A Neo-Brutalist authentication card featuring social login buttons, an email/password form, and a forgot password link. Includes built-in email input, social login buttons, and tab switching.

Demo

Preview

欢迎回来

登录您的账户以继续

或使用邮箱登录

还没有账户?

Installation

pnpm dlx brutx-vue@latest add auth-card

Usage

vue
<script setup>
import AuthCard from '@/components/ui/auth-card/AuthCard.vue'

function handleLogin({ email, password }) {
    console.log('Login submitted:', email, password)
}

function handleForgotPassword() {
    console.log('Forgot password clicked')
}

function handleGoogle() {
    console.log('Google auth clicked')
}

function handleGithub() {
    console.log('GitHub auth clicked')
}
</script>

<template>
    <AuthCard
        title="Welcome back"
        description="Sign in to your account to continue"
        @login-submit="handleLogin"
        @forgot-password="handleForgotPassword"
        @google-click="handleGoogle"
        @github-click="handleGithub"
    />
</template>

Data Types

ts
interface AuthCardTexts {
    welcomeBack?: string
    signInToContinue?: string
    orEmailLogin?: string
    email?: string
    password?: string
    forgotPassword?: string
    signIn?: string
    noAccount?: string
    signUp?: string
}

Props

AuthCard

PropTypeDefaultDescription
titlestringlocale: authCard.welcomeBackCard title
descriptionstringlocale: authCard.signInToContinueCard description
textsAuthCardTexts{}Custom text overrides
classstringCustom CSS class

Events

EventParametersDescription
loginSubmit{ email: string, password: string }Emitted when the login form is submitted
forgotPasswordEmitted when the forgot password link is clicked
googleClickEmitted when the Google login button is clicked
githubClickEmitted when the GitHub login button is clicked

Accessibility

  • Keyboard: Supports Tab to navigate between inputs and buttons, Enter to submit the form
  • ARIA: Uses useId() to generate unique IDs for email and password inputs, correctly associated with <label> elements
  • Focus Management: Email and password fields use v-model for two-way binding

Brute force builds.