SessionList
Where you are signed in. Each device signs out on its own row: it dims while it runs, then leaves and the rows below slide up. A failure keeps the row and offers a retry. Auth.
Open playground- This device
About
SessionList is a React component in the Auth category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SessionList } from "@ashutoshswamy/smoui" and set sessions, onRevoke, onRevokeOthers.
Install
npm i @ashutoshswamy/smouiUsage
import { SessionList } from "@ashutoshswamy/smoui";
<SessionList
sessions={[
{ id: "mac", device: "MacBook Pro", detail: "Lisbon, active now", current: true },
{ id: "phone", device: "iPhone 15", detail: "Lisbon, 2 hours ago" },
]}
onRevoke={(id) => api.revokeSession(id)}
onRevokeOthers={() => api.revokeOthers()}
/>Props 3
- sessions
Signed-in devices. The current one cannot be signed out from here.
{ id: string; device: string; detail?: string; current?: boolean }[]- onRevoke
Sign one device out. Resolve to remove its row, reject to keep it with a retry.
(id: string) => void | Promise<unknown>- onRevokeOthers
Adds Sign out of all other devices.
() => void | Promise<unknown>
More auth components
- AccountSwitcherPick which signed-in account to use. One highlight stretches to the chosen row, arrow keys move the choice, and the radio semantics are real.
- ApiKeyFieldA secret kept out of sight. The prefix and last four characters stay readable; Reveal decodes the rest left to right and a bar counts down to when it masks itself again.
- ConsentCardOAuth-style consent. Each permission is a row you can untick unless it is required, and the allow button counts what you are granting.
- DeviceApprovalThe "was this you?" card for a sign-in from a new device. The two answers are equal-weight buttons, the pressed one shows a spinner, and the card settles into a tick or a shield.
- MagicLinkFormPasswordless sign-in. Enter an email and the form hands over to a check-your-inbox card with a drawn tick, a resend countdown and a way back to fix a typo.
- PasskeyButtonContinue with passkey. While the device prompt is open, rings ripple out of the badge; a recognised passkey becomes a drawn tick, a refusal a cross. The label follows each state.