> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IconButton

> Trigger actions with accessible square icon buttons.

export const StoryEmbed = ({storyId, title, height = 240}) => <>
    <Tabs>
      <Tab title="Light">
        <iframe title={`${title} (light)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:light`} width="100%" height={height} loading="lazy" style={{
  border: 0
}} />
      </Tab>
      <Tab title="Dark">
        <iframe title={`${title} (dark)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:dark`} width="100%" height={height} loading="lazy" style={{
  border: 0
}} />
      </Tab>
    </Tabs>
    <a href={`https://storybook.twenty.com/?path=/story/${storyId}`}>
      Open in Storybook
    </a>
  </>;

`IconButton` composes [Button](/ui/primitives/input/button) with a square surface. Pass the icon as children and provide an `aria-label` describing the action. Icon content is decorative and hidden from assistive technology.

## Usage

```tsx theme={null}
import { IconButton } from 'twenty-ui/components';
import { IconPlus } from 'twenty-ui/icon';

export const CreateRecordButton = () => (
  <IconButton
    aria-label="Create record"
    variant="solid"
    color="accent"
    size="sm"
  >
    <IconPlus />
  </IconButton>
);
```

Sizes are `sm` (24px) and `md` (32px). The defaults are `md`, `outline`, and `neutral`. Variants and colors match Button.

<StoryEmbed title="Icon button example" storyId="ui-components-iconbutton--catalog" height={620} />

## Tooltip

Add `tooltip` to show text on hover and keyboard focus. Keep `aria-label` as the accessible name of the action. Disabled and loading buttons retain hover tooltips.

```tsx theme={null}
import { IconButton } from 'twenty-ui/components';
import { IconSearch } from 'twenty-ui/icon';

export const SearchRecordsButton = () => (
  <IconButton aria-label="Search" tooltip="Search records" variant="ghost">
    <IconSearch />
  </IconButton>
);
```

<StoryEmbed title="Icon button with tooltip" storyId="ui-components-iconbutton--tooltip" height={180} />

The tooltip defaults to the bottom, with a 1000ms delay and a 5px offset. Use `tooltipPlace`, `tooltipDelay`, and `tooltipOffset` to adjust it. Omitting `tooltip` renders the button directly.

## State ownership

Your application supplies `loading` and `disabled`. Both prevent activation. Loading preserves the square dimensions and accessible label. The button does not track a selected value or set loading automatically after a click. Native keyboard focus follows the browser; use `aria-pressed` when your application owns a toggle state.

## Grouped actions

```tsx theme={null}
import { ButtonGroup } from 'twenty-ui/primitives/input';
import { IconButton } from 'twenty-ui/components';
import { IconPlus, IconSearch } from 'twenty-ui/icon';

export const RecordActions = () => (
  <ButtonGroup aria-label="Record actions" size="sm" variant="outline">
    <IconButton aria-label="Search records">
      <IconSearch />
    </IconButton>
    <IconButton aria-label="Create record">
      <IconPlus />
    </IconButton>
  </ButtonGroup>
);
```

[ButtonGroup](/ui/primitives/input/button-group) supplies size, variant, color, and adjoining corners. Individual buttons do not need a position prop.

## Links and forms

Use `href` to render an anchor. The caller can provide a custom `render` element, including its own router link. Supply `href` to select link semantics; the renderer must preserve an anchor. Without `href`, preserve a native button. Neither `nativeButton` nor `role` is part of the public button interface. Disabled links cannot activate. Routing stays in the application.

Native attributes, event handlers, refs, and render composition pass through to Button. The default is `type="button"`; set `type="submit"` explicitly for form submission.

## Props

<ParamField body="aria-label" type="string" required>
  Required accessible name describing the action.
</ParamField>

<ParamField body="className" type="string | ((state: ButtonState) => 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="&#x22;neutral&#x22; | &#x22;accent&#x22; | &#x22;danger&#x22; | &#x22;success&#x22;">
  Semantic color of the button.
</ParamField>

<ParamField body="elevated" type="boolean">
  Adds a shadow to the button.
</ParamField>

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

<ParamField body="loading" type="boolean">
  Shows a loading indicator and disables activation while preserving the button width.
</ParamField>

<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>">
  Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
</ParamField>

<ParamField body="size" type="&#x22;sm&#x22; | &#x22;md&#x22;">
  Square button size: `sm` (24px) or `md` (32px).
</ParamField>

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

<ParamField body="tooltip" type="string">
  Text displayed when hovering or focusing the button.
</ParamField>

<ParamField body="tooltipDelay" type="&#x22;0ms&#x22; | &#x22;300ms&#x22; | &#x22;500ms&#x22; | &#x22;1000ms&#x22;" default="TooltipDelay.longDelay">
  Delay before showing the tooltip.
</ParamField>

<ParamField body="tooltipOffset" type="number" default="5">
  Distance in pixels between the button and the tooltip.
</ParamField>

<ParamField body="tooltipPlace" type="&#x22;top&#x22; | &#x22;left&#x22; | &#x22;right&#x22; | &#x22;bottom&#x22;" default="TooltipPosition.Bottom">
  Preferred placement of the tooltip relative to the button.
</ParamField>

<ParamField body="variant" type="&#x22;solid&#x22; | &#x22;outline&#x22; | &#x22;ghost&#x22; | &#x22;soft&#x22;">
  Visual treatment of the button surface.
</ParamField>
