InvitationManager
Admin panel for managing invitation-gated registration. Lists invitations with status, allows sending new ones and deleting unused ones.
01 Usage
Basic
Invitations
<script lang="ts">
import { InvitationManager } from '@urbicon-ui/auth';
const roles = [
{ value: 'ADMIN', label: 'Admin' },
{ value: 'USER', label: 'User' }
];
</script>
<InvitationManager {roles} />
02 Accessibility
Every delete button names its invitation
As in PasskeyManager, each row's button carries an aria-label that appends the invitee's email to the visible
"Delete", so a reader can tell the rows apart without first navigating into them.
Deliberately no autofill on the email field
This is the one email field in the auth package without an autoComplete hint — and that is correct. You are typing
someone else's address, so offering the signed-in user's own email would be wrong every single
time.
Status is text inside a badge
Pending and registered invitations differ by the localized word in the Badge, not only by its colour. The role Select and the send-email Checkbox take real labels through their label props, so the whole
form is navigable by label.
One error region for the form and the list
Sending and deleting share the always-mounted aria-live="polite" region below the heading, so a failure
from either path is announced without focus leaving where the user was working.
03 API Reference
Prop | Type | Default | Description | |
|---|---|---|---|---|
roles required | RoleOption[] | — | Available roles for the invitation menu. | |
apiPath | string | '/api/invitations' | ApiPath property for the InvitationManager component | |
class | string | — | Extra classes on the root element. | |
csrf | CsrfClientOptions | — | CSRF cookie/header names — only needed when the server overrides the defaults via config.csrf. Mutating requests echo the token automatically. | |
fetcher | typeof globalThis.fetch | — | Custom fetch implementation for all API calls. Defaults to the global fetch. Useful for mock backends in demos/tests or custom retry/auth layers. | |
slotClasses | Partial<Record<'root' | 'title' | 'form' | 'list' | 'item' | 'error' | 'inviteLink', string>> | — | Per-slot class overrides. See component source for available slot keys. | |
t | PartialAuthLocale | — | Locale overrides, deep-merged over the active built-in bundle (resolved from the i18n context). Pass any subset — a single string or a whole tree. | |
unstyled | boolean | — | Strip all default styling. |
04 Types
Local type definitions used by this component.
Name | Kind | Category | Used by | Description | |
|---|---|---|---|---|---|
InvitationManagerProps | interface | props | 0 | — | |
PartialAuthLocale | type | helper | 1 | Consumer-facing locale input: any subset of AuthLocale. Components
accept this as their t prop and deep-merge it over the active built-in
bundle, so overriding a single string never silently blanks the rest. | |
CsrfClientOptions | interface | helper | 1 | — | |
RoleOption | interface | helper | 1 | Role option for the InvitationManager menu. | |
DeepPartial | type | helper | 0 | Recursive partial: every branch and leaf becomes optional. | |
AuthLocale | interface | helper | 0 | The complete auth locale bundle. Every key is required: the bundles this
package ships (en, de) satisfy the full shape, and consumer overrides
enter as PartialAuthLocale — deep-merged over the active built-in
bundle by mergeAuthLocale — so component markup reads keys directly,
without per-key ?? '…' fallback literals (review R19).
Placeholder convention: dynamic values use **single-brace** tokens
({n}, {name}, {email}) that the consuming component substitutes itself
via String.replace('{token}', value). There is deliberately **no**
{{…}} runtime interpolator in this package — the key-based translator twin
(authT/at) was removed in R21 — so {{…}} here would render verbatim. |
05 Installation
Import
import { InvitationManager } from '@urbicon-ui/auth';