Skip to content
All blocks

[25] App

Team Members

An invite form over a table of members with avatars, a role select, status and a menu of actions.

1280px

Copy the code

One file with one component and its sample data. It needs @vaneui/ui and its stylesheet, set up as in the installation guide. It passes an onSubmit handler, so in the Next.js App Router add "use client" at the top of its file.

team-members.tsx

import { Avatar, Badge, Button, Card, Col, Container, IconButton, Input, Menu, MenuItem, PageTitle, Row, Section, Select, Table,
Tbody, Td, Text, Th, Thead, Tr } from "@vaneui/ui";
const members = [
{ name: "Ana Diaz", email: "ana@acme.com", role: "owner", status: "Active", seen: "Now" },
{ name: "Lee Park", email: "lee@acme.com", role: "admin", status: "Active", seen: "2h ago" },
{ name: "Sam Ortiz", email: "sam@acme.com", role: "member", status: "Active", seen: "Yesterday" },
{ name: "Mia Chen", email: "mia@acme.com", role: "member", status: "Invited", seen: "Never" },
];
function MailIcon() {
return (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<rect x="3" y="5" width="18" height="14" rx="2" /><path d="m3 7 9 6 9-6" />
</svg>
);
}
function MoreIcon() {
return (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
<circle cx="5" cy="12" r="1" /><circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" />
</svg>
);
}
export function TeamMembers() {
return (
<Section>
<Container itemsStretch>
<Col lg className="max-w-4xl">
<Col xs>
<PageTitle>Team members</PageTitle>
<Text secondary>4 of 10 seats used. Members can see every project in the workspace.</Text>
</Col>
<Row tag="form" mobileStack itemsStretch onSubmit={(e) => e.preventDefault()}>
<Input type="email" name="email" aria-label="Email to invite" startSection={<MailIcon />} placeholder="name@company.com" required />
<Select name="role" aria-label="Role" defaultValue="member" wFit noShrink mobileWFull>
<option value="member">Member</option>
<option value="admin">Admin</option>
</Select>
<Button type="submit" filled noShrink mobileWFull>Send invite</Button>
</Row>
<Card noPadding overflowXAuto>
<Table>
<Thead>
<Tr>
<Th scope="col">Member</Th>
<Th scope="col">Role</Th>
<Th scope="col" className="max-mobile:hidden">Status</Th>
<Th scope="col" className="max-mobile:hidden">Last active</Th>
<Th scope="col"><Text tag="span" srOnly>Actions</Text></Th>
</Tr>
</Thead>
<Tbody>
{members.map((m) => (
<Tr key={m.email}>
<Td className="align-middle">
<Row sm>
<Avatar sm name={m.name} alt="" />
<Col noGap className="min-w-0">
<Text sm fontMedium>{m.name}</Text>
<Text xs secondary>{m.email}</Text>
</Col>
</Row>
</Td>
<Td className="align-middle">
<Select aria-label={`Role of ${m.name}`} defaultValue={m.role} disabled={m.role === "owner"} wFit>
<option value="owner">Owner</option>
<option value="admin">Admin</option>
<option value="member">Member</option>
</Select>
</Td>
<Td className="max-mobile:hidden align-middle">
<Badge success={m.status === "Active"} warning={m.status === "Invited"} dot>{m.status}</Badge>
</Td>
<Td className="max-mobile:hidden whitespace-nowrap align-middle"><Text sm secondary>{m.seen}</Text></Td>
<Td textRight className="align-middle">
<Menu trigger={<IconButton ghost secondary aria-label={`Actions for ${m.name}`}><MoreIcon /></IconButton>}>
{m.status === "Invited" && <MenuItem>Resend invite</MenuItem>}
<MenuItem>Copy email</MenuItem>
<MenuItem danger disabled={m.role === "owner"}>Remove from team</MenuItem>
</Menu>
</Td>
</Tr>
))}
</Tbody>
</Table>
</Card>
</Col>
</Container>
</Section>
);
}

How it adapts

  • 768px and up: the invite field, the role and the button in one row, and every column of the table.
  • Below 768px: the invite form stacks, and the table drops the status and last-active columns.
  • The owner keeps a disabled role select and cannot be removed.

How these props work is in responsive page sections without breakpoint classes.

Adapt it with your coding agent

Add the VaneUI MCP server, and your agent reads the component docs and prop tables while it changes the block: the copy, the sample data or the layout.

$ claude mcp add vaneui -- npx -y @vaneui/mcp

Setup for other editors is in the AI assistants guide.