Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Risk Assessment Login Block for React

A sign-in page that shows why it is asking: six weighted signals add up to a score, a three-zone band marks it, and the question follows the zone: nothing, a six-digit code, or a block.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Explain adaptive sign-in instead of just applying it, with this risk assessment login block for React with Base UI. It's the "why are we asking" step of Remitloft, a payments app: a whole screen with the page's rails and one band across it, a centred header over two columns on wide screens and the verdict first on phones. The verdict column shows the risk score (0 to 100) and its zone, Allow, Verify or Block, as a word with a glyph over a three-zone band with a marker at the score, then what Remitloft will ask in that zone and the one Shine Button, whose label follows the zone. When the zone is Verify the question is a six-digit Input OTP. The other column lists six signals (device, place, network, time of day, sign-in history, account age), each with its weight in words and points, a thin Progress bar as long as the weight, and a demo Switch that says whether it matches. Flipping a switch re-reads the score, the zone and the question at once. It's built from Input OTP, Progress, Switch, Field, Button, Shine Button and Guides, with a CSS entrance only. For sign-ins that ask for more only when the risk calls for it.

FAQ

What stays in the page, and how do I wire it for real?

Everything. The six signals, their weights and the demo code (275194, printed under the field) are typed constants; nothing reads your device, place or network, and nothing is sent. In a product, work the signals out on your server at sign-in, keep the weights and thresholds there, and never let the browser report them. The switches here exist only so a visitor can see the score move.

How is the score worked out?

Each signal that differs adds its weight: device 25, place 20, sign-in history 20, network 15, time of day 10 and account age 10, which add up to 100. The zones are Allow from 0 to 29, Verify from 30 to 59 and Block from 60. Every weight is shown in words (Heavy, Medium, Light) and in points, and the bar beside it is as long as the weight and dark when the signal counts.

Why are the signals switches, and what does on mean?

They are demo controls, named so ("Device matches (demo control)"). On means the signal matches, off means it differs. Reset brings back the opening signals, where place and network differ for a score of 35.

What does each zone ask for?

Allow asks for nothing and the button reads Continue to Remitloft. Verify asks for a six-digit code, with all six digits required and a wrong code cleared and named; the button reads Verify and continue. Block asks for nothing and says the sign-in waits for a review; the button reads Contact support. Every pane shares one cell, so the column never changes height.

How is the verdict told apart without colour?

By a glyph (a tick, a shield with a question mark, a cancel mark), the zone's word, a heavy outline on the current zone and a marker with the score on the band. Nothing is green or red.

Is the change announced to a screen reader?

Yes, once the switches have rested for 600 milliseconds, and only when the words change, through the page's one status line ("Score 60. Block: sign-in not allowed."). The score and the zone are also plain text in the verdict column.

  • Pro

    A sign-in score simulator: four demo switches fill a circular meter in steps of 25 and decide the check, none above 75, a code from 50, an approval below, with a sketch of that check.

  • Pro

    A split sign-in step for an investing app: a six-digit code field beside a demo authenticator whose code and draining ring change every 30 seconds, where the current code and the one before it both sign in.

  • Pro

    OTP Verification Login

    Codes and approvals

    A code step for a parcel locker app: a six-digit field that checks itself on the sixth digit or on a paste, counts wrong codes down from three, and a resend button that waits 30 seconds after it is pressed.

  • Pro

    A split sign-in page that asks whether a sign-in from far away was you: a drawn map with two places and an arc, a list of facts, and two answers, This is me and Not me.

  • Pro

    A page that reports a blocked sign-in after the fact: an incident timeline of three events, the facts of the attempt, then Secure my account (which asks for the password) or This was me.

  • Pro

    Device Approval Login

    Codes and approvals

    A sign-in screen with a drawn phone: it asks whether the request is you, shows three number buttons, approves the matching one, denies a wrong one and points Deny to a password change.