PasskeyButton
Signs in with a passkey. A cancelled system sheet shows nothing.
SourcePackage @weft-js/warp
Preview
tsx
import { state } from '@weft-js/core'import { PasskeyButton, Stack, Text } from '@weft-js/warp'export function SignIn() { const done = state(false) return ( <Stack gap="related" align="center"> <PasskeyButton onPasskey={async () => { await wait(900); done.value = true }} /> <Text subtle>{done.value ? 'Passkey accepted.' : 'WebAuthn is yours to run. This one is a stub.'}</Text> </Stack> )}const wait = (ms: number) => new Promise(done => { setTimeout(done, ms) })Installation
npm install @weft-js/warpUsage
tsx
import { PasskeyButton } from '@weft-js/warp'Accessibility
- This has no shortcuts of its own: controls inside it use Tab, Enter and Space as usual, and warp's parts keep their roles and labels.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
children | unknown | — | What it contains. |
| Event | Type | Default | Description |
|---|---|---|---|
onPasskey | (() => unknown) | — | Run WebAuthn here. |
onError | ((e: unknown) => void) | — | Called on a failure that is not a cancel. |
RelatedSign inSso buttons