UI Components
@react-trace/ui-components provides UI primitives for building plugins that match the widget's look and feel.
Installation
This package is a peer dependency of all official plugins. If you're building a custom plugin, add it alongside @react-trace/core.
Available components
Action and input primitives
Layout and helpers
Overlay and selection primitives
Icons
ChatBubbleIcon, ChevronRightIcon, ClipboardIcon, CollapseIcon, ExpandIcon, FolderIcon, OpencodeIcon, OpenInEditorIcon, SaveIcon, SettingsIcon, TrashIcon, XIcon
If you need to add an icon that we currently don't export, consider contributing to the package. Otherwise, use icons from Lucide React (pnpm add lucide-react).
Logo
Logo — the React Trace logo component.
Example
Guidelines
- Prefer these primitives over package-local replacements when you need standard buttons, headers, menus, selects, or text inputs.
- Keep styling inline. These components are designed to be extended with
styleprops, consistent with the inline-style approach used throughout the repo. - Use the widget portal. For portal-based UI inside the Trace widget, render into the container returned by
useWidgetPortalContainer()instead ofdocument.body.