Inviting a friendsimilar to
Discord
A consumer invite that skips the email form entirely. The people you want are already your friends, so the dialog lists them with a search box and an Invite button each, and the server link sits underneath for everyone else. Closing the dialog drops you back in the server, where the friend who accepted is announced in the channel and the ones still deciding wait in the member list with resend and revoke.
Every screen
The 4 steps in order. Pick one to open it in the preview above.
Installation
Part of shadcn/ui Pro
Pro unlocks one-command install of every flow in Radix UI, Base UI and React Aria, plus all 507 blocks, the Figma kit, themes and the MCP server for your AI editor.
Part of shadcn/ui Pro
Pro unlocks one-command install of every flow in Radix UI, Base UI and React Aria, plus all 507 blocks, the Figma kit, themes and the MCP server for your AI editor.
Why this flow works
Bring friends into a community server: a searchable friends list with one-tap invites, a copyable invite link with expiry and use limits, and the friend arriving in #general with a wave.
Invite people you already know, one tap each
Inside a social product the invitee is rarely a stranger with an email address. The dialog lists your friends with photos and presence, a search box narrows the list as you type, and each row has its own Invite button. No form, no submit: the row turns into "Sent" a moment later.
Rows say where each friend stands
A friend is in one of three states: not invited (Invite button), invited (a check and "Sent") or already a member ("Member", no button). Duplicates and existing members can’t be invited twice because the action simply isn’t there.
A link for everyone else, with its limits in plain words
Under the list sits the server’s invite link with a Copy button and one line that says how long it lasts ("expires in 7 days"). "Edit invite link" opens the settings: expiry, a maximum number of uses and temporary membership. Saving generates a new link and rewrites that line.
The outcome shows up where the user already is
Back in the server, the "Invite your friends" task is ticked, the friend who accepted is welcomed in #general with a Wave button and appears in the member list, and the friends still deciding wait under Invited. Pending invites can be resent, their link copied or revoked from a menu, and the count follows.
Step by step
- 01
Your new server
The server’s #general channel with a getting-started checklist; "Invite your friends" is the first task.
Inviting is the task that makes a new space useful, so it leads the checklist and is also one click away in the empty member list. The rest of the server is a wireframe sketch where your own app goes.
- 02
Invite friends
Search the friends list and invite people one by one, or copy the server’s invite link.
Direct invites to known friends convert best, so the list comes first. The link covers everyone who isn’t a friend yet, and its expiry is stated right under it.
- 03
Invite link settingsOptional
Choose how long the link works and how many times it can be used, optionally make membership temporary, and generate a new link.
A shared link travels further than the people it was meant for. Expiry and a use limit cap that, and a new link retires the old one without touching invites already sent.
- 04
A friend joins
Back in #general: the invite task is ticked, the friend who accepted is welcomed with a Wave button, and the other invite waits in the member list.
The result lands where the user already is. Waving gives a first message to send, and pending invites stay visible with resend and revoke instead of disappearing.
Built with shadcn/ui and Radix UI
- Button
- Input Group
- Select
- Switch
- Field
- Dropdown Menu
- Sonner
This is an original rebuild of the flow's structure, with its own brand, copy and artwork. Discord is a trademark of its owner; this page is not affiliated with or endorsed by Discord.
Frequently asked questions
Installing, adapting and theming this flow for Radix UI.
With a Pro plan, run npx shadcn@latest add @shadcnpro/flow-discord-inviting-a-friend. The shadcn CLI copies the flow into components/flows/discord-inviting-a-friend/ and adds the shadcn/ui components it uses. Base UI (@shadcnpro/base/flow-discord-inviting-a-friend) and React Aria (@shadcnpro/aria/flow-discord-inviting-a-friend) ship the same flow, with the same steps and copy.
No. It is an original rebuild of the structure of Discord's inviting teammates & friends flow, written from scratch with shadcn/ui, with its own brand, copy and artwork. Discord is a trademark of its owner, and this page is not affiliated with or endorsed by Discord.
Yes, the flow is a pattern, not a fixed template. Invite link settings is optional and can be left out on its own. A step you add should follow the same rules as the others, listed under Step anatomy in the flow spec, so it reads as part of the same flow.
Use the prompt in the Installation section. The agent installs the flow, then reads the flow spec at https://pro.shadcn.co/flows/discord-inviting-a-friend.md, which describes the layout, the rules every step follows, each step's fields and actions, and how to adapt the flow. That way it builds a version with your brand and your steps instead of a one-to-one copy.
The friends list is local sample data and nothing is sent: an invite marks the row as sent after a short delay, the link code comes from a fixed list, and the first friend you invite accepts as soon as you close the dialog. In a real app, send invites through your API, generate link codes on the server with their expiry and use limit, and add members when your backend reports that they joined.
Button, Input Group, Select, Switch, Field, Dropdown Menu and Sonner, in their Radix UI versions. Everything else is plain markup with Tailwind CSS.
Yes. The flow only uses semantic tokens such as bg-background, bg-card and text-muted-foreground, so it picks up your colours, radius and fonts and switches with dark mode. Use the theme menu above the preview to see it in the Pro themes.
Yes. Below the medium breakpoint the sketched server rail and channel list are hidden and #general fills the screen; below large the member list is hidden too. The invite dialogs take the full width minus a 16px margin, hide usernames next to names, and scroll inside when the screen is short.