Skip to main content
Urbicon UI

LoginPage

Pre-built login page using blocks primitives (Card, Input, Button, Alert). Fully localizable via AuthLocale, customizable via snippet overrides and slotClasses.

01 Usage

Sign in

Forgot password? Don't have an account? Create account
Mode
<script lang="ts">
  import { LoginPage } from '@urbicon-ui/auth';
  import { goto } from '$app/navigation';

  const onSuccess = () => goto('/');
  const passkeyApiPath = '/api/auth/passkey';
</script>

<LoginPage
  {onSuccess}
  {passkeyApiPath}
  rememberMe
/>

Basic

<script lang="ts">
  import { LoginPage } from '@urbicon-ui/auth';
  import { goto } from '$app/navigation';
  import { resolve } from '$app/paths';
</script>

<LoginPage onSuccess={() => goto(resolve('/'))} passkeyApiPath="/api/auth/passkey" rememberMe />

02 Accessibility

Errors announce without stealing focus

The shared error region below the heading is always in the DOM as <div aria-live="polite">, empty until something fails — a screen reader only announces changes inside a live region that already exists, so a region created together with its first error stays silent. A failed sign-in therefore reaches the reader while the caret stays in the password field.

Autofill hints on every field

Email carries type="email" with autoComplete="email", password autoComplete="current-password", and the two-factor step inputmode="numeric" with autoComplete="one-time-code". That is what lets a password manager fill the form and iOS/Android offer the code from the SMS or authenticator — for users who cannot type a 30-character password by hand this is the difference between usable and not.

Keyboard

Everything is native: Tab through the fields, Enter submits the form. The passkey button is a real <button> and is disabled while either request is in flight, so a double Enter cannot fire two logins. Labels, aria-invalid and aria-describedby come from the Input primitive rather than being wired here.

Focus is not moved between the two steps

When the password succeeds but the account has 2FA, the form is replaced by the code field and the heading changes — but nothing moves focus there. A keyboard or screen-reader user hears the new heading only if they navigate back to it. Pair the component with your own focus call if the two-step path is your primary flow.

03 API Reference

17 props
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

6 types
Name
Kind
Category
Used by
Description

05 Installation

Import

import { LoginPage } from '@urbicon-ui/auth';