LoginLayout
The PR mock's sign-in page (.login): the ink art side (brand, headline with a lime phrase, a line, the raspberry and lime circles, a footer) beside the centred form. At most 860px wide the art side shrinks to a short band above the form and drops the circles. Fills the viewport; the page's main landmark is the form side.
import { LoginLayout } from '@ergasti/bricks';Examples
Sign-in page
LoginLayout is the two-column page (brand, headline, the card); LoginCard takes email, password and "remember me", and reports a LoginValue. This frame is contained.
Code
import { Button, LoginCard, LoginLayout } from '@ergasti/bricks';
function Page() {
return (
<LoginLayout brand={<b>TRNDR.</b>} footer="© TRNDR 2026">
<LoginCard
defaultEmail="mona@trndr.co" onSubmit={() => {}}
forgotPassword={<a className="kit-pr-link" href="#">Forgot password?</a>}
languageToggle={<Button size="sm" variant="ghost">عربي</Button>}
footnote="Brand accounts open the Brand portal. TRNDR team accounts open the PR portal."
/>
</LoginLayout>
);
}Errors and the one-time code
error shows under the form; the otp step is the code screen (OtpStep): one box per digit, paste works, resend has a countdown.
Code
import { LoginCard, OtpStep } from '@ergasti/bricks';
function Otp() {
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))' }}>
<div className="kit-card"><LoginCard onSubmit={() => {}} error="The email or password is wrong." defaultEmail="mona@trndr.co" /></div>
<div className="kit-card"><OtpStep destination="+20 10•• ••• 471" onSubmit={() => {}} onResend={() => {}} onBack={() => {}} autoSubmit={false} /></div>
</div>
);
}Inside a page that has its own main
LoginLayout draws its form side as the page's <main>. When the layout sits inside a page that already has one (a gallery, a preview, a docs frame), landmark="div" or "section" avoids a second main landmark.
Code
import { LoginCard, LoginLayout } from '@ergasti/bricks';
function Landmark() {
return (
<LoginLayout landmark="div" brand={<b>TRNDR.</b>} footer="© TRNDR 2026">
<LoginCard defaultEmail="mona@trndr.co" onSubmit={() => {}} />
</LoginLayout>
);
}Signing in, then the code step
Submit: pending turns the button into "Signing in…"; the app then moves step to otp and passes the code step's props in otp. Verifying sets the code step's own pending; a wrong code comes back as its error. brandMark, title, subtitle and defaultRemember set the card's head and the remember box.
Code
import { useState } from 'react';
import { LoginCard } from '@ergasti/bricks';
function TwoStep() {
const [step, setStep] = useState<'credentials' | 'otp'>('credentials');
const [pending, setPending] = useState(false);
const [codePending, setCodePending] = useState(false);
const [codeError, setCodeError] = useState<string | null>(null);
return (
<div className="kit-card" style={{ maxWidth: 420 }}>
<LoginCard
brandMark={<b>TRNDR.</b>} title="PR portal" subtitle="Sign in with your TRNDR team account." defaultRemember={false}
pending={pending} step={step}
onSubmit={() => { setPending(true); window.setTimeout(() => { setPending(false); setStep('otp'); }, 900); }}
otp={{
destination: '+20 10•• ••• 471', length: 4, resendAfter: 20, pending: codePending, error: codeError, autoSubmit: false,
onSubmit: () => { setCodePending(true); setCodeError(null); window.setTimeout(() => { setCodePending(false); setCodeError('That code is wrong or expired.'); }, 900); },
onResend: () => setCodeError(null), onBack: () => setStep('credentials'),
}}
/>
</div>
);
}Code step states
OtpStep alone: length digits (here 4), resendAfter seconds before Resend (here 45), pending while checking (boxes read-only, "Checking…").
Code
import { OtpStep } from '@ergasti/bricks';
function OtpPending() {
return <div className="kit-card" style={{ maxWidth: 420 }}><OtpStep destination="mona@trndr.co" length={4} resendAfter={45} pending onSubmit={() => {}} onResend={() => {}} /></div>;
}Your own headline
headline (wrap the lime words in a span) and text replace the ink side's default words.
Code
import { LoginCard, LoginLayout } from '@ergasti/bricks';
function Headline() {
return (
<LoginLayout landmark="div" brand={<b>TRNDR.</b>} headline={<>Every brand, <span>one desk</span>.</>} text="Approvals, payouts, gifts and challenges for the whole TRNDR team.">
<LoginCard onSubmit={() => {}} />
</LoginLayout>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prLoginLayout, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
headline.$$typeof | Symbol(react.element) | Symbol(react.element) |
headline.type | Symbol(react.fragment) | Symbol(react.fragment) |
headline.props.children | One place to run ,[object Object], and campaigns. | مكان واحد تدير منه ,[object Object], والحملات. |
text | Brands and the team sign in here. Your role decides what you see. | البراندات والفريق بيسجّلوا دخول من هنا. دورك هو اللي بيحدد إنت تشوف إيه. |
Design guidance
How the BRICKS design system uses LoginLayout. Written in docs/content/components/LoginLayout.md; the props above are read from the code, which wins where the two disagree.
The PR Portal's sign-in page frame: an ink art side with the brand, a headline with a lime phrase, a line and decorative circles, beside the centred form; use it as the whole sign-in page around a LoginCard.
LoginLayout is the PR mock's .login page. It fills the viewport, sets the page's direction and language, and gives the form side the main landmark. Brands and the TRNDR team both sign in here ("Your role decides what you see"). At 860px and below the art side shrinks to a short band above the form and drops the circles. Since 0.5.0 it also sets the page font (Inter, or Cairo in Arabic, 14px), so a sign-in page outside AppShell no longer falls back to serif.
Anatomy
- Page:
<div class="kit-pr-loginpage" dir lang>, a two-column grid (1.05fr / 1fr), at least 100vh (100dvh),--bg. - Art side: ink background, 48px padding, content spaced between top and bottom:
- Brand (optional): the app's mark and name.
- Headline: 40px / 800 display, max 460px; a
<span>inside turns lime ("brands, creators"). - Text: a 64% inverted-ink line, max 420px.
- Circles: a 360px raspberry circle off the bottom end corner and a 90px lime one (decorative).
- Footer (optional): "© TRNDR 2026", 46% inverted ink.
- Form side:
<main>(orlandmark), centred, 40px padding; its child is at most 380px wide.
Variants
| Prop | Value | Effect | When to use |
|---|---|---|---|
landmark | main (default) | Form side is the page's main landmark | The real sign-in page |
div / section | No landmark | Inside a page that already has <main> (gallery, preview, docs) | |
headline / text | node | Replace the default words | Product-specific sign-in pages |
States
| State | Trigger |
|---|---|
| Wide | > 860px: two columns |
| Narrow | ≤ 860px: art band (22px 20px padding, 24px headline) above the form, no circles |
| Arabic | language="ar": dir="rtl", circles move to the other corner, Cairo |
Types
Words: provider labels.prLoginLayout (headline, text).
Usage
import { LoginLayout, LoginCard } from '@ergasti/bricks';
<LoginLayout brand={<TrndrMark />} footer="© TRNDR 2026">
<LoginCard onSubmit={signIn} pending={signingIn} error={signInError} />
</LoginLayout>// The full sign-in route: language switch, forgot link, footnote, and the code step
<BricksProvider preset={trndrPreset} language={lang}>
<LoginLayout brand={<TrndrMark />} footer="© TRNDR 2026">
<LoginCard
onSubmit={signIn}
pending={signingIn}
error={signInError}
step={needsCode ? 'otp' : 'credentials'}
otp={{ destination: '+20 10•• ••• 471', onSubmit: verifyCode, onResend: resendCode, onBack: () => setNeedsCode(false) }}
forgotPassword={<a className="kit-pr-link" href="/reset">Forgot password?</a>}
languageToggle={<Button size="sm" variant="ghost" onClick={toggleLang}>عربي</Button>}
footnote="Brand accounts open the Brand portal. TRNDR team accounts open the PR Portal."
/>
</LoginLayout>
</BricksProvider>// Inside a docs page that already has a <main>
<LoginLayout landmark="div" headline={<>Run every brand's <span>challenges</span></>} text="Approvals, payouts and messages in one place.">
<LoginCard onSubmit={() => {}} />
</LoginLayout>Inside a page that has its own main. LoginLayout draws its form side as the page's <main>. When the layout sits inside a page that already has one (a gallery, a preview, a docs frame), landmark="div" or "section" avoids a second main landmark. (docs example Landmark)
import { Button, LoginCard, LoginLayout, OtpStep } from '@ergasti/bricks';
export function Landmark() {
return (
<LoginLayout landmark="div" brand={<b>TRNDR.</b>} footer="© TRNDR 2026">
<LoginCard defaultEmail="mona@trndr.co" onSubmit={() => {}} />
</LoginLayout>
);
}Where it appears
- PR Portal › Login (
P.login): the whole page. - Dashboard screen: PrLogin.
Guidelines
Do
- Wrap exactly one phrase of the headline in a
<span>for the lime accent. - Keep the text to one sentence about who signs in here.
- Use
landmark="div"whenever the layout is not the page itself.
Don't
- Don't put form fields on the art side.
- Don't nest it inside
AppShell: it is its own full page. - Don't use the art side for marketing copy longer than two lines.
RTL and Arabic
The grid mirrors (art side on the right), the circles use inline-end offsets. Arabic default headline: "مكان واحد تدير منه البراندات وصنّاع المحتوى والحملات."; text: "البراندات والفريق بيسجّلوا دخول من هنا. دورك هو اللي بيحدد إنت تشوف إيه.". Cairo is set as the page font.
Tokens
--bg, --ink, --color-text-inverted, --lime, --rasp, --font-family-display, --font-family-sans.
Accessibility
- The form side is the
mainlandmark by default; the circles arearia-hidden. - The page gets
langanddirfrom the language, so screen readers switch voice for Arabic. - Headline and text are plain paragraphs (the card's
h1is the page heading). - Text on ink uses the inverted colour at 64% and 46% mixes; keep extra copy at those levels or brighter.
Found in the source
- ARIA attributes set:
aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
LoginCard: the form that goes inside.OtpStep: the one-time code step (inside LoginCard withstep="otp").AppShell: the signed-in frame.
See also: useLanguage · Button
Source
src/pr/login/LoginLayout.tsx (line 51) on GitHub.