> ## 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.

# ListItemButton

> Нативные кнопки действий с общим оформлением строки списка.

## Обзор

Используйте `ListItemButton` для строк действий и отдельных кнопок выбора. Он сочетает компоновку [ListItem](https://docs.twenty.com/ru/ui/primitives/navigation/list-item.md) с нативной кнопкой, включая активацию клавишами Enter и Space, фокус и поведение в отключенном состоянии. По умолчанию используется `type="button"`.

**Light**

[Пример ListItemButton (light)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--display\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Пример ListItemButton (dark)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--display\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-components-listitembutton--display)

## Использование

```tsx theme={null}
import { ListItemButton } from 'twenty-ui/components/navigation';
import { IconCopy } from 'twenty-ui/icon';

export const DuplicateAction = ({
  onDuplicate,
}: {
  onDuplicate: () => void;
}) => (
  <ListItemButton
    startIcon={<IconCopy />}
    description="Create a copy"
    onClick={onDuplicate}
  >
    Duplicate
  </ListItemButton>
);
```

## Действия и отключенное состояние

Передавайте `onClick` и `disabled` напрямую. Отключенные кнопки используют соответствующее оформление строки, предотвращают активацию и исключаются из порядка обхода по Tab.

```tsx theme={null}
import { ListItemButton } from 'twenty-ui/components/navigation';
import { IconCopy } from 'twenty-ui/icon';

type DuplicateActionProps = {
  onDuplicate: () => void;
  disabled?: boolean;
};

export const DuplicateAction = ({
  onDuplicate,
  disabled = false,
}: DuplicateActionProps) => (
  <ListItemButton
    disabled={disabled}
    onClick={onDuplicate}
    startIcon={<IconCopy />}
    description="Create a copy"
  >
    Duplicate
  </ListItemButton>
);
```

**Light**

[Отключенная строка действия (light)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--disabled\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Отключенная строка действия (dark)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--disabled\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-components-listitembutton--disabled)

Установите `focusableWhenDisabled`, чтобы отключенная кнопка могла получать фокус. Она использует `aria-disabled` и продолжает блокировать активацию. Нативные атрибуты кнопки, события, стили, имена классов и ref `HTMLButtonElement` передаются кнопке. События всплывают обычным образом; вызывающая сторона задает необходимую политику `stopPropagation()` или `preventDefault()`.

## Выбор и визуальные слоты

Ваше приложение управляет независимыми состояниями `active`, `selected` и `focused`. Используйте `active` для открытой или текущей строки. Используйте `selected` вместе с соответствующим доступным состоянием, например `aria-pressed` для кнопки-переключателя. `focused` выделяет строку, не перемещая DOM-фокус. Индикаторы и подсказки сочетаний клавиш носят декоративный характер; ваше приложение регистрирует сочетания клавиш и обрабатывает навигацию.

```tsx theme={null}
import { useState } from 'react';
import { ListItemButton } from 'twenty-ui/components/navigation';

export const ShowArchivedToggle = () => {
  const [selected, setSelected] = useState(false);

  return (
    <ListItemButton
      aria-pressed={selected}
      selected={selected}
      indicator="check"
      onClick={() => setSelected(!selected)}
    >
      Show archived records
    </ListItemButton>
  );
};
```

**Light**

[Выбранная строка действия (light)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--selected\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Выбранная строка действия (dark)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--selected\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-components-listitembutton--selected)

Используйте `startIcon`, `endIcon`, `description` и `descriptionPlacement` для вспомогательного содержимого. `color="danger"` обозначает разрушительное действие. `shortcutJoinLabel` управляет текстом между последовательными сочетаниями клавиш, а `hasSubmenu` отображает индикатор подменю.

## Многострочное вспомогательное содержимое

Установите `descriptionPlacement="below"`, чтобы разместить вспомогательный текст под меткой. Метка сохраняет свое поведение при усечении. Передайте [Text](https://docs.twenty.com/ru/ui/primitives/typography/text.md) с `truncate` или `lineClamp` в качестве `description`, когда требуется более короткий предварительный просмотр. Размещения `inline` и `end` сохраняют существующий внешний вид.

```tsx theme={null}
import { ListItemButton } from 'twenty-ui/components/navigation';
import { Avatar } from 'twenty-ui/primitives/data-display';

type PlanningActionProps = {
  active?: boolean;
  disabled?: boolean;
  onOpen: () => void;
};

export const PlanningAction = ({
  active = false,
  disabled = false,
  onOpen,
}: PlanningActionProps) => (
  <ListItemButton
    active={active}
    disabled={disabled}
    descriptionPlacement="below"
    description="Review the proposed timeline and confirm the next steps with the team."
    startIcon={<Avatar name="Alex Morgan" size="md" imageProps={{ alt: '' }} />}
    onClick={onOpen}
  >
    Quarterly planning
  </ListItemButton>
);
```

`active` применяет фон текущей строки. Установите `selectionAppearance="accent"` для акцентной заливки выбранных строк при любом размещении описания; значение по умолчанию сохраняет существующее оформление выбора на основе индикатора. `focused` применяет общий фон выделения; контур видимого фокуса соответствует фактическому фокусу клавиатуры. Эти свойства не добавляют доступное состояние и не перемещают фокус. Нативная активация кнопки и поведение отключенного состояния остаются без изменений.

## Независимые элементы управления

Размещайте независимые кнопки и флажки рядом с `ListItemButton`, чтобы каждый из них сохранял собственные фокус и активацию. Не вкладывайте их в слоты содержимого или значка. У компонента нет слота `actions`. Используйте `ListItem` с корневым элементом `div` по умолчанию для [строки с независимыми элементами управления](https://docs.twenty.com/ru/ui/primitives/navigation/list-item.md#independent-controls), а также задайте поведение отключенного состояния и распространение событий для каждого элемента управления.

```tsx theme={null}
import { ListItemButton } from 'twenty-ui/components/navigation';
import { Button } from 'twenty-ui/primitives/input';

type ContactActionsProps = {
  onOpen: () => void;
  onDetails: () => void;
};

export const ContactActions = ({ onOpen, onDetails }: ContactActionsProps) => (
  <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
    <ListItemButton onClick={onOpen} description="Account owner">
      Alex Morgan
    </ListItemButton>
    <Button onClick={onDetails} aria-label="Open Alex Morgan's details">
      Details
    </Button>
  </div>
);
```

**Light**

[Соседние элементы управления действиями (light)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--independent-action\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Соседние элементы управления действиями (dark)](https://storybook.twenty.com/iframe.html?id=ui-components-listitembutton--independent-action\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-components-listitembutton--independent-action)

Используйте `ListItem` для пассивного содержимого, ссылок или пользовательских семантических контейнеров. Используйте существующие части элементов [Dropdown](https://docs.twenty.com/ru/ui/components/navigation/dropdown.md) и [Select](https://docs.twenty.com/ru/ui/primitives/input/select.md) в их всплывающих контейнерах, которые предоставляют роли и навигацию с помощью клавиатуры.

## Свойства

**active** `boolean`

Marks the open or current item independently of selection and focus. The caller supplies accessible state.

**color** `"danger" | "neutral"`

Color of the text and icons. `danger` marks a destructive action.

**description** `ReactNode`

Supporting text, placed according to `descriptionPlacement`.

**descriptionPlacement** `"below" | "end" | "inline"`

Places supporting content inline after the label, at the end, or below it with wrapping. Inline is the default.

**disabled** `boolean` (default: false)

Disables activation and applies the matching row appearance.

**endIcon** `ReactNode`

Icon rendered after the content.

**focusableWhenDisabled** `boolean` (default: false)

Keeps a disabled button focusable with aria-disabled while preventing activation.

**focused** `boolean`

Highlights the row without moving DOM focus.

**hasSubmenu** `boolean`

Displays a decorative submenu indicator.

**indicator** `"check" | "checkbox" | "none"`

Selection indicator: a check icon after the content or a checkbox before
it.

**ref** `Ref\<HTMLButtonElement\>`

Ref to the native HTMLButtonElement.

**selected** `boolean`

Applies selected styling and a decorative indicator. The caller supplies selection state and accessible semantics.

**selectionAppearance** `"accent" | "default"`

Selection styling independent of description placement. `default` preserves indicator-based styling; `accent` fills selected rows with the accent background.

**shortcut** `ShortcutDefinition`

Displays decorative shortcut hints. The caller registers the shortcuts.

**shortcutJoinLabel** `string`

Text between sequential shortcut steps. Defaults to `then`; pass an empty string to omit it.

**startIcon** `ReactNode`

Icon rendered before the content.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.