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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQAumujy5kXaOKurr6zgTP2krHrFVXi2kj8seRYrlvq2GssUjReh5MiVpQbLFQNy9HsmcasqpBNVsXytWTw0ZDjA=

Button

import * as Button from '@dxos/react-ui/Button';

A button is a control the user presses to act. Button has parts for a toggle, a group and a button that opens a menu.

import * as
import Button
Button
from '@dxos/react-ui/Button';
import * as
import Layout
Layout
from '@dxos/react-ui/Layout';
export const
const Buttons: () => React.JSX.Element
Buttons
= () => (
<
import Layout
Layout
.
const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.

gap is restricted to the named steps of the theme spacing ramp (see

Gap

), which is the point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents. Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the component deliberately grows no padding or colour props, since components own their own spacing.

There is no implicit align. Row-centering is the common case, but defaulting it would silently restyle any consumer relying on the CSS stretch initial value.

Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).

@example

<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>

Flex
gap?: Layout.Gap | undefined
gap
='sm'
wrap?: boolean | undefined
wrap
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
variant?: Button.Variant | undefined
variant
='primary'>Save</
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>Cancel</
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
variant?: Button.Variant | undefined
variant
='ghost'
icon?: string | undefined

Leading icon.

icon
='ph--plus--regular'
label?: string | undefined

Visible text; children take precedence.

Required: names the button (aria-label) and shows in a Tooltip.

label
='Add' />
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
variant?: Button.Variant | undefined
variant
='destructive'
icon?: string | undefined

Leading icon.

icon
='ph--trash--regular'
label?: string | undefined

Visible text; children take precedence.

Required: names the button (aria-label) and shows in a Tooltip.

label
='Delete'
iconOnly?: boolean | undefined

A control-sized square inset in a block-sized cell (follow-up 19), showing only the icon.

iconOnly
/>
<
import Button
Button
.
const Toggle: React.ForwardRefExoticComponent<Omit<Button.ToggleProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Toggle

A Button with a pressed state from the zag toggle machine (aria-pressed); icon, label and iconOnly are Button's.

Toggle
icon?: string | undefined

Leading icon.

icon
='ph--star--regular'
activeIcon?: string | undefined

Icon shown while pressed, in place of icon (e.g. a filled star for a pinned item).

activeIcon
='ph--star--fill'
label?: string | undefined

Visible text; children take precedence.

Required: names the button (aria-label) and shows in a Tooltip.

label
='Favorite'
iconOnly?: boolean | undefined

A control-sized square inset in a block-sized cell (follow-up 19), showing only the icon.

iconOnly
/>
</
import Layout
Layout
.
const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.

gap is restricted to the named steps of the theme spacing ramp (see

Gap

), which is the point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents. Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the component deliberately grows no padding or colour props, since components own their own spacing.

There is no implicit align. Row-centering is the common case, but defaulting it would silently restyle any consumer relying on the CSS stretch initial value.

Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).

@example

<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>

Flex
>
);

Button.Root renders a button. It takes the props of a <button>, plus:

Prop Type Effect
variant 'default' | 'primary' | 'ghost' | 'outline' | 'destructive' | 'valence' Sets the fill. Use primary for the one main action of a view
valence 'info' | 'success' | 'warning' | 'error' | 'neutral' Sets the status color, with variant='valence'
hue Button.Hue Colors the button with a palette hue
icon string Shows a leading icon, by name
iconEnd string Shows a trailing icon, by name
label string Sets the text, or with iconOnly the accessible name and tooltip
iconOnly boolean Shows only the icon
showTooltip boolean Shows the label as a tooltip, with iconOnly. true by default
tooltipSide 'top' | 'right' | 'bottom' | 'left' Sets where that tooltip opens
caretDown boolean Adds a trailing caret, for a button that opens a menu
spin boolean Spins the icon, for a busy state
compact boolean Reduces the padding
align 'center' | 'start' Sets where the content sits in a wide button
size Size Overrides the inherited size

A button with icon and label needs no children. For any other content, pass children instead.

Button.Toggle is a button that stays pressed. It takes the props of Button.Root, plus pressed, defaultPressed and onPressedChange. Use activeIcon to show a different icon while the button is pressed.

Button.Group puts buttons in a row with shared spacing.

  • justify is 'start', 'end' or 'between'.
  • fill shares the width equally, so a lone button stretches across the group.
  • compact removes the gap. Use compact to pack a run of icon-only buttons.

Button.Menu is a button that opens a menu of items. Use it when composing a full Menu is more than you need.