Pro (paid add-on)
App page templates
ProReady-made pages and parts every app needs: error pages, an onboarding wizard, team invites, usage and billing, and a complete AI chat page.
Part of Pro
This page documents part of @vjdesigns-pro/ui, the paid add-on package. Using it needs a Pro license and @vjdesigns/vjdesigns-ui 3.8.0 or later. Like the free package, it works in both modes, every brand, all 32 languages and right to left. Install it as described in Account forms.
Error pages
ErrorPage renders a full-page <main> for notFound (404), serverError (500), maintenance (503, with until), forbidden (403) or offline, with translated text and sensible actions ("Go to the home page", "Go back", "Try again" with onRetry). Override title, description or actions as needed.
<ErrorPage kind="notFound" homeHref="/" />
<ErrorPage kind="maintenance" until={new Date("2026-11-02T06:00")} />
Onboarding wizard
OnboardingWizard runs a step-by-step setup on the free Stepper, with Back, Skip (for optional steps), Continue and Finish, and "Step 2 of 4". A step's validate returns true to continue, false to stay, or a message to show. Focus moves to each new step's heading.
<OnboardingWizard
title="Set up your team"
steps={[
{ id: "team", title: "Name your team", content: <TeamNameField />,
validate: () => (name ? true : "Enter a team name.") },
{ id: "invite", title: "Invite your staff", optional: true,
content: <InviteMembersForm roles={roles} onInvite={invite} /> },
]}
onComplete={finish}
/>
Team and billing
InviteMembersForm: email addresses as checked tags, a role and a message. Return an error message fromonInviteto show it on the form.UsageMeter: arole="meter"against a plan limit ("8 of 10"), with a warning at 90% and an "Over limit" badge past it.PaymentMethodCard: "Visa ending in 4242", the expiry, a default badge and an Update button.
AI chat app
ChatApp is a complete chat page around the free Chat: a conversation list (New chat, search, grouped by date, with Rename and Delete), the open conversation, and an optional model picker. On narrow screens the list moves into a drawer.
<ChatApp
conversations={list}
activeId={id}
onSelect={open}
onNew={create}
onRename={rename}
onDelete={remove}
models={models}
model={model}
onModelChange={setModel}
>
<Chat key={id} aria-label="Assistant" messages={messages} onMessagesChange={save} onSend={sendToModel} />
</ChatApp>
Props
ErrorPage
A full-page error: not found (404), server error (500), maintenance (503), forbidden (403), or offline. The title, text, and actions are built in and translated; each can be replaced. Rendered as the page's <main>, with the title as its heading; the big status code is read as "Error 404".
<ErrorPage kind="notFound" homeHref="/" />
<ErrorPage kind="serverError" onRetry={() => location.reload()} />
<ErrorPage kind="maintenance" until={new Date("2026-11-02T06:00")} />
| Prop | Type | Default |
|---|---|---|
kindWhich error. Sets the default title, text, status code, and actions. | "notFound""serverError""maintenance""forbidden""offline" | "notFound" |
codeThe big status code. Defaults by kind (404, 500, 503, 403; none when offline). | string | null | — |
titleOverrides the translated title. | ReactNode | — |
descriptionOverrides the translated text. | ReactNode | — |
homeHrefLink for "Go to the home page". | string | "/" |
onRetryShows "Try again" (server error, offline) and calls it. | () => void | — |
onBackShows "Go back" (not found, forbidden). | () => void | history.back() |
untilMaintenance: when you expect to be back. Shown as "We expect to be back by …". | Date | string | — |
actionsReplaces the default actions. | ReactNode | — |
illustrationAn illustration above the code. Decorative. | ReactNode | — |
headingLevelLevel of the title. | 12 | 1 |
Also accepts native <main> attributes, plus className, style and ref.
OnboardingWizard
A step-by-step setup flow: a stepper beside the current step (above it on narrow screens), "Step 2 of 4", the step's heading and content, and Back, Skip (for optional steps), and Continue / Finish. Each step can check itself before moving on; an error message shows in an alert. Completed steps can be revisited from the stepper.
Accessibility: a labeled section. When the step changes, focus moves to its heading, so screen readers start at the new step; the stepper marks the current step and reads each step's status.
| Prop | Type | Default |
|---|---|---|
titleRequiredAccessible name of the wizard (and its visible heading, unless | string | — |
hideTitleHide the wizard's title visually when the page already says it. | boolean | false |
stepsRequired | readonly OnboardingStep[] | — |
activeStepThe step shown (controlled), by index. | number | — |
defaultActiveStepInitial step when uncontrolled. | number | 0 |
onActiveStepChangeCalled when the step changes. | (index: number) => void | — |
onCompleteCalled after the last step passes its check. | () => void | — |
headingLevelLevel of the wizard title; step headings use the next level. | 12345 | 2 |
Also accepts native <section> attributes, plus className, style and ref.
InviteMembersForm
Invites people to a team: email addresses as tags (Enter or a comma adds one; each is checked as you go), a role, and an optional message. The submit button counts the invites. Errors (no addresses, an invalid address, or one returned by onInvite) show on the field; success is announced and the form resets.
| Prop | Type | Default |
|---|---|---|
rolesRequiredThe roles a new member can have, in order. | readonly { value: string; label: string; }[] | — |
defaultRoleRole chosen at first. | string | the first role |
onInviteRequiredSends the invites. Return (or resolve to) an error message to show it on the form. | (invite: MemberInvite) => void | string | Promise<void | string | undefined> | — |
showMessageShow the personal message field. | boolean | true |
Also accepts native <form> attributes, plus className, style and ref.
UsageMeter
How much of a plan's limit is used: a meter (role="meter") with its label and "8 of 10". At 90% it turns to warning; past the limit to danger with an "Over limit" badge, so the state never rests on color.
| Prop | Type | Default |
|---|---|---|
labelRequiredWhat's measured ("Team members", "Storage"). | ReactNode | — |
usedRequiredAmount used. | number | — |
limitRequiredThe plan's limit. | number | — |
formatFormats | (value: number) => string | the locale's number format |
Also accepts native <div> attributes, plus className, style and ref.
PaymentMethodCard
A saved card: "Visa ending in 4242", its expiry, a default badge, and an update button.
| Prop | Type | Default |
|---|---|---|
brandRequiredCard brand ("Visa", "Mastercard"). | string | — |
last4RequiredLast four digits. | string | — |
expMonthRequiredExpiry month (1 to 12) and year. | number | — |
expYearRequired | number | — |
isDefaultMarks the default payment method. | boolean | — |
onUpdateShows an "Update" button. | () => void | — |
logoA brand logo. Decorative. | ReactNode | — |
Also accepts native <div> attributes, plus className, style and ref.
ChatApp
A full AI chat page built on Chat: a conversation list (New chat, search, grouped by date, each with Rename and Delete) beside the open chat, with an optional model picker. Below the drawer breakpoint the list moves into a drawer opened from the header.
Accessibility: the list is a navigation landmark ("Conversations"); the open conversation is marked aria-current="page"; renaming happens in a labeled field (Enter saves, Escape cancels); group names are headings.
<ChatApp conversations={list} activeId={id} onSelect={open} onNew={create} onDelete={remove}>
<Chat messages={messages} onSend={send} />
</ChatApp>
| Prop | Type | Default |
|---|---|---|
conversationsRequiredThe conversations, newest first. | readonly ChatConversation[] | — |
activeIdThe open conversation's id. | string | null | — |
onSelectRequiredCalled when a conversation is chosen. | (id: string) => void | — |
onNewRequiredCalled by "New chat". | () => void | — |
onRenameAdds "Rename" to each conversation's menu (edited in place). | (id: string, title: string) => void | — |
onDeleteAdds "Delete" to each conversation's menu. Confirm in your handler if needed. | (id: string) => void | — |
modelsModel choices for the picker in the header. | readonly { value: string; label: string; }[] | — |
modelThe chosen model. | string | — |
onModelChange | (model: string) => void | — |
childrenRequiredThe chat itself: usually a | ReactNode | — |
headingShown in the header (the conversation's title, by default). | ReactNode | — |
drawerQueryWidth at which the conversation list moves into a drawer (CSS media query). | string | "(max-width: 47.99rem)" |
Also accepts native <div> attributes, plus className, style and ref.
OnboardingStep
One step of the wizard.
| Prop | Type | Default |
|---|---|---|
idRequired | string | — |
titleRequiredStep name, shown in the stepper and as the step's heading. | string | — |
descriptionA line under the heading. | ReactNode | — |
contentRequiredThe step's form or content. | ReactNode | — |
optionalThe step can be skipped. | boolean | — |
validateChecks the step before moving on. Return true to continue, false to stay (when the content shows its own errors), or a message to show. | () => boolean | string | Promise<boolean | string> | — |
MemberInvite
What the invite form sends.
| Prop | Type | Default |
|---|---|---|
emailsRequired | string[] | — |
roleRequired | string | — |
messageRequired | string | — |
ChatConversation
One conversation in the list.
| Prop | Type | Default |
|---|---|---|
idRequired | string | — |
titleRequired | string | — |
updatedAtRequiredWhen it was last used: groups it under Today, Yesterday, Previous 7 days, or Older. | Date | string | — |