Skip to Content
BBRICKSv0.7.4
BlocksSettings

SettingsSection

A Settings card: a tone icon and the section's title, its rules as labelled rows (two columns), and either a way to the screen that uses them ("Open payouts →", the whole card clicks through, the button is the keyboard way) or "🔒 View only". editable is the owner's card: controls in its rows, the head button only.

import { SettingsSection } from '@ergasti/bricks';

Examples

Read-only settings

A titled card of label and value rows with an optional link-style action (a section the brand can read but the platform manages).

Code
import { SettingsSection } from '@ergasti/bricks';

function Sections() {
  return (
    <div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
      <SettingsSection title="Program access" tone="lime" rows={[{ label: 'Who can join', value: 'By application, approved by TRNDR' }, { label: 'Creator coupons', value: 'Created on approval' }, { label: 'Creator limit', value: '400 seats' }]} />
      <SettingsSection title="Wallet" tone="sky" action={{ label: 'Open wallet', onClick: () => {} }} rows={[{ label: 'Low warning', value: 'At 20% of your last top-up' }, { label: 'Coupons pause', value: 'After 7 days below zero' }, { label: 'Available now', figure: 'wallet_available', value: 'EGP 43,390.00' }]} />
    </div>
  );
}

Icon, and a section with no rows yet

icon picks the section's icon (default settings); with an empty rows the card still shows its title.

Code
import { SettingsSection } from '@ergasti/bricks';

function IconAndEmpty() {
  return (
    <div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
      <SettingsSection title="Payouts" tone="butter" icon="payments" rows={[{ label: 'Payout day', value: '4th of each month', locked: true }]} />
      <SettingsSection title="Coupons" tone="rasp" icon="coupons" rows={[]} />
    </div>
  );
}

The owner's card

editable cards hold controls (KeyValueItem.control): no "🔒 View only", the card is not a click target (a click on a switch never navigates), and action is only the head button.

Code
import { useState } from 'react';
import { SettingsSection, Switch } from '@ergasti/bricks';

function Editable() {
  const [gifts, setGifts] = useState(true);
  return (
    <div style={{ maxWidth: 470 }}>
      <SettingsSection editable title="Motivation" tone="butter" icon="gift" action={{ label: 'Open payouts', onClick: () => {} }} rows={[
        { label: 'Creators can pick gifts', control: <Switch rowLabelled checked={gifts} onChange={setGifts} /> },
        { label: 'One gift per challenge', value: 'On', locked: true },
      ]} />
    </div>
  );
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key settingsSection, or with the component's own prop where it has one. A {name} is a value the component fills in.

settingsSection
KeyEnglishArabic
viewOnly🔒 View only🔒 للعرض بس
go→←

Design guidance

How the BRICKS design system uses SettingsSection. Written in docs/content/components/SettingsSection.md; the props above are read from the code, which wins where the two disagree.

A Settings card: a tone icon and the section's title, its rules as labelled tiles in two columns, and either a button to the screen that uses them ("Open payouts →") or a "View only" pill; use it for each rules group on the Settings page.

It is the v3 mock's P.settings card. In the brand dashboard every rule is managed by the TRNDR team, so the cards are read-only; a card with an action is also a mouse shortcut (the whole card clicks through and lifts on hover) while its button is the keyboard way. editable is the owner's variant: rows may hold controls and the card stops being a click target.

Anatomy

  1. Section (<section class="kit-card kit-blk-set">, labelled by its title).
  2. Head (.kit-card-h): an <h2> with a 30px tone icon chip (radius 12, glyph 18px, aria-hidden) and the title.
  3. Head end: a small outline Button "Open payouts →" (action), or a muted Pill with a lock and "View only" (no action, not editable), or nothing (editable without action).
  4. Rows: a kit KeyValue list of soft tiles (label over bold value), two columns; a row may hold a Term label, Money value, a control or a locked note.

Variants

PropValueLookUse when
tone'lime'Lime icon chipProgram access (the mock).
tone'rasp'Raspberry chipCommission & payouts.
tone'butter'Butter chipCustomer discount.
tone'sky'Sky chipWallet.
tone'lilac'Lilac chipGifts.
iconany kit IconName (default 'settings')Glyph in the chipName the section ("wallet", "gift").
action{ label, onClick }"Open payouts →" button; whole card clickable with hover liftThe rules are used on another screen.
no action—Lock + "View only" pillA read-only section with nowhere to go.
editabletrueNo pill, card not clickable, controls in rowsThe owner can change the rules.

States

StateHow
Read-only, linkedaction set: hover lifts the card 2px with a soft shadow; a click anywhere (outside buttons/links) runs action.onClick.
Read-only, view onlyno action: the "View only" pill.
Editableeditable: rows carry control (a Switch, a field); the head button only.
Locked rowKeyValueItem.locked: the value is said to be "Managed by TRNDR" in words.
FocusOnly the head button and row controls are focusable; the card itself is not.

Types

BlockTone (tone), the icon chip tint: 'lime' | 'rasp' | 'butter' | 'sky' | 'lilac'. KeyValueItem (rows): { label, value?, control?, locked?, figure?, key? } per rule.

Usage

<SettingsSection
  title="Commission & payouts"
  tone="rasp"
  action={{ label: 'Open payouts', onClick: () => navigate('/payments?tab=payouts') }}
  rows={[
    { label: <Term tip="Share of each order’s value paid to the creator">Commission rate</Term>, value: '15% of sale' },
    { label: 'Return window', value: '14 days after delivery' },
    { label: 'Payout schedule', value: '10th–20th monthly, by TRNDR' },
    { label: 'When a creator is removed', value: 'Coupon stops; earned money is still paid' },
  ]}
/>
// The Settings page: the lock banner, then a two-column grid of sections (scr-grid: the gallery page grid; use your own)
<Banner tone="info" icon="lock">
  These rules are managed by the TRNDR team. To change anything, contact your account manager. Every change appears in your Activity log.
</Banner>
<div className="scr-grid scr-grid--2">
  <SettingsSection title="Program access" tone="lime" rows={[
    { label: 'Who can join', value: 'By application, approved by TRNDR' },
    { label: 'Creator coupons', value: 'Created on approval' },
    { label: 'Order tagging', value: 'Active' },
    { label: 'Creator limit', value: '400 seats' },
  ]} />
  <SettingsSection title="Wallet" tone="sky" icon="wallet" action={{ label: 'Open wallet', onClick: openWallet }} rows={[
    { label: 'Low warning', value: 'At 20% of your last top-up' },
    { label: 'Coupons pause', value: 'After 7 days below zero' },
    { label: 'Available now', value: <Money value="43390.00" /> },
    { label: 'Last top-up', value: <Money value="250000.00" /> },
  ]} />
</div>
// The owner's card with a control in a row
<SettingsSection editable title="Motivation" tone="butter" icon="gift" rows={[
  { label: 'Creators can pick gifts', control: <Switch checked={on} onChange={setOn} label="Creators can pick gifts" /> },
  { label: 'Return window', value: '14 days after delivery' },
]} />

Where it appears

  • Brand › Settings › all five cards: Program access (lime, View only), Commission & payouts (rasp, "Open payouts"), Customer discount (butter, "Open coupons"), Wallet (sky, "Open wallet"), Gifts (lilac, "Open gift rules"). Two columns, one under 1180px.
  • Dashboard screen: Settings (gallery/screens/SettingsScreen.tsx).

Guidelines

Do

  • Keep one rules topic per card and 2–4 rows (the mock's cards hold 2 or 4).
  • Write values as full sentences of the rule ("Coupon stops; earned money is still paid").
  • Use Term on a label that needs a definition, and Money for money values.
  • Give every card with a destination an action, so the card is clickable and keyboard reachable.

Don't

  • Don't put buttons or links in rows of a clickable card (the card ignores clicks on them, but two targets confuse).
  • Don't use the same tone for two neighbouring cards.
  • Don't show "View only" on the owner's editable card (editable hides it).

RTL and Arabic

  • The head mirrors; the arrow flips ("افتح التحويلات ←"); "View only" is "للعرض بس".
  • Tiles flow right to left; Arabic values wrap within their tiles.

Tokens

Tone chips via .kit-blk-tone--* (--lime-50, --olive, --rasp-50, --butter, --butter-ink, --sky, --sky-ink, --lilac, --lilac-ink); Card and KeyValue tokens (--card, --line, --soft, --ink, --ink-3). Hover lift: a fixed 0 10px 24px rgba(20,20,20,.07) shadow.

Accessibility

  • <section aria-labelledby> its <h2>; the icon chip is aria-hidden.
  • The card click is a mouse shortcut only; the head <button> is the keyboard and screen-reader way, so nothing is lost without a pointer.
  • "View only" is said in words (the pill), not only by a lock icon.
  • Rows are a <dl> (KeyValue); controls in rows are named by the row label.

Found in the source

  • ARIA attributes set: aria-labelledby, aria-hidden.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Button · Icon · Pill · useLanguage · Switch

Source

src/blocks/settings/SettingsSection.tsx (line 48) on GitHub.

On this page