Skip to content

The open alternative to Salesforce, designed for AI.

4.4 KB
Raw Blame
{/*
 * _____                    _
 *|_   _|_      _____ _ __ | |_ _   _
 *  | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
 *  | |  \ V  V /  __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
 *  |_|   \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
 *                              |___/
 *
 * This file is generated from the documentation data in packages/twenty-ui/generated.
 * To update it, edit the component prop types or design tokens in twenty-ui and run:
 *   npx nx generate:ui twenty-docs
 */}

<ParamField body="className" type="string | ((state: ButtonState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;inherit&quot; | &quot;neutral&quot; | &quot;success&quot;" default="neutral">
  Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.
</ParamField>

<ParamField body="elevated" type="boolean" default="false">
  Adds a shadow and backdrop blur. Neutral outline buttons also use elevated surface colors.
</ParamField>

<ParamField body="endIcon" type="ReactNode">
  Decorative content displayed after the label.
</ParamField>

<ParamField body="focusableWhenDisabled" type="boolean" default="false">
  Whether the button should be focusable when disabled.
</ParamField>

<ParamField body="fullWidth" type="boolean" default="false">
  Expands the button to fill its container width.
</ParamField>

<ParamField body="href" type="string">
  Destination URL. Renders a native anchor when `render` is omitted unless `nativeButton` is explicitly true. Custom renderers retain their own element contract.
</ParamField>

<ParamField body="loading" type="boolean" default="false">
  Shows a loading indicator and disables activation.
</ParamField>

<ParamField body="loadingPosition" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;" default="center">
  Where the loading indicator appears. `center` hides the content while preserving its layout space; `start` and `end` keep children and the opposite icon visible and replace the corresponding icon with the spinner.
</ParamField>

<ParamField body="nativeButton" type="boolean" default="true (false for the built-in href anchor)">
  Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in `href` anchor defaults to false; an explicit value takes precedence.
</ParamField>

<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
  Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use `nativeButton={false}` and `role="link"` for a custom navigation anchor. Router integration belongs to the caller.
</ParamField>

<ParamField body="role" type="AriaRole">
  Role of the root element. Use `link` for custom navigation renderers.
</ParamField>

<ParamField body="shortcut" type="ShortcutDefinition">
  Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.
</ParamField>

<ParamField body="shortcutJoinLabel" type="string">
  Localized text between sequence steps. Defaults to then.
</ParamField>

<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
  Button height: `sm` (24px) or `md` (32px). The `link` variant uses its content height at either size.
</ParamField>

<ParamField body="startIcon" type="ReactNode">
  Decorative content displayed before the label.
</ParamField>

<ParamField body="style" type="CSSProperties | ((state: ButtonState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="variant" type="&quot;ghost&quot; | &quot;link&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="outline">
  Visual treatment of the button surface. `link` uses compact text styling without a filled surface or border; render composition determines native semantics.
</ParamField>