# Invite User 1 - User Table with Dialog Invite

> A user management table with invite button that opens a dialog for sending bulk email invitations with role selection and textarea for multiple addresses.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/invite-user1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/invite-user1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/invite-user1-light-bbf24eb9e49550ab.png
- Registry item: https://shadcnblocks.com/r/invite-user1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/invite-user1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `cn`, `lucide-react`
- Registry items: `button`, `dialog`, `label`, `select`, `table`, `textarea`

## Files

### `block/invite-user1/invite-user1.tsx`

```tsx
"use client";

import { CornerDownLeft, UserRoundPlus } from "lucide-react";
import { cn } from "cn";

import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogContent,
  DialogFooter,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog";
import { Label } from "@/components/ui/label";
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table";
import { Textarea } from "@/components/ui/textarea";
interface InviteUser1Props {
  heading?: string;
  className?: string;
}

const InviteUser1 = ({
  heading = "Invite Users",
  className,
}: InviteUser1Props) => {
  const users = [
    {
      id: 1,
      name: "Sarah Johnson",
      email: "sarah.j@company.com",
      role: "Administrator",
      status: "Active",
    },
    {
      id: 2,
      name: "Michael Chen",
      email: "m.chen@company.com",
      role: "Collaborator",
      status: "Invited",
    },
  ];

  return (
    <section className="py-32">
      <div className="container flex flex-col gap-6">
        <div>
          <h2 className="text-2xl font-semibold tracking-tight">
            Team Members
          </h2>
          <p className="mt-2 text-sm text-muted-foreground">
            Manage and invite users to your team
          </p>
        </div>
        <Table>
          <TableHeader>
            <TableRow>
              <TableHead>Name</TableHead>
              <TableHead>Email</TableHead>
              <TableHead>Role</TableHead>
              <TableHead>Status</TableHead>
            </TableRow>
          </TableHeader>
          <TableBody>
            {users.map((user) => (
              <TableRow key={user.id}>
                <TableCell className="font-medium">{user.name}</TableCell>
                <TableCell>{user.email}</TableCell>
                <TableCell>{user.role}</TableCell>
                <TableCell>{user.status}</TableCell>
              </TableRow>
            ))}
          </TableBody>
        </Table>
        <Dialog>
          <DialogTrigger asChild>
            <Button className="w-fit">Invite Users</Button>
          </DialogTrigger>
          <DialogContent className={cn("gap-0 overflow-hidden p-0", className)}>
            <DialogTitle className="flex items-center gap-2 border-b p-4 text-sm font-medium">
              <UserRoundPlus className="size-4" />
              {heading}
            </DialogTitle>
            <form
              autoComplete="off"
              onSubmit={(e) => e.preventDefault()}
              className="flex flex-col gap-4 bg-muted pt-4"
            >
              <div className="flex flex-col gap-4 px-4">
                <div className="space-y-1">
                  <Label className="text-xs">Email addresses</Label>
                  <Textarea
                    style={{
                      resize: "none",
                      minHeight: "100px",
                    }}
                    placeholder="Enter email addresses..."
                  />
                </div>
                <div className="space-y-1">
                  <Label className="text-xs">Assign role</Label>
                  <Select defaultValue="collaborator">
                    <SelectTrigger className="w-full">
                      <SelectValue placeholder="Choose a role" />
                    </SelectTrigger>
                    <SelectContent>
                      <SelectItem value="collaborator">Collaborator</SelectItem>
                      <SelectItem value="administrator">
                        Administrator
                      </SelectItem>
                    </SelectContent>
                  </Select>
                </div>
              </div>
              <DialogFooter className="border-t bg-background px-4 py-3">
                <Button size="sm" type="submit">
                  Send Invitation <CornerDownLeft />
                </Button>
              </DialogFooter>
            </form>
          </DialogContent>
        </Dialog>
      </div>
    </section>
  );
};

export { InviteUser1 };
```
