Settings / Sign-in & Safety

Everything that protects an account in one page: a checklist of what is switched on, the password, two-step sign-in, passkeys, recovery codes, the devices still signed in and the last sign-ins, with unfamiliar ones marked.

Get pro lifetime to installPro screen · 4 examples · built from 8 Liro components
Open full screen

When to use

  • The security page of a product that holds anything valuable
  • Getting people to turn on two-step sign-in
  • Showing where an account is signed in and ending sessions

When not to use

The decision inside it

Weakening security asks if it's you, once

Turning protection off or showing recovery codes asks you to confirm it's you first, then trusts you for ten minutes with a visible countdown, so a stolen open laptop can't strip the account and you aren't asked on every click.

Installation

Settings / Sign-in & Safety is a Pro screen, included with pro lifetime. It is two files on top of the Liro components it is made of.

  1. Add the components it uses:
    npx shadcn@latest add @liro/alert @liro/badge @liro/button @liro/dialog @liro/input @liro/password-strength @liro/sessions-devices @liro/two-factor-setup
  2. Copy screens/sign-in-safety-screen.tsx and screens/data/sign-in-safety-screen.ts from the Code tab above into your project, at the same paths.
  3. It also imports @/lib, @/demos/liro-mark, @/demos/portraits, @/demos/screen-kit and @/demos/settings-shell: Liro’s shared helpers and the demo’s sample images. Point them at your own.

Usage

app/page.tsx
import { SignInSafetyScreen } from "@/screens/sign-in-safety-screen";

export default function Page() {
  /* A screen fills the box it is given: give it the window. */
  return (
    <main className="h-dvh">
      <SignInSafetyScreen className="h-full" />
    </main>
  );
}

Built from

Every Liro component this screen imports. Each has its own page, props and install command.

API reference

Read from SignInSafetyScreenProps when the site is built. It also takes every attribute a div does, such as className.

SignInSafetyScreen

TypeNotes
stateSignInSafetyState No–
onConfirmIdentity(password: string) => boolean | Promise<boolean> NoCheck the password before a sensitive change. Return false if it's wrong.
loadingboolean NoThe data is on its way: the frame stays and the content is drawn as gray shapes in the shape of the real page.
onNavigate(label: string) => void NoCalled with the label of a sidebar or settings item when someone opens it ("Inbox", "Model policy"). Without it, a toast says where it would go.
workspaceScreenWorkspace NoThe workspace at the top of the sidebar.
userScreenUser NoThe signed-in person, at the bottom of the sidebar.
layoutScreenLayout No"inset": the page on a card beside a gray sidebar. "flat": the page edge to edge. Default "inset".
classNamestring No–

Accessibility

  • The checklist reads as a list with each item's state in words
  • The confirm dialog traps focus and returns it when closed
  • The trust countdown is shown and announced, never only coloured
  • Movement follows the reduced-motion setting

Responsive behavior

  • Fills the box it is given: mount it at the window's height
  • Cards stack on narrow widths and keep their actions in reach
  • Light and dark come from the Liro theme: it follows the dark class on <html>, like every component.

More screens

Liro · 270 components · 17 screens · 4 templates