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

# Buttons

> BMoniButton, UtilityButton, and SwipeableActionRow.

## BMoniButton

The primary action button. Four visual variants, five sizes, optional icons, loading and disabled states, and a light haptic feedback on press.

```dart theme={null}
BMoniButton(
  onPressed: () {},
  text: 'Confirm',
  variant: BMoniButtonVariant.primary,  // primary | secondary | outline | ghost
  size: BMoniButtonSize.large,          // extraSmall | small | medium | large | custom
  icon: Icons.check,
  iconPosition: BMoniButtonIconPosition.leading, // leading | trailing
  isLoading: false,
  isDisabled: false,
)
```

### Convenience factories

```dart theme={null}
BMoniButton.primary(onPressed: () {}, text: 'Save')
BMoniButton.secondary(onPressed: () {}, text: 'Edit')
BMoniButton.outline(onPressed: () {}, text: 'Cancel')
BMoniButton.ghost(onPressed: () {}, text: 'Skip')
```

### Props

| Prop           | Type                      | Default   | Description                                                  |
| -------------- | ------------------------- | --------- | ------------------------------------------------------------ |
| `onPressed`    | `VoidCallback?`           | —         | Tap handler. Pass `null` to disable.                         |
| `text`         | `String`                  | —         | Button label.                                                |
| `variant`      | `BMoniButtonVariant`      | `primary` | Visual style.                                                |
| `size`         | `BMoniButtonSize`         | `large`   | Height and padding.                                          |
| `icon`         | `IconData?`               | `null`    | Optional icon.                                               |
| `iconPosition` | `BMoniButtonIconPosition` | `leading` | Position of the icon relative to the label.                  |
| `isLoading`    | `bool`                    | `false`   | Shows a circular progress indicator and disables the button. |
| `isDisabled`   | `bool`                    | `false`   | Disables the button without the loading state.               |

***

## UtilityButton

A square, icon-only button for compact toolbar or list actions.

```dart theme={null}
UtilityButton(
  onTap: () {},
  size: 36,
  backgroundColor: BMoniColors.brand600,
  icon: const Icon(Icons.add, color: Colors.white, size: 24),
)
```

***

## SwipeableActionRow

A list row that reveals a single action button when swiped left. A shared `ValueNotifier<String?>` ensures only one row is open at a time within the same list.

```dart theme={null}
final openItemId = ValueNotifier<String?>(null);

SwipeableActionRow(
  itemId: 'item-1',
  openItemId: openItemId,
  actionWidth: 72,
  actionColor: Colors.red,
  actionIcon: const Icon(Icons.delete, color: Colors.white),
  onActionPressed: () { /* handle delete */ },
  onTap: () { /* open detail */ },
  child: ListTile(title: const Text('Swipe me left')),
)
```

### Props

| Prop              | Type                     | Description                                                                     |
| ----------------- | ------------------------ | ------------------------------------------------------------------------------- |
| `itemId`          | `String`                 | Unique identifier for this row.                                                 |
| `openItemId`      | `ValueNotifier<String?>` | Shared notifier. Set to this row's `itemId` to open it, or `null` to close all. |
| `actionWidth`     | `double`                 | Width of the revealed action area.                                              |
| `actionColor`     | `Color`                  | Background colour of the action area.                                           |
| `actionIcon`      | `Widget`                 | Icon shown in the action area.                                                  |
| `onActionPressed` | `VoidCallback`           | Called when the revealed action is tapped.                                      |
| `onTap`           | `VoidCallback?`          | Called when the row itself is tapped.                                           |
| `child`           | `Widget`                 | The row content.                                                                |
