← All Components
<mth-passkey-prompt>
WebAuthn passkey registration and sign-in prompt with PublicKeyCredential feature detection and fallback trigger.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-passkey-prompt>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/auth/passkey-prompt"></script>
<mth-passkey-prompt mode="signin" status="idle"></mth-passkey-prompt>import '@methane-ui/auth/passkey-prompt';
import '@methane-ui/react';
export function Example() {
return <mth-passkey-prompt mode="signin" status="idle"></mth-passkey-prompt>;
}<script setup lang="ts">
import '@methane-ui/auth/passkey-prompt';
</script>
<template>
<mth-passkey-prompt mode="signin" status="idle"></mth-passkey-prompt>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/auth/passkey-prompt';
import { MthPasskeyPromptDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthPasskeyPromptDirective],
template: `<mth-passkey-prompt mode="signin" status="idle"></mth-passkey-prompt>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/auth/passkey-prompt';
import MthPasskeyPrompt from '@methane-ui/svelte/MthPasskeyPrompt.svelte';
</script>
<MthPasskeyPrompt mode="signin" status="idle"></MthPasskeyPrompt>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
mode | mode | 'signin' | 'register' | "signin" | Whether authenticating with an existing passkey or enrolling a new one. |
status | status | 'idle' | 'pending' | 'success' | 'error' | 'unsupported' | "idle" | Current WebAuthn prompt lifecycle state. |
username | username | string | "" | Optional user identifier associated with the passkey prompt. |
error | error | string | "" | Explicit failure message displayed to the user. |
disabled | disabled | boolean | false | Disables trigger and fallback controls. |
conditional | conditional | boolean | true | Whether to check WebAuthn conditional mediation support. |
allowFallback | allow-fallback | boolean | true | Displays the alternate authentication method button. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-passkey-auth | { mode: string; username: string; conditionalSupported: boolean } | Emitted when the user initiates WebAuthn passkey verification or registration. |
mth-fallback | { mode: string; reason: string } | Emitted when the user selects another sign-in method. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="host". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled). | Conformance suite |
| i18n | Routes 12 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |