DesktopLoginScreen
A desktop OS sign-in screen. Wallpaper, a clock with a greeting, and a card with the mark and the Nasaq LoginForm, plus optional power buttons.
Code
import { DesktopLoginScreen } from "@fadymondy/nasaq/web";export function SignIn() { return ( <DesktopLoginScreen title="ToGO OS" onSubmit={async ({ email, password }) => { const ok = await api.signIn(email, password); if (!ok) return { error: "Incorrect email or password." }; }} /> );}declare const api: { signIn(e: string, p: string): Promise<boolean> };Auth · beta
Live examples and controls: DesktopLoginScreen in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/desktop-login-screen.jsonThe first screen of a web OS: the time, a greeting and a sign-in card over a wallpaper. The form is LoginForm, so
passkeys, providers, errors and rate limiting work the same as on any Nasaq sign-in page.
When to use
- Signing in to a desktop-style app built with
DesktopShell.
When not to use
- A person already signed in coming back after idle: use
LockScreen. - A normal web app sign-in page: use
AuthLayoutwithLoginForm.
Import
import { DesktopLoginScreen } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"Quick start
import { DesktopLoginScreen } from "@fadymondy/nasaq/web";
export function SignIn() {
return (
<DesktopLoginScreen
title="ToGO OS"
onSubmit={async ({ email, password }) => {
const ok = await api.signIn(email, password);
if (!ok) return { error: "Incorrect email or password." };
}}
/>
);
}
declare const api: { signIn(e: string, p: string): Promise<boolean> };Anatomy
DesktopLoginScreen data-slot="desktop-login-screen"
├─ wallpaper + scrim aria-hidden
├─ clock greeting, time, date (showClock)
├─ card <section> labelled by the title
│ ├─ mark, title, description
│ ├─ LoginForm | children
│ └─ footer
└─ power actions <nav> (powerActions)API
div props (except children, title, onSubmit) plus:
| Prop | Type | Default | Description |
|---|---|---|---|
onSubmit | LoginFormProps["onSubmit"] | Resolve with nothing, or { error, fieldErrors }. | |
formProps | Omit<LoginFormProps, "onSubmit"> | Passkeys, providers, forgot password, labels. | |
children | ReactNode | Replaces the form. | |
wallpaper | ReactNode | Under a scrim. | |
mark | ReactNode | ProductMark | null hides it. |
title / description | ReactNode | "Sign in" | |
showClock / now | boolean / Date | number | true / live | Freeze time for docs. |
footer | ReactNode | Under the form. | |
powerActions | { id, label, icon, onSelect }[] | Round buttons at the bottom. | |
labels | DesktopLoginScreenLabels |
Accessibility
- The card is a labelled
sectionwith anh1; the power buttons are a labellednavand each has a name. - Errors come from
LoginFormand are announced.
RTL & i18n
- Greetings and labels are in English and Arabic. The time uses
Intlwith Latin digits and stays left to right.
Styling & tokens
rounded-card, a hairline border andbg-card/90with a blur over the wallpaper. No shadows.
Do / Don't
- Do keep the power actions real: hide them if they do nothing in a browser.
- Don't add a second form next to the card. Use
childrento replace it.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-auth-pages-desktop-login-screen--docs
AuthLayout
Page shell for sign-in and sign-up screens: a centred card or a split layout with a brand panel, a heading, and a footer slot.
Device pairing
Approve a device by code with its claims, IP and platform; show an OAuth device-code with a big copyable code and link; and hand a browser sign-in to a native app.