Skip to main content
Urbicon UI

LoginPage

An email/password login form with optional passkey and remember-me, posting to your login endpoint. Localizable through AuthLocale; restyle it with snippet overrides or 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

Below the heading sit two regions that are always in the DOM and empty until something happens: an assertive <div role="alert"> for failures and a polite <div role="status"> for everything else. 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.

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

18 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';