Skip to content
Brok UI

Loading…

No results

Accept Invite

Open source

Centered auth card inviting a user to join an organisation, showing the org avatar, inviter, role badge, an access-list divided by a separator, and accept/decline actions.

Responsive Dark mode RTL Localized SEO

Preview

resources/views/blocks/accept-invite.blade.php Blade
@props([
    'organisation' => 'Acme Inc.',
    'orgInitial' => 'A',
    'inviterName' => 'Jane Doe',
    'inviterAvatar' => null,
    'role' => 'Member',
    'acceptAction' => '#',
    'declineHref' => '#',
    'currentEmail' => 'you@example.com',
    'switchHref' => '#',
])

{{--
    Accept Invitation — a centered auth-adjacent card on a subtle muted backdrop.
    The inviting organisation's initial avatar anchors a "You've been invited to
    join {Organisation}" heading. Below sit the inviter (avatar + name), the role
    the recipient will receive (badge), and a separator-divided list of what they
    will get access to. A primary "Accept invitation" POST action and an outline
    "Decline" escape hatch close the card, with a footer naming the signed-in
    account and a "switch account" link.

    Static Blade: the accept control is a real POST form with @csrf. All dynamic
    values are echoed with {{ }} so consumer-supplied content is auto-escaped.
--}}

@php
    $access = [
        ['title' => 'Shared workspaces', 'detail' => 'Collaborate on projects and boards'],
        ['title' => 'Team documents', 'detail' => 'Read and edit shared files'],
        ['title' => 'Activity & notifications', 'detail' => 'Stay in sync with your team'],
    ];
@endphp

<section
    data-slot="accept-invite"
    aria-labelledby="accept-invite-01-heading"
    {{ $attributes->merge(['class' => 'flex min-h-svh items-center justify-center bg-muted/30 px-4 py-12 text-foreground']) }}
>
    <x-ui.card class="w-full max-w-md">
        <x-ui.card.header class="items-center text-center">
            <x-ui.avatar size="lg" shape="rounded" :alt="$organisation" class="mb-4 bg-primary/10 text-primary">
                {{ $orgInitial }}
            </x-ui.avatar>
            <x-ui.card.title id="accept-invite-01-heading" class="text-xl">
                {{ __('You\'ve been invited to join :organisation', ['organisation' => $organisation]) }}
            </x-ui.card.title>
            <x-ui.card.description>
                {{ __('Review the details below and accept to get started.') }}
            </x-ui.card.description>
        </x-ui.card.header>

        <x-ui.card.content class="space-y-6">
            <div class="flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/40 p-6">
                <div class="flex min-w-0 items-center gap-4">
                    <x-ui.avatar size="sm" :src="$inviterAvatar" :alt="$inviterName" fallback="{{ mb_substr($inviterName, 0, 1) }}" />
                    <span class="min-w-0">
                        <span class="block text-xs text-muted-foreground">{{ __('Invited by') }}</span>
                        <span class="block truncate text-sm font-medium text-foreground">{{ $inviterName }}</span>
                    </span>
                </div>
                <x-ui.badge variant="secondary">{{ __($role) }}</x-ui.badge>
            </div>

            <div>
                <h3 class="mb-4 text-sm font-medium text-foreground">{{ __('What you\'ll get access to') }}</h3>
                <ul role="list" class="space-y-4">
                    @foreach ($access as $i => $item)
                        @if ($i > 0)
                            <li aria-hidden="true"><x-ui.separator /></li>
                        @endif
                        <li class="flex items-start gap-4">
                            <span class="mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary" aria-hidden="true">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="size-3">
                                    <path d="m5 12 4.5 4.5L19 7" />
                                </svg>
                            </span>
                            <span>
                                <span class="block text-sm font-medium text-foreground">{{ __($item['title']) }}</span>
                                <span class="block text-xs text-muted-foreground">{{ __($item['detail']) }}</span>
                            </span>
                        </li>
                    @endforeach
                </ul>
            </div>

            <div class="space-y-4">
                <form method="POST" action="{{ $acceptAction }}">
                    @csrf
                    <x-ui.button type="submit" class="w-full">{{ __('Accept invitation') }}</x-ui.button>
                </form>
                <x-ui.button :href="$declineHref" variant="ghost" class="w-full">{{ __('Decline') }}</x-ui.button>
            </div>
        </x-ui.card.content>

        <x-ui.card.footer class="justify-center">
            <p class="text-center text-sm text-muted-foreground">
                {{ __('Signed in as') }} <span class="font-medium text-foreground">{{ $currentEmail }}</span>
                <span aria-hidden="true">—</span>
                <a href="{{ $switchHref }}" class="font-medium text-link hover:underline">{{ __('switch account') }}</a>
            </p>
        </x-ui.card.footer>
    </x-ui.card>
</section>

Installation

terminal
php artisan ui:add blocks/accept-invite

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/accept-invite writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.0.5
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/accept-invite.blade.php

Registry dependencies

card avatar badge button separator

Package dependencies

composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

accept-invite.md
# Brok UI block: Accept Invite (`accept-invite`)

Centered auth card inviting a user to join an organisation, showing the org avatar, inviter, role badge, an access-list divided by a separator, and accept/decline actions.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/accept-invite
```

## Render it

```blade
<x-blocks.accept-invite />
```

## Props

- `organisation` (string, default `Acme Inc.`)
- `org-initial` (string, default `A`)
- `inviter-name` (string, default `Jane Doe`)
- `inviter-avatar` (mixed|null, default `null`)
- `role` (string, default `Member`)
- `accept-action` (string, default `#`)
- `decline-href` (string, default `#`)
- `current-email` (string, default `[email protected]`)
- `switch-href` (string, default `#`)

## Use when

- Showing a user an invitation to join a specific organisation, with the inviter's identity, an access list and a role badge.
- Offering a clear accept/decline choice plus a footer naming the signed-in account and a switch-account escape hatch.

## Avoid when

- Use auth-sign-in or auth-sign-up for ordinary sign-in or sign-up; accept-invite only confirms an existing organisation invitation.

## Rules

- Render the installed block with `<x-blocks.accept-invite />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/accept-invite
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/accept-invite.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Showing a user an invitation to join a specific organisation, with the inviter's identity, an access list and a role badge.
  • Offering a clear accept/decline choice plus a footer naming the signed-in account and a switch-account escape hatch.

Avoid when

  • Use auth-sign-in or auth-sign-up for ordinary sign-in or sign-up; accept-invite only confirms an existing organisation invitation.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
root accept-invite

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.accept-invite />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/accept-invite.blade.php Blade
@props([
    'organisation' => 'Acme Inc.',
    'orgInitial' => 'A',
    'inviterName' => 'Jane Doe',
    'inviterAvatar' => null,
    'role' => 'Member',
    'acceptAction' => '#',
    'declineHref' => '#',
    'currentEmail' => 'you@example.com',
    'switchHref' => '#',
])

{{--
    Accept Invitation — a centered auth-adjacent card on a subtle muted backdrop.
    The inviting organisation's initial avatar anchors a "You've been invited to
    join {Organisation}" heading. Below sit the inviter (avatar + name), the role
    the recipient will receive (badge), and a separator-divided list of what they
    will get access to. A primary "Accept invitation" POST action and an outline
    "Decline" escape hatch close the card, with a footer naming the signed-in
    account and a "switch account" link.

    Static Blade: the accept control is a real POST form with @csrf. All dynamic
    values are echoed with {{ }} so consumer-supplied content is auto-escaped.
--}}

@php
    $access = [
        ['title' => 'Shared workspaces', 'detail' => 'Collaborate on projects and boards'],
        ['title' => 'Team documents', 'detail' => 'Read and edit shared files'],
        ['title' => 'Activity & notifications', 'detail' => 'Stay in sync with your team'],
    ];
@endphp

<section
    data-slot="accept-invite"
    aria-labelledby="accept-invite-01-heading"
    {{ $attributes->merge(['class' => 'flex min-h-svh items-center justify-center bg-muted/30 px-4 py-12 text-foreground']) }}
>
    <x-ui.card class="w-full max-w-md">
        <x-ui.card.header class="items-center text-center">
            <x-ui.avatar size="lg" shape="rounded" :alt="$organisation" class="mb-4 bg-primary/10 text-primary">
                {{ $orgInitial }}
            </x-ui.avatar>
            <x-ui.card.title id="accept-invite-01-heading" class="text-xl">
                {{ __('You\'ve been invited to join :organisation', ['organisation' => $organisation]) }}
            </x-ui.card.title>
            <x-ui.card.description>
                {{ __('Review the details below and accept to get started.') }}
            </x-ui.card.description>
        </x-ui.card.header>

        <x-ui.card.content class="space-y-6">
            <div class="flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/40 p-6">
                <div class="flex min-w-0 items-center gap-4">
                    <x-ui.avatar size="sm" :src="$inviterAvatar" :alt="$inviterName" fallback="{{ mb_substr($inviterName, 0, 1) }}" />
                    <span class="min-w-0">
                        <span class="block text-xs text-muted-foreground">{{ __('Invited by') }}</span>
                        <span class="block truncate text-sm font-medium text-foreground">{{ $inviterName }}</span>
                    </span>
                </div>
                <x-ui.badge variant="secondary">{{ __($role) }}</x-ui.badge>
            </div>

            <div>
                <h3 class="mb-4 text-sm font-medium text-foreground">{{ __('What you\'ll get access to') }}</h3>
                <ul role="list" class="space-y-4">
                    @foreach ($access as $i => $item)
                        @if ($i > 0)
                            <li aria-hidden="true"><x-ui.separator /></li>
                        @endif
                        <li class="flex items-start gap-4">
                            <span class="mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary" aria-hidden="true">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" class="size-3">
                                    <path d="m5 12 4.5 4.5L19 7" />
                                </svg>
                            </span>
                            <span>
                                <span class="block text-sm font-medium text-foreground">{{ __($item['title']) }}</span>
                                <span class="block text-xs text-muted-foreground">{{ __($item['detail']) }}</span>
                            </span>
                        </li>
                    @endforeach
                </ul>
            </div>

            <div class="space-y-4">
                <form method="POST" action="{{ $acceptAction }}">
                    @csrf
                    <x-ui.button type="submit" class="w-full">{{ __('Accept invitation') }}</x-ui.button>
                </form>
                <x-ui.button :href="$declineHref" variant="ghost" class="w-full">{{ __('Decline') }}</x-ui.button>
            </div>
        </x-ui.card.content>

        <x-ui.card.footer class="justify-center">
            <p class="text-center text-sm text-muted-foreground">
                {{ __('Signed in as') }} <span class="font-medium text-foreground">{{ $currentEmail }}</span>
                <span aria-hidden="true">—</span>
                <a href="{{ $switchHref }}" class="font-medium text-link hover:underline">{{ __('switch account') }}</a>
            </p>
        </x-ui.card.footer>
    </x-ui.card>
</section>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.5
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0