Composer UI
How to consume Composer's design system (@dxos/react-ui*) from a plugin. This is the UI adjunct
to [[composer-plugins]] (which owns plugin _structure_: capabilities, surfaces, schema, operations)
and [[composite-components]] (which owns _authoring_ new @dxos/react-ui primitives). When you're
laying out a container, picking a color class, wiring a toolbar, or writing a story, the rules live here.
Golden rule: If the design system already has a primitive, a token, or a layout for what you need you must use it.
Reaching for a raw <div> with custom classes, a native <input>, or a guessed color token is almost
always a sign you missed an existing piece. Find it (grep an existing themed component) before inventing.
Low-level components (plugin/_/src/components, react-ui-_). Must NOT depend on @dxos/app-framework or @dxos/app-toolkit capabilitiess.
Instead aspects that may be derived from capabilites must be passed as properties.
Each component lives in its own subdirectory with an index.ts barrel.
Use named exports; no default exports.
Package family
Import from the most specific package. Common ones:
| Package | Provides |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| @dxos/react-ui | Core primitives: Panel, Card, List, Input, Button, IconButton, Icon, ScrollArea, Toolbar, Dialog, Popover, Tooltip, Select, Tag, Avatar, Separator, plus useTranslation, useThemeContext, DensityProvider. |
| @dxos/react-ui-theme | The theme (tx resolver, tokens, Tailwind preset). You rarely import from it directly — tokens are plain Tailwind classes. |
| @dxos/react-ui-form | Form.* — schema-driven forms (the way to edit ECHO objects). |
| @dxos/react-ui-menu | Menu.*, MenuBuilder, useMenuActions — toolbars and command menus. |
| @dxos/react-ui-attention | Attention system: AttentionGlyph, useAttention, attendable wiring. |
| @dxos/react-ui-list | Navigable lists with dx-current/dx-selected item states. |
| @dxos/react-ui-mosaic / -board | Layout composition (Mosaic Stack, Deck, Board) — usually owned by the shell, not plugins. (@dxos/react-ui-stack is deprecated — use the Mosaic Stack.) |
| @dxos/react-ui-editor / -markdown | Text/markdown editing. |
| @dxos/react-ui-table / -data | Data tables. |
Many more exist (-card, -chat, -thread, -pickers, -search, -syntax-highlighter, …). When you
need a domain widget, check for a react-ui-<domain> package before building one.
Theme tokens
Color/spacing tokens are plain Tailwind classes generated from CSS custom properties. The source of