# choice.bulk

Picks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked

Component: [`<Action>`](https://www.prongs.dev/docs/components/action.md) · Renders: `<button>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md) · Comes from: [SaaS pack](https://www.prongs.dev/docs/intents/packs/saas.md)

## Example

```tsx
<td>
  <Action intent="choice.bulk" pressed={picked.has(row.id)} icon={picked.has(row.id) ? <SquareCheck /> : <Square />}
    label={`Select ${row.name}`} onClick={() => toggle(row.id)} />
</td>
```

Code that says `select`, `bulk`, `checkbox`, `pick` points here. `prongs check` warns when an element with this intent has a handler or label that points somewhere else.

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| Picks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked | `choice.bulk` (this page) |
| Narrowing which items are shown | [`choice.filter`](https://www.prongs.dev/docs/intents/choice/filter.md) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`control.ghost`](https://www.prongs.dev/docs/intents/ui.md#control-ghost)

## For registry authors

**Pack intent.** `prongs add saas` puts the saas pack’s intents in your registry. They are then yours like the starter intents: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How choice.bulk resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`control.base`](https://www.prongs.dev/docs/intents/ui.md#control-base) — Shape and behaviour shared by every button

  ```
  inline-flex shrink-0 items-center justify-center gap-2
  whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium
  transition-colors focus-visible:outline-none
  focus-visible:ring-2 focus-visible:ring-ring
  focus-visible:ring-offset-2 ring-offset-surface
  disabled:pointer-events-none disabled:opacity-50
  aria-disabled:pointer-events-none aria-disabled:opacity-50
  data-[tone=danger]:[--row-fg:var(--destructive)]
  ```

- [`control.ghost`](https://www.prongs.dev/docs/intents/ui.md#control-ghost) — No fill until hovered

  ```
  text-foreground hover:bg-surface-hover
  data-[tone=danger]:text-destructive
  ```

- `choice.bulk` (this page) — Picks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked

Final classes

```
inline-flex shrink-0 items-center justify-center gap-2
whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium
transition-colors focus-visible:outline-none
focus-visible:ring-2 focus-visible:ring-ring
focus-visible:ring-offset-2 ring-offset-surface
disabled:pointer-events-none disabled:opacity-50
aria-disabled:pointer-events-none aria-disabled:opacity-50
data-[tone=danger]:[--row-fg:var(--destructive)] text-foreground
hover:bg-surface-hover data-[tone=danger]:text-destructive
```

Definition

```ts
'choice.bulk': {
  kind: 'semantic',
  description: 'Picks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked',
  refs: ['control.ghost'],
  keywords: ['select', 'bulk', 'checkbox', 'pick'],
  notFor: [
    { context: 'narrowing which items are shown', instead: 'choice.filter' },
  ],
},
```
