@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
61 lines (50 loc) • 1.27 kB
Markdown
# DialogClose
**Type**: component
DialogClose - A close button that dismisses the dialog Can be placed anywhere within DialogContent to provide a close action. Typically used for custom close buttons in addition to the default X button. Automatically closes the dialog when activated and returns focus to the trigger.
## JSX Usage
```jsx
import { DialogClose } from '@neynar/ui';
<DialogClose
asChild={true}
className="value"
>
{/* Your content here */}
</DialogClose>
```
## Component Props
### asChild
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### className
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### children
- **Type**: `React.ReactNode`
- **Required**: No
- **Description**: No description available
## Examples
### Example 1
```tsx
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
```
### Example 2
```tsx
// Direct button without asChild
<DialogClose className="close-button">
Close Dialog
</DialogClose>
```
### Example 3
```tsx
// In footer with multiple actions
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Save</Button>
</DialogFooter>
```