ElvixIdentityForm
Identity editor: given name (required), family name, birthdate, gender and pronouns (all optional). Saves only what changed, straight to the elvix User record.
"use client";import { ElvixIdentityForm } from "@elvix.is/sdk/react";export function ProfilePane() {return (<ElvixIdentityFormonResult={(r) => {if (!r.ok) return console.warn("identity save failed", r.error);// Saved. The SDK has already written to elvix and transitioned to// its in-frame "done" pane. This is the HOST hook: close a modal,// refresh a stale cache, toast.}}/>);}
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
initial | Partial<IdentityInput> | optional | fetched on mount | Pre-loaded identity fields (givenName, familyName, birthdate, gender, pronouns). Omit it and the SDK GETs /api/account/profile/identity itself so you don't thread server state in. |
onResult | (r: ElvixIdentityFormResult) => void | optional | none | Terminal callback. r.ok discriminates success / failure. No PII is echoed back. Fires before the in-frame done pane, so a host that navigates here wins. |
Fields
| Field | Required | Notes |
|---|---|---|
| Given name | yes | The only required field. It cannot be cleared. |
| Family name | optional | Labelled "(optional)". Clearing it clears it in elvix. |
| Birthdate | optional | Labelled "(optional)". Never exposed to hosts through useElvixAppContext(). |
| Gender | optional | Labelled "(optional)". Never exposed to hosts through useElvixAppContext(). |
| Pronouns | optional | Labelled "(optional)". Exposed as user.pronouns. |
Save enables once something changed and the form is valid. Whenever an invalid field keeps it disabled, that field's error is on screen: errors show after a field is left, or as soon as anything in the form changed. A save sends only the changed fields (a cleared field as null), then refreshes the provider, so useElvixAppContext().user.name and the identity summary update everywhere without a reload. Since SDK 0.12.
The form reads current values from elvix on mount via the per-app context (useElvixAppContext()). You don't need to pass initial props: the provider already has them. Same applies to every identity-surface component: `ElvixUsername`, `ElvixAvatar`, `ElvixRegion`.