# Alignment

> Align the content to the start, center, or end 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-04).

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

## Install

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

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

const aligns = ['start', 'center', 'end'] as const

export function Popover04() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-3">
      {aligns.map((align) => (
        <Popover key={align}>
          <PopoverTrigger
            render={
              <Button variant="outline" className="w-full justify-between">
                <span className="capitalize">Align {align}</span>
                <span className="text-muted-foreground text-xs">Open ↓</span>
              </Button>
            }
          />
          <PopoverContent align={align} className="w-32 px-3 py-2 text-sm">
            <span className="font-medium capitalize">{align}</span>
          </PopoverContent>
        </Popover>
      ))}
    </div>
  )
}
```
