Members

A card of people, each with a role and a menu of actions.

Updated

Default

Team

People with access to this project.


<div class="mx-auto max-w-xl">
	{ui card, title: 'Team', description: 'People with access to this project.'}
		<ul class="flex flex-col gap-4">
			<li class="flex items-center gap-3">
				{ui avatar, initials: 'AL' /}
				<div class="grow">
					<p class="font-medium">Ada Lovelace</p>
					<p class="text-muted">[email protected]</p>
				</div>
				{ui badge, title: 'Owner' /}
			</li>
			<li class="flex items-center gap-3">
				{ui avatar, initials: 'GH' /}
				<div class="grow">
					<p class="font-medium">Grace Hopper</p>
					<p class="text-muted">[email protected]</p>
				</div>
				{ui badge, title: 'Editor', class: 'bg-well' /}
				{ui dropdown,
					title: 'Manage',
					triggerClass: 'button-outline',
					align: 'end',
				}
					{ui menu,
						items: [
							['title' => 'Change role', 'href' => '#'],
							['title' => 'Remove', 'href' => '#'],
						],
					/}
				{/ui}
			</li>
			<li class="flex items-center gap-3">
				{ui avatar, initials: 'AT' /}
				<div class="grow">
					<p class="font-medium">Alan Turing</p>
					<p class="text-muted">[email protected]</p>
				</div>
				{ui badge, title: 'Invited', class: 'badge-outline' /}
				{ui dropdown,
					title: 'Manage',
					triggerClass: 'button-outline',
					align: 'end',
				}
					{ui menu,
						items: [
							['title' => 'Resend invite', 'href' => '#'],
							['title' => 'Cancel invite', 'href' => '#'],
						],
					/}
				{/ui}
			</li>
		</ul>
		{block footer}
			{ui button, title: 'Invite someone', icon: 'plus' /}
		{/block}
	{/ui}
</div>

Each row is a flex line: an avatar, a growing block for the name and email, a badge for the role, and a dropdown for the actions. The owner has no dropdown because nothing can be done to them. class: 'badge-outline' on the badge marks someone not yet active.

The list element covers rows made only of a title, description and icon. Reach for this layout when a row needs a badge or its own actions.