Invite Members Dialog
revola/invite-membersFreeComponent
A responsive dialog for inviting team members with email inputs and magic link - drawer on mobile, modal on desktop.
Install it
npx shadcn@latest add https://revola.sameerjs.com/r/invite-members.jsonSource
1"use client";23import { useId, useRef, useState } from "react";45import { CheckIcon, CopyIcon, UserRoundPlusIcon } from "lucide-react";67import { Button } from "@/components/ui/button";8import { Input } from "@/components/ui/input";9import { Label } from "@/components/ui/label";10import {11 ResponsiveDialog,12 ResponsiveDialogContent,13 ResponsiveDialogDescription,14 ResponsiveDialogHeader,15 ResponsiveDialogTitle,16 ResponsiveDialogTrigger,17} from "@/components/ui/revola";18import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";19import { cn } from "@/lib/utils";2021export default function InviteMembersDialog() {22 const id = useId();23 const [emails, setEmails] = useState(["mark@yourcompany.com", "jane@yourcompany.com", ""]);24 const [copied, setCopied] = useState<boolean>(false);25 const inputRef = useRef<HTMLInputElement>(null);26 const lastInputRef = useRef<HTMLInputElement>(null);2728 const addEmail = () => {29 setEmails([...emails, ""]);30 };3132 const handleEmailChange = (index: number, value: string) => {33 const newEmails = [...emails];34 newEmails[index] = value;35 setEmails(newEmails);36 };3738 const handleCopy = () => {39 if (inputRef.current) {40 navigator.clipboard.writeText(inputRef.current.value);41 setCopied(true);42 setTimeout(() => setCopied(false), 1500);43 }44 };4546 return (47 <ResponsiveDialog>48 <ResponsiveDialogTrigger asChild>49 <Button variant="outline" className="h-12 rounded-full px-6 capitalize">50 Invite Members51 </Button>52 </ResponsiveDialogTrigger>53 <ResponsiveDialogContent54 className="sm:max-w-sm"55 onOpenAutoFocus={(e) => {56 e.preventDefault();57 lastInputRef.current?.focus();58 }}59 >60 <div className="space-y-4 overflow-y-auto p-6 max-sm:pt-4">61 <div className="flex flex-col gap-2">62 <div className="flex size-11 shrink-0 items-center justify-center rounded-full border" aria-hidden="true">63 <UserRoundPlusIcon className="opacity-80" size={16} />64 </div>65 <ResponsiveDialogHeader className="text-left">66 <ResponsiveDialogTitle>Invite team members</ResponsiveDialogTitle>67 <ResponsiveDialogDescription>Invite teammates to earn free components.</ResponsiveDialogDescription>68 </ResponsiveDialogHeader>69 </div>70 <form className="space-y-5">71 <div className="space-y-4">72// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from revola
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alert Dialogalert-dialog | revola | Components | Free | no deps | |
| Alert Dialog with Iconalert-dialog-with-icon | revola | Components | Free | 1 dep | |
| Change Plan Dialogchange-plan | revola | Components | Free | 1 dep | |
| Checkout Dialogcheckout | revola | Components | Free | 2 deps | |
| Credit Card Dialogcredit-card | revola | Components | Free | 2 deps | |
| Custom Scrollbar Dialogcustom-scrollbar | revola | Components | Free | no deps | |
| Delete Project Dialogdelete-project | revola | Components | Free | 1 dep | |
| Edit Profile Dialogedit-profile | revola | Components | Free | 1 dep · 3 files |
