@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
40 lines (31 loc) • 959 B
Markdown
# AlertDialogTrigger
**Type**: component
Trigger element that opens the alert dialog The element that opens the alert dialog when activated. Usually a button, but can be any interactive element through composition. When opened, the dialog will trap focus and require user interaction before continuing.
## JSX Usage
```jsx
import { AlertDialogTrigger } from '@neynar/ui';
<AlertDialogTrigger
asChild={true}
/>
```
## Component Props
### asChild
- **Type**: `boolean`
- **Required**: No
- **Description**: Render as child element, merging props and behavior
## Examples
```tsx
// Direct usage
<AlertDialogTrigger>
Delete Account
</AlertDialogTrigger>
// Composition with Button component
<AlertDialogTrigger asChild>
<Button variant="destructive">Delete Account</Button>
</AlertDialogTrigger>
// Composition with custom element
<AlertDialogTrigger asChild>
<button className="custom-trigger">Custom Trigger</button>
</AlertDialogTrigger>
```
/