# Sides

> Place the popover on top, right, bottom, or left of the trigger.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/popover-03).

- Page, with a live preview: https://shadcn.exchange/r/flx/popover-03
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/popover-03-light-fc15ea13eecd04c9.png
- Registry item: https://ui.flexnative.com/r/popover-03.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/popover-03.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: `popover`, `button`

## Files

### `registry/patterns/popover/popover-03.tsx`

```tsx
import { Button } from '@/components/ui/button'
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from '@/components/ui/popover'

const sides = ['top', 'right', 'bottom', 'left'] as const

export function Popover03() {
  return (
    <div className="grid w-fit grid-cols-3 grid-rows-3 gap-2">
      <div />
      <SideButton side="top" />
      <div />
      <SideButton side="left" />
      <div />
      <SideButton side="right" />
      <div />
      <SideButton side="bottom" />
      <div />
    </div>
  )
}

function SideButton({ side }: { side: (typeof sides)[number] }) {
  return (
    <Popover>
      <PopoverTrigger
        render={
          <Button variant="outline" size="sm" className="w-24 capitalize">
            {side}
          </Button>
        }
      />
      <PopoverContent side={side} className="w-auto px-3 py-2 text-sm">
        Side <span className="font-medium">{side}</span>
      </PopoverContent>
    </Popover>
  )
}
```
