Components
ElvixIdentityForm

ElvixIdentityForm

Identity editor: given name (required), family name, birthdate, gender and pronouns (all optional). Saves only what changed, straight to the elvix User record.

components/profile-pane.tsx
"use client";
import { ElvixIdentityForm } from "@elvix.is/sdk/react";
export function ProfilePane() {
return (
<ElvixIdentityForm
onResult={(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

PropTypeRequiredDefaultDescription
initialPartial<IdentityInput>optionalfetched on mountPre-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) => voidoptionalnoneTerminal 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

FieldRequiredNotes
Given nameyesThe only required field. It cannot be cleared.
Family nameoptionalLabelled "(optional)". Clearing it clears it in elvix.
BirthdateoptionalLabelled "(optional)". Never exposed to hosts through useElvixAppContext().
GenderoptionalLabelled "(optional)". Never exposed to hosts through useElvixAppContext().
PronounsoptionalLabelled "(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`.

Related