Installation
Dependencies
This component requires the following dependencies:button- shadcn/ui button componentdialog- shadcn/ui dialog componentinput- shadcn/ui input componentlabel- shadcn/ui label componentswitch- shadcn/ui switch component
Usage
Features
- Form input - Text input for workspace name with required field indicator
- Privacy toggle - Switch component for private workspace setting
- Styled sections - Separated footer with muted background
- Descriptive text - Clear explanations for workspace purpose and privacy
- Custom padding - Uses
p-0on content and custom padding on sections - Required field - Visual indicator with red asterisk
- Rounded footer - Bottom corners rounded to match dialog styling
Component Structure
The component includes:Dialogwith controlled stateDialogTriggerbuttonDialogContentwith custom padding (p-0)DialogHeaderwith title and descriptive text- Form element containing two sections
- Main section with workspace name input
- Footer section with:
- Muted background (
bg-muted) - Border top separation
- Rounded bottom corners
- Switch component for privacy setting
- Helper text explaining the privacy option
- Muted background (
The dialog uses
p-0 on DialogContent and applies padding to individual sections (px-6 pt-4, px-6 pb-4, px-6 py-4) for precise control over spacing. The footer section uses bg-muted and border-t to create visual separation.