Skip to main content
Urbicon UI
source

PushPermissionPrompt

Dismissible prompt asking the user to enable push notifications. Handles VAPID subscription and server-side registration.

01 Usage

Basic

Enable push notifications?

<script lang="ts">
  import { PushPermissionPrompt } from '@urbicon-ui/auth';
</script>

<PushPermissionPrompt vapidPublicKey="BExample...base64-encoded-vapid-public-key" />

02 Accessibility

It never interrupts

The prompt is an ordinary card in the flow, not a modal. It does not trap focus, does not steal it on mount, and both actions are real buttons — so it can be read, acted on, or ignored entirely at the point the user reaches it, rather than seizing the page the moment it appears.

Failures are announced, dismissals are not

The aria-live="polite" region inside the card is always mounted while the prompt is visible, so a rejected VAPID key, a conflicting endpoint or a rate limit is announced in place and the prompt stays open to retry. A denied browser permission is not an error and closes the prompt instead.

Focus is dropped when the card closes

Enabling or dismissing unmounts the whole card. If focus was on either button it falls back to <body> — the component does not restore it to a sensible neighbour. Where the prompt sits mid-page, move focus yourself in onDismissed / onSubscribed.

03 API Reference

11 props 1 required
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

5 types
Name
Kind
Category
Used by
Description

05 Installation

Import

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