Skip to main content
@arg/ui gives a React app the same core controls Arg uses. Import it directly in a .tsx or .jsx workspace file. There is no package installation or stylesheet import: the React preview supplies the module and adds its styles when you use it.
The controls inherit the viewer’s light, focus, or dark Arg theme. Buttons, cards, form controls, and compatibility primitives forward their documented DOM props and refs, so you can compose them with your own workspace CSS.

Components

Buttons

Button props

Button accepts native button props plus: Loading replaces the left icon with a spinner and disables the button. buttonClassName({ variant, size, className }) returns the same class set when you need button styling on a compatible custom element. IconButton accepts native button props, size: "sm" | "md" | "lg", and variant: "ghost" | "solid". The defaults are "md" and "ghost". Give every icon-only button an aria-label.

Cards

Card also forwards element attributes. Set as="a" when you pass href.

Form controls

Both controls accept their native input or textarea attributes. Their variant is "default", "medium", or "small" and defaults to "default". Pass error to show an error state and message. FormInput also accepts leftIcon; FormTextarea defaults to four rows. Input is an alias for FormInput. Textarea is an alias for FormTextarea. Dropdown is controlled: your component owns value, and onChange receives the selected option’s string value.
The menu opens in a portal, flips when space is tight, and stays inside the viewport. It supports arrow keys, Home, End, Enter, Escape, and type filtering when searchable is on.

Context menu

Render ContextMenu only while you have an anchor position. Clear that position in onClose.
ContextMenu accepts position, items, and onClose, plus size: "sm" | "md", align: "start" | "end", autoFocus, and ariaLabel. The defaults are "md", "start", and false. The menu and its submenus stay inside the viewport. Outside clicks and Escape call onClose, and keyboard navigation covers menu items and submenus.

Keyboard shortcuts

variant is "inline" or "badge" and defaults to "inline".

Compatibility exports

Existing apps may still import Badge, Heading, Text, Stack, CardHeader, CardTitle, CardDescription, CardContent, and CardFooter. These exports remain available for compatibility, but they are deprecated. New apps should compose semantic HTML inside Card and use their own CSS for layout and typography.