/
1.1k
Sponsor

Login Flow

Full-page onboarding/login screen with announcement banner, big ASCII title, description, and numbered select

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/login-flow

Usage

import { LoginFlow } from "@/components/ui/login-flow";
<LoginFlow title="Acme CLI" padding={2}>
  <LoginFlow.Announcement icon="🎉">
    Version 3.0 is now available!
  </LoginFlow.Announcement>
  <LoginFlow.Description>
    Sign in to access your workspace.
  </LoginFlow.Description>
  <LoginFlow.Select
    label="Choose a login method:"
    options={["GitHub", "Google SSO", "Email & Password"]}
    onSelect={(index) => console.log("selected", index)}
  />
</LoginFlow>

API Reference

LoginFlow

PropTypeDefault
titlestring-
titleFont"block" | "simple" | "shade" | "slim""block"
titleColorstring-
paddingnumber2
onSelect(index: number) => void-
childrenReactNoderequired

LoginFlow.Announcement

PropTypeDefault
iconstring"*"
iconColorstring-
borderStyle"single" | "round" | "double" | "bold""single"
borderColorstring-
childrenReactNoderequired

LoginFlow.Description

PropTypeDefault
boldbooleanfalse
dimbooleanfalse
colorstring-
childrenReactNoderequired

LoginFlow.Select

PropTypeDefault
labelstring-
labelBoldbooleanfalse
optionsstring[]required
activeIndexnumber-
defaultIndexnumber0
cursorstring"›"
cursorColorstring"cyan"
activeColorstring"cyan"
onSelect(index: number) => voidrequired
keyboardNavbooleantrue

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Arrow keys move inside the composite; Home / End select the first or last enabled item; Enter / Space activate, select, or toggle; Escape cancels or closes an owned surface; Tab / Shift+Tab move between termcn/Ink focus targets.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.