Skip to Content
CMSSettings

CMS settings

SettingsLayout

Sectioned settings page: vertical section nav + the active section’s content. Uncontrolled by default (first section active).

General settings…
import { SettingsLayout, SettingsForm } from '@gg-software/cms'; <SettingsLayout sections={[ { key: 'general', label: 'General', content: <GeneralSettings /> }, { key: 'billing', label: 'Billing', content: <BillingSettings /> }, ]} />;
PropTypeDefaultDescription
sections*SettingsSection[]
activeKeystringcontrolled active section key
onChange((key: string) => void)
classNamestring

* required · generated from packages/cms/src/settings/SettingsLayout.tsx

SettingsForm

A grouped settings panel driven by the field schema, with dirty-state tracking: Save enables only with unsaved changes, Reset restores the baseline, and a successful save becomes the new baseline. Try editing a field:

General
<SettingsForm title="General" fields={[ { name: 'siteName', label: 'Site name', required: true }, { name: 'supportEmail', label: 'Support email', type: 'email' }, { name: 'maintenance', label: 'Maintenance mode', type: 'switch' }, ]} initialValues={settings} onSubmit={(values) => api.saveSettings(values)} />
PropTypeDefaultDescription
titleReactNodepanel title
descriptionReactNodemuted text under the title
fields*FieldDef[]field schema (see FieldDef)
initialValuesFormValuescurrent settings values
onSubmit*(values: FormValues) => void | Promise<void>save handler; may be async (button shows loading)
submitLabelstringSave changes
resettablebooleantrueshow a Reset button that restores the initial values (default true)
errorReactNode
classNamestring

* required · generated from packages/cms/src/settings/SettingsForm.tsx

ProfileForm

User profile editing: avatar (ImageUploader), name, email and an optional new-password section — validated for strength and match, included in the submitted values only when filled.

import { ProfileForm } from '@gg-software/cms'; <ProfileForm user={{ name: user.name, email: user.email, avatarUrl: user.avatarUrl }} onSubmit={async ({ name, email, password, avatar }) => { await api.updateProfile({ name, email, password }); if (avatar) await api.uploadAvatar(avatar); }} />;
PropTypeDefaultDescription
user*{ name?: string | undefined; email?: string | undefined; avatarUrl?: string | undefined; }current profile
onSubmit*(values: ProfileFormValues) => void | Promise<void>save handler; may be async
showAvatarbooleantrueshow the avatar uploader (default true)
showPasswordChangebooleantrueshow the change-password section (default true)
passwordRequirementsPasswordRequirementspassword strength rules (utils isStrongPassword)
errorReactNode
submitLabelstringSave profile
classNamestring

* required · generated from packages/cms/src/settings/ProfileForm.tsx