Skip to the page

Sign in

In code: SignIn

The screen a private app shows to someone who is not signed in: a band in the ink colour with a fine grid, the heading in two lines (a quiet lead, then the app's name), and under it a panel with a line of text and the button that sends them to the account that signs them in (like "Sign in with Google"). The app never has a password form of its own. It fills the space it is given, at least most of a screen.

Preview

Use

The code of the preview above
import { ButtonLink, SignIn } from '@/components/ui';

<SignIn
  lead="Sign in to"
  title="Harbour Studio"
  text="Use the account you use on Supply Family. Ines adds the people who can open it."
  note="You sign in on supply.family and come straight back."
>
  <ButtonLink variant="primary" size="lg" block href="#signin">
    Sign in
  </ButtonLink>
</SignIn>

This page as text, for an AI

Options

OptionTypeWhat it does
children NeededReactNodeThe sign-in button, or buttons: one per account that can sign in.
title NeededReactNodeThe heading's second line, what signing in opens: the app's name.
className stringMore classes on the outer element, for layout around it (margins, grid placement), not to restyle it.
error ReactNodeWhy the last try did not work ("That sign-in ran out"), shown above the button.
lead ReactNodeThe heading's quiet first line, what signing in does: "Sign in to".
mark ReactNodeThe app's mark or logo, above the heading.
markLabel stringThe mark's name, read out.
markSrc stringThe address of the app's mark as an image, above the heading in the band's text colour: only its shape counts.
note ReactNodeOne quiet line under the button, such as where they will sign in.
text ReactNodeOne or two plain sentences in the panel: whose account to use, what happens next.

Without React

The same look on any HTML, with the classes section.ui-signin > h1.ui-signin-title + .ui-signin-panel > .ui-signin-actions.

With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:

components/sign-in.css

Layout: states, do and don’t

The screen a private app shows to someone who is not signed in: a band in the ink colour with a fine grid, its mark (or markSrc, an image of it painted in the band's text colour, named by markLabel), a large heading in two lines (a quiet lead such as "Sign in to", then the app's name as title), and under it a panel in the page's colour with a line of text, the sign-in button as its children (one per account that can sign in, full width, one under the other) and a quiet note, such as where they will sign in. error says why the last try did not work. It sends people to the account that signs them in, like "Sign in with Google": an app never has a password form of its own. Centred in the space it is given.

States. Layout follows the box it is in, not the window: Split, Grid, AppShell and the site parts stack when their box is narrow, at any width of the window.

Do

  • Space with gap (Stack, Row, Grid), never with margins on children.
  • Put the page's sections straight on the page, under their titles; a Card is one thing a person picks or acts on.
  • Check every screen at 320, 375 and 768 px with the narrow check of rule 10.

Don't

  • Don't give a box a fixed width, or a min-height together with an aspect-ratio.
  • Don't nest a card in a card.
  • Don't put two <main>s on a page: a screen shown inside another page takes Main as="div".