This page as markdown: /entity.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

Entity

Status: stable

A list-row record: leading visual + title/subtitle column + trailing action, with truncating text. Presentational by default (no hover); interactive rows gain the hover highlight, focus ring, and keyboard activation, and selected marks the current one. Compact/comfortable density.

Keywords: entity, identity, object, avatar row

Usage

Use Entity to show a compact identity block for a person, organization, file, project, or other object.

Best practices

Props

Name Type Default Description
leading ReactNode — Leading visual — typically an Avatar or an Icon.
title ReactNode — Primary line (text-title-sm, truncated). Required.
subtitle ReactNode — Secondary line (text-body-sm muted, truncated).
subtitleWrap boolean false Let the subtitle wrap instead of truncating, when it is a description rather than a label.
action ReactNode — Trailing slot — typically a ghost icon Button or a StatusDot.
interactive boolean false Make the whole row a target: the leading visual and text become a native
onSelect () => void — Activation handler for an interactive row (fired on click and Enter/Space). Optional when render makes the row a link.
render useRender.RenderProp — Interactive rows only: render the row's target as another element, typically the router's link (render={}) so a list–detail row navigates. Defaults to a
selected boolean false Interactive rows only: the current row of a selectable list (the record open in a list–detail view). Sets aria-current on the row's target ("page" when render makes it a link, "true" for a button) and paints the selected fill, a step off the surface the row sits on, which holds on hover.
density "compact" | "comfortable" "compact" Row padding: compact (12px × 10px, the default) or comfortable (16px × 12px), on the spacing scale. The insets read --entity-px / --entity-py first, which CardList sets from the card's own padding so rows in a card line up with its header.

Variants

  • density: compact, comfortable

Tokens used

accent, accent-foreground, foreground, muted-foreground, ring

Motion

  • arrival · Root · no motion — Rows arrive with the list they belong to. Entering one at a time is a stagger, and a stagger on a list someone opened to scan is a delay.
  • response · Root · motion-interactive — Only the interactive row reacts: its hover fill, a step off the surface it sits on, eases in. A static row never fakes clickability, and an interactive one answers the pointer without flicker as it moves down a list.
  • transition · Root · motion-interactive — selected eases the fill onto the current row of a list–detail view, so opening another record reads as the selection moving rather than two rows flashing.
  • activity · Root · no motion — A record row has nothing of its own to wait for. A row whose action is pending puts a loading Button in action.

Accessibility

Related

  • Components: Avatar, Badge

Examples

Person row

import { Avatar, Button, Entity, Icon } from "@sableui/react"

<Entity leading={<Avatar fallback="AM" />} title="Alex Morgan" subtitle="@alex" action={<Button variant="ghost" size="icon" aria-label="More"><Icon name="ellipsis" /></Button>} />

Row that navigates

import { Avatar, Button, Entity, Icon } from "@sableui/react"

<Entity interactive selected={active} render={<a href="/people/alex" />} leading={<Avatar fallback="AM" />} title="Alex Morgan" subtitle="@alex" action={<Button variant="ghost" size="icon" aria-label="More"><Icon name="ellipsis" /></Button>} />

Interactive (selectable) row

import { Avatar, Entity } from "@sableui/react"

<Entity interactive onSelect={() => selectUser(user)} leading={<Avatar fallback="AM" />} title="Alex Morgan" subtitle="@alex" />