AuthLayout
The frame of the pages outside the console: sign in, sign up, password recovery, invitations, errors. The mark on top, one task in the middle, the way to the other task under it.
import { AuthLayout, AuthLayoutSkeleton } from '@sypnia/ui/react'
Sign up, with the side panel
Wide enough, the task sits on one side and what the person gets on the other. Narrow the window: the side panel goes.
Code
import { AuthLayout, Button, EmailInput, Field, List, ListItem, Says } from '@sypnia/ui/react';
// The mark on top, one task in the card, the other task under it, and what the person gets beside it when there is room.
export default function Basic() {
return (
<AuthLayout title="Create your account" lead="It takes a minute. No card needed." brandHref="#"
after={<>Already have an account? <a href="#sign-in">Sign in</a></>}
aside={<><Says size="lg">Every bug leaves a light on.</Says><List label="What you get"><ListItem icon="check" title="Errors, traces and replays in one place" /><ListItem icon="check" title="Your data stays in your region" /></List></>}
footer={<><a href="#terms">Terms</a><a href="#privacy">Privacy</a></>}>
<Field label="Work email"><EmailInput name="email" /></Field>
<Button variant="primary" block>Continue</Button>
</AuthLayout>
);
} Plain, for messages
No card: an expired invitation, an error, a page that does not exist.
This invitation has expired
Code
import { AuthLayout, Button, EmptyState } from '@sypnia/ui/react';
// Without the card: a page that says one thing and offers a way out, like an expired invitation.
export default function Plain() {
return (
<AuthLayout plain brandHref="#">
<EmptyState icon="mail" title="This invitation has expired"
actions={<><Button variant="primary" href="#sign-in">Sign in</Button><Button href="#help">Ask for a new one</Button></>}>
Invitations work for 7 days. Ask the person who invited you to send a new one.
</EmptyState>
</AuthLayout>
);
} Skeleton
The layout and its skeleton side by side: the same frame and boxes.
Sign in
Use the email you signed up with.
Code
import { AuthLayout, AuthLayoutSkeleton, Button, Columns, EmailInput, Field, PasswordInput } from '@sypnia/ui/react';
// The layout and its skeleton side by side: the same frame, the same boxes.
export default function Skeleton() {
return (
<Columns cols={2} stack>
<AuthLayout title="Sign in" lead="Use the email you signed up with." after={<a href="#sign-up">Create an account</a>}>
<Field label="Email"><EmailInput name="email" /></Field>
<Field label="Password"><PasswordInput name="password" /></Field>
<Button variant="primary" block>Sign in</Button>
</AuthLayout>
<AuthLayoutSkeleton fields={2} />
</Columns>
);
} Astro
The same frame with no JavaScript, for static pages: slots for after, aside, footer, brand and top.
Check your email
We sent a link to ana@northwind.io. It works for 30 minutes.
Wrong address? Start again
Code
---
import AuthLayout from '@sypnia/ui/astro/AuthLayout.astro';
import Button from '@sypnia/ui/astro/Button.astro';
---
<AuthLayout title="Check your email" lead="We sent a link to ana@northwind.io. It works for 30 minutes." brandHref="#">
<Button href="#sign-in" icon="arrow-left">Back to sign in</Button>
<Fragment slot="after">Wrong address? <a href="#sign-up">Start again</a></Fragment>
<Fragment slot="footer"><a href="#terms">Terms</a><a href="#privacy">Privacy</a></Fragment>
</AuthLayout> When to use it
Use it when
- Every page a person sees before the console: sign in, sign up, recovery, accepting an invitation, verifying an email.
- Error and not-found pages outside the console, with
plain: no card, one message and a way out. asidefor what the person gets. It shows only when the layout is 60rem wide or more.
Do not use it when
- Pages behind sign-in: they live in the AppShell.
- More than one task in the card: one step per page, with a link to the other task under it.
- Anything needed to finish the task inside
aside: phones never see it.
For everyone
- The card is the page's
mainlandmark and its title the onlyh1. - When the title changes (the next step of a flow), the focus moves to it and a screen reader reads it.
- The links of the footer and the mark are at least 44 px tall.
Props
| AuthLayout | Type | Default |
|---|---|---|
afterOne line under the card: «New to Sypnia? Create an account». | ReactNode | |
asideBeside the card when the layout is wide enough (60rem and more): what the person gets, a quote. Hidden on narrower screens, so nothing in it may be needed to finish the task. | ReactNode | |
brandThe mark at the top. Defaults to the Sypnia logo. | ReactNode | |
brandHrefWhere the mark leads. Without it the mark is not a link. | string | |
className | string | |
footerThe bottom line: terms, privacy, help. | ReactNode | |
leadOne sentence under the title: what happens here, or what to do next. | ReactNode | |
plainNo card around the content: for error and not-found pages, which say one thing and offer a way out. | boolean | |
titleWhat this step is, in the voice: «Sign in to Sypnia», «Check your email». It is the page's only h1. | ReactNode | |
topThe end of the top bar: a LanguageSwitch, a way back to the site. | ReactNode | |
width`sm` (26rem) for one or two fields, `md` (34rem) for longer forms and step-by-step tasks. | "sm" | "md" | sm |
| AuthLayoutSkeleton | Type | Default |
|---|---|---|
aside | boolean | |
fieldsHow many fields the step will have. | number | 2 |
plain | boolean | |
width | "sm" | "md" | sm |