w6w docs

Data display

Small building blocks for showing W6W data in your own lists and pages. All four are props-only.

AppIcon

An app’s icon, with a dark-mode variant and an initials tile when there’s no image (or the image fails to load).

PropTypeDefaultWhat it does
srcstringNoneData URI or URL of the light-mode icon. Missing ⇒ initials tile.
srcDarkstringNoneDark-mode variant. Falls back to src.
namestringNoneDisplay name; its initials fill the fallback tile.
brandColorstringvar(--w6w-accent)Background of the initials tile.
sizenumber32Square size in px.
theme"light" | "dark"InheritedForces which variant shows. See Theming.

An AppSummary from the server carries these as iconSvg, iconSvgDark and brandColor:

import { AppIcon } from "@w6w/ui";

<AppIcon src={app.iconSvg} srcDark={app.iconSvgDark} brandColor={app.brandColor} name={app.displayName} />

ListItem

One row of a list: an optional leading icon, a title, a muted subtitle and a trailing slot. Pass onClick and the row becomes a keyboard-reachable button.

PropTypeWhat it does
titleReactNodeRequired. Single line, truncated with an ellipsis.
subtitleReactNodeMuted second line.
iconReactNodeLeading slot, such as an AppIcon.
trailingReactNodeRight-aligned slot, such as a status pill.
activebooleanHighlights the row; reflected as aria-pressed when clickable.
onClick() => voidMakes the row a button.
ariaLabelstringAccessible name for a clickable row. Defaults to the title’s text.
import { AppIcon, HealthStatusPill, ListItem } from "@w6w/ui";

{connections.map((c) => (
  <ListItem
    key={c.id}
    title={c.displayName ?? c.appId}
    subtitle={c.appId}
    icon={<AppIcon name={c.appId} size={24} />}
    trailing={<HealthStatusPill state="ok" />}
    active={c.id === selectedId}
    onClick={() => setSelectedId(c.id)}
  />
))}

Copyable

Adds a copy-to-clipboard button inside the box of an input, textarea or code block. Unlike most components, it has a side effect: it writes to navigator.clipboard. After a copy, the button shows a checkmark briefly.

PropTypeDefaultWhat it does
valuestringRequiredThe exact text copied.
childrenReactNodeRequiredThe control that displays the value.
readOnlybooleanfalseWhen true, a click anywhere in the box copies, not just the button.
labelstring"Copy"Accessible name of the copy button.
copiedMsnumber1500How long the checkmark shows, in ms.
classNamestringNoneAdded to the wrapper.
import { Copyable } from "@w6w/ui";

<Copyable value={webhookUrl} readOnly label="Copy webhook URL">
  <input readOnly value={webhookUrl} />
</Copyable>

Copyable is also exported from @w6w/ui/code, for pages that load only code.css.

CopyableText

Inline text that copies on click, optionally cropped for display. The full value is always what gets copied.

PropTypeDefaultWhat it does
valuestringRequiredThe full string.
charsnumberShow in fullHow many characters to show.
crop"start" | "end" | "middle""end"Where the … goes.
labelstring"Copy"Accessible name of the copy control.
copiedMs, classNameAs on Copyable.
import { CopyableText } from "@w6w/ui";

<CopyableText value={connection.id} chars={12} crop="middle" label="Copy connection id" />

cropText(value, chars, crop) is exported too, if you need the same cropping without the copy behavior.

Where to next