@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
53 lines (42 loc) • 1.22 kB
Markdown
# PopoverAnchor
**Type**: component
PopoverAnchor - Optional anchor element for custom positioning Use PopoverAnchor when you need the popover to position relative to an element other than the trigger. This is useful for complex layouts where the visual trigger and positioning reference should be different elements.
## JSX Usage
```jsx
import { PopoverAnchor } from '@neynar/ui';
<PopoverAnchor
asChild={true}
className="value"
>
{/* Your content here */}
</PopoverAnchor>
```
## Component Props
### asChild
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### children
- **Type**: `React.ReactNode`
- **Required**: No
- **Description**: No description available
### className
- **Type**: `string`
- **Required**: No
- **Description**: No description available
## Examples
```tsx
<Popover>
<PopoverAnchor asChild>
<div className="relative">
<span>Reference element for positioning</span>
</div>
</PopoverAnchor>
<PopoverTrigger asChild>
<Button>Open (positioned relative to anchor)</Button>
</PopoverTrigger>
<PopoverContent>
<p>This popover positions relative to the anchor, not the trigger</p>
</PopoverContent>
</Popover>
```