Skip to main content
Hanko Elements Login Component Guide:About Hanko:Hanko is a modern open source authentication solution and the fastest way you integrate passkeys, 2FA, SSO, and more—with full control over your data. Move between self-hosted and Hanko Cloud anytime. No lock-in. Just Auth how it should be: secure, user friendly, and fully yours.What This Guide Covers: This guide demonstrates how to implement the <hanko-login> web component, which provides a dedicated login interface for existing users. You’ll learn how to integrate this component for applications that require separate login and registration flows or controlled-access scenarios.Key Technologies:
  • Hanko Elements
  • Web Components
  • JavaScript/TypeScript
  • React, Vue, Svelte
  • Next.js, Nuxt, SvelteKit
  • Passkeys
  • OAuth SSO
  • 2FA authentication
  • Session management
Prerequisites:
  • Basic knowledge of frontend development, HTML/JavaScript, your chosen framework
  • Active Hanko account with API access
Tasks You’ll Complete:
  • Install and register the Hanko Elements package
  • Configure the <hanko-login> component for login-only flows
  • Implement the component across different frameworks (React, Vue, Svelte)
  • Set up event handlers for successful login events
  • Configure component attributes for prefilled values and language settings
  • Handle authentication state changes and navigation

Use case

The <hanko-login> component is designed for dedicated login interfaces and intentionally excludes registration functionality, unlike <hanko-auth>. This makes it ideal for controlled-access applications such as enterprise systems, internal tools, or invitation-based platforms where user registration needs to be restricted. If you want to Combine Login and Register on the same page:
try out the<hanko-auth> component.
If you want to create a dedicated Registration page:
try out the <hanko-registration> component .

Features

Usage

Markup

Attributes

Adding <hanko-login> component

The following examples show how to integrate the <hanko-login> component in different full-stack and frontend frameworks.

Full stack

components/HankoLogin.tsx

Frontend

components/HankoLogin.tsx
You should see an interface similar to this 👇
sign-up
For more detailed instructions on integrating <hanko-login> component with your favorite frameworks, navigate to quickstart guides.