caliper uidocs

Security settings

Pro

Password, two-factor, sessions and devices in one page.

Installs components/ui/security-settings.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source
pnpm dlx shadcn@latest add @caliper/security-settings

Password

Use a long, unique password. Changing it signs out your other devices.

No password yet

  • At least 12 characters, not met
  • Uppercase and lowercase letters, not met
  • A number, not met
  • A symbol, not met

Two-step sign-in

Ask for a code from an authenticator app after your password.

Off. Anyone with your password could sign in.

Where you are signed in

End any session you do not recognise.

Lisbon, Portugal · Active now

This device

Lisbon, Portugal · 2 hours ago

Madrid, Spain · 6 days ago

When to use #

Use it for

  • Account security.

Skip it when

  • Preferences unrelated to security.

Installation #

terminal
pnpm dlx shadcn@latest add @caliper/security-settings

Adds its 13 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage #

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { SecuritySettings } from "@/components/ui/security-settings"

The worked example comes with Pro

The 37-line example behind the preview opens here with a Pro or Team licence.

Checking your licence…

API reference #

SecuritySettings

component
PropTypeDefaultDescription
onChangePassword *(current: string, next: string) => string | void | Promise<string | void>—Return an error message to show, or nothing on success.
twoFactor *{ enabled: boolean; secret: string; recoveryCodes: readonly string[]; onVerify: (code: string) => Promise<boolean>; onDisable: () => void; }—
sessions *readonly SecuritySession[]—
onSignOut *(id: string) => void—
onSignOutOthers *() => void—
classNamestring—

Accessibility #

It exposes alert and status semantics, with aria-invalid, aria-hidden and aria-label kept in step with state. Changes that matter are announced through a live region.

No custom key handling; Tab and the native activation keys do the work.

Motion #

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.