# Buy sell hold toggle group

> Buy sell hold toggle group

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-button-group-43).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-button-group-43
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-button-group-43-light-4b38c6075019bad5.png
- Registry item: https://reui.io/r/new-york-v4/c-button-group-43.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-button-group-43.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `button`, `button-group`

## Files

### `c-button-group-43.tsx`

```tsx
"use client"

import { useState } from "react"

import { Button } from "@/components/ui/button"
import { ButtonGroup } from "@/components/ui/button-group"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

const stances = [
  {
    id: "buy",
    label: "Buy",
    icon: (
      <IconPlaceholder
        lucide="TrendingUpIcon"
        tabler="IconTrendingUp"
        hugeicons="TrendUp01Icon"
        phosphor="TrendUpIcon"
        remixicon="RiStockLine"
        aria-hidden="true"
      />
    ),
  },
  {
    id: "hold",
    label: "Hold",
    icon: (
      <IconPlaceholder
        lucide="MinusIcon"
        tabler="IconMinus"
        hugeicons="Minus02Icon"
        phosphor="MinusIcon"
        remixicon="RiSubtractLine"
        aria-hidden="true"
      />
    ),
  },
  {
    id: "sell",
    label: "Sell",
    icon: (
      <IconPlaceholder
        lucide="TrendingDownIcon"
        tabler="IconTrendingDown"
        hugeicons="TrendDown01Icon"
        phosphor="TrendDownIcon"
        remixicon="RiArrowDownLine"
        aria-hidden="true"
      />
    ),
  },
]

export function Pattern() {
  const [active, setActive] = useState<string | null>(null)

  return (
    <ButtonGroup>
      {stances.map((stance) => (
        <Button
          key={stance.id}
          variant={active === stance.id ? "default" : "outline"}
          onClick={() => setActive(active === stance.id ? null : stance.id)}
        >
          {stance.icon}
          {stance.label}
        </Button>
      ))}
    </ButtonGroup>
  )
}
```
