Skip to content
kerfjsGitHub

PasskeyButton

Signs in with a passkey. A cancelled system sheet shows nothing.

SourcePackage @kerf-js/veneer

Preview

tsx
import { state } from '@kerf-js/core'import {  PasskeyButton,  Stack,  Text} from '@kerf-js/veneer'export function SignIn() {  const done = state(false)  const signIn = async () => {    await wait(900)    done.value = true  }  return (    <Stack      gap="related"      align="center"    >      <PasskeyButton onPasskey={signIn} />      <Text subtle>        {done.value          ? 'Passkey accepted.'          : passkeyDescription}      </Text>    </Stack>  )}const wait = (ms: number) =>  new Promise((done) => {    setTimeout(done, ms)  })const passkeyDescription =  'WebAuthn is yours to run. This one is a stub.'

Installation

npm install @kerf-js/veneer

Usage

tsx
import { PasskeyButton } from '@kerf-js/veneer'

Accessibility

  • This has no shortcuts of its own: controls inside it use Tab, Enter and Space as usual, and veneer's parts keep their roles and labels.

API Reference

PropTypeDefaultDescription
childrenunknown—What it contains.
EventTypeDefaultDescription
onPasskey(() => unknown)—Run WebAuthn here.
onError((e: unknown) => void)—Called on a failure that is not a cancel.

RelatedSign inSso buttons