YuhuanStudioYunUIDocs
Patterns

Session Item

A row in an active-sessions / signed-in-devices list — device glyph, name with current/inactive badges, browser·OS, IP + last-seen, and a revoke button.

One row in an active-sessions / signed-in-devices list: a device glyph, the device name with current / inactive badges, a browser · OS detail line, an IP + last-seen footer, and a revoke button. Presentation only — the host maps the device type to an icon, formats the time, and owns the revoke action.

Import

import { SessionItem } from "@yuhuanowo/yunui/patterns";

Example

current shows a badge and hides the revoke button; inactive dims the row. The device icon and the relative time are host-supplied slots.

SessionItem

MacBook ProCurrent
Chrome on macOS
203.0.113.7Active now
iPhone 15
Safari on iOS
198.51.100.223h ago
Windows PCInactive
Edge on Windows
192.0.2.442d ago

Props

PropTypeDefaultDescription
classNamestring
currentbooleanMarks the current session — shows a badge and hides the revoke button.
currentLabelReactNode
detailReactNodeSecondary detail line, e.g. "Chrome on macOS".
iconReactNodeDevice glyph (host maps the device type to an icon).
inactivebooleanDims the row and shows an "inactive" badge.
inactiveLabelReactNode
ipReactNodeIP address (rendered after a globe glyph).
name*ReactNodeDevice name / label.
onRevoke(() => void)Revoke handler — when set (and not current), shows the revoke button.
revokeLabelstring
revokingboolean
timeReactNodeHost-formatted relative time (rendered after a clock glyph).

On this page