Skip to main content

AdminSettingsPanel

Implemented

Card panel for admin settings sections with a titled header, a body slot, and an optional right-aligned footer action bar.

Categoryorganisms
Sourcecomponents/organisms/AdminSettingsPanel/AdminSettingsPanel.tsx
AI HintWrap a settings form in children and put Save/Cancel controls in the footer slot; they render right-aligned in a bordered bar. One concern per panel — a settings page composes several (taxes, shipping, notifications). Layout chrome only: form state, validation and submit stay at the call site.

Card panel for admin settings sections — a titled header, a body slot for the form, and an optional right-aligned footer action bar (Save/Cancel).

AdminSettingsPanel

Organism — Admin family

Card section named by its h2 (aria-labelledby): a titled header with optional description, a padded flex-1 body slot for the settings form, and an optional footer bar where actions render right-aligned in a bordered strip. Layout chrome only — form state, validation and submit stay at the call site.

Taxes et expédition

Configuration des taux de taxe et des frais d'expédition par province.

Enregistré.

This component supports light and dark mode.

Usage

Wrap a settings form in children and put the Save/Reset/Cancel controls in the footer slot — they render right-aligned in a bordered bar; push left-only content (errors, "Saved." flashes) with className="mr-auto" on the first left item. One concern per panel — a settings page composes several.

import { AdminSettingsPanel, Button, FormFieldError } from '@epasslive/design-system'

<AdminSettingsPanel
  title={locale === 'fr' ? 'Taxes et expédition' : 'Tax & Shipping'}
  description={locale === 'fr'
    ? 'Configuration des taux de taxe et des frais d\'expédition par province.'
    : 'Tax rates and shipping costs configuration by province.'}
  locale={locale}
  footer={
    <>
      {form.error && <FormFieldError message={form.error} className="mr-auto" />}
      <Button variant="secondary" onClick={form.reset} disabled={form.saving}>
        {locale === 'fr' ? 'Réinitialiser' : 'Reset'}
      </Button>
      <Button onClick={form.save} disabled={form.saving}>
        {locale === 'fr' ? 'Enregistrer' : 'Save'}
      </Button>
    </>
  }
>
  <TaxTabs form={form} locale={locale} />
</AdminSettingsPanel>

Conventions

locale is required but currently unused in render — pass your active locale so future translated chrome lights up without a breaking change. Mirror the TaxConfigForm shape: destructive Reset before primary Save, both disabled while saving, and announced errors via FormFieldError (pushed left with mr-auto).

Accessibility

The section is named by its heading via aria-labelledby (WCAG 1.3.1 / 4.1.2 — the h2 id is derived from id). The footer is a structural <footer> element within the section; action semantics (disabled states, live error text) come from the slot content — compose FormFieldError for announced validation messages.

Props

Prop
Type
Default
Description
title*
string
—

Panel heading — rendered as the section's h2 and its accessible name.

description
string
—

Secondary line under the title (what this section configures).

footer
React.ReactNode
—

Action bar slot — renders right-aligned in a bordered footer strip.

locale*
"en" | "fr"
—

Reserved for translated chrome strings (currently unused in render).

children*
React.ReactNode
—

Panel body — the settings form (fields, tabs, toggles).

className
string
—

Class on the card section.

id
string
—

Stable id (defaults to a React useId-derived id, unique per instance).

Props

Preview

AdminSettingsPanel

Prop
Type
Required
Default
Description
title
string
Required
—

Panel heading — rendered as the section's h2 and its accessible name.

description
string
Optional
—

Secondary line under the title (what this section configures).

footer
React.ReactNode
Optional
—

Action bar slot — renders right-aligned in a bordered footer strip (Save/Reset/Cancel; push left-only status flashes with mr-auto).

locale
"en" | "fr"
Required
—

Reserved for translated chrome strings (required but currently unused in render) — pass the active locale so future chrome lights up without a breaking change.

children
React.ReactNode
Required
—

Panel body — the settings form (fields, tabs, toggles).

className
string
Optional
—

Additional classes merged onto the card <section>.

id
string
Optional
useId-derived

Stable id for the section + heading (defaults to a React useId-derived id, unique per instance).

Quick use:<AdminSettingsPanel />

Accessibility

ARIA rolesection

Type

1 rule

NASA Rule 5

title, children, locale required; description, footer, className, id optional

ARIA

1 rule

WCAG 1.3.1, 4.1.2

<section aria-labelledby> ties the h2 heading; the <footer> strip renders only when the slot is provided

Usage

Import

tsxSnippet
import { AdminSettingsPanel } from "@epasslive/design-system"

Example 1

tsxSnippet
<AdminSettingsPanel title={locale === "fr" ? "Taxes et expédition" : "Tax & Shipping"} locale={locale} footer={<Button onClick={save}>Enregistrer</Button>}><TaxTabs /></AdminSettingsPanel>

Anti-patterns

— Do not fetch data directly in organisms

— Avoid tight coupling to specific data sources

Design System v4.1.0 | ePassLive