BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blok/collaboration

Collaboration

blok/collaboration
FreeBlock

A user collaboration blok with nested popovers for adding and removing team members with search functionality.

Install it

npx shadcn@latest add https://blok.sitecore.com/r/collaboration.json

Source

src/components/bloks/collaboration.tsxblok.sitecore.com/r/collaboration.json · first 6 KB
1"use client"; // Remove this line if you are not using Next.js
2
3import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
4import { Button } from "@/components/ui/button";
5import { Card } from "@/components/ui/card";
6import {
7 Popover,
8 PopoverContent,
9 PopoverTrigger,
10} from "@/components/ui/popover";
11import {
12 SearchInput,
13 SearchInputClearButton,
14 SearchInputField,
15 SearchInputLeftElement,
16 SearchInputRightElement,
17} from "@/components/ui/search-input";
18import { Icon } from "@/lib/icon";
19import { mdiAccountPlusOutline, mdiClose, mdiMagnify, mdiPlus } from "@mdi/js";
20import type * as React from "react";
21import { useMemo, useState } from "react";
22
23// Types
24
25/** Base user interface - extend this for custom user types */
26export interface User {
27 id: string;
28 name: string;
29 avatarUrl?: string;
30 email?: string;
31 [key: string]: unknown; // Allow additional properties
32}
33
34export interface CollaborationProps<T extends User = User> {
35 /** Currently added users */
36 users: T[];
37 /** Current user (shown with "You" label) */
38 currentUser?: T;
39 /** Available users to add (shown in dialog) - can be managed externally for API support */
40 availableUsers: T[];
41 /** Maximum number of avatars to display in the stack */
42 maxDisplayAvatars?: number;
43 /** Callback when a user is added */
44 onAddUser?: (user: T) => void;
45 /** Callback when a user is removed */
46 onRemoveUser?: (userId: string) => void;
47 /** Allow removing the current user (default: false) */
48 allowRemoveCurrentUser?: boolean;
49 /** Custom empty state message */
50 emptyStateMessage?: string;
51 /** Title for the users section */
52 title?: string;
53 /** Custom class name */
54 className?: string;
55
56 // API & Customization Props
57
58 /** Callback when search query changes - use for API-based search */
59 onSearch?: (query: string) => void;
60 /** Shows loading spinner in search results */
61 isSearching?: boolean;
62 /** Custom search placeholder text */
63 searchPlaceholder?: string;
64 /** Custom function to get user's display name */
65 getDisplayName?: (user: T) => string;
66 /** Custom function to get user's avatar URL */
67 getAvatarUrl?: (user: T) => string | undefined;
68 /** Custom function to get user's unique ID */
69 getUserId?: (user: T) => string;
70 /** Disable built-in client-side filtering (use when doing API search) */
71 disableClientFilter?: boolean;
72 /** Custom empty search results message */
73 emptySearchMessage?: string;
74 /** Custom "all users added" message */
75// … truncated

What it pulls in

npm packages

  • @mdi/js

Other registry items

  • https://blok.sitecore.com/r/theme.json
  • https://blok.sitecore.com/r/avatar.json
  • https://blok.sitecore.com/r/button.json
  • https://blok.sitecore.com/r/card.json
  • https://blok.sitecore.com/r/search-input.json
  • https://blok.sitecore.com/r/popover.json
  • https://blok.sitecore.com/r/icon.json

Files it writes

  • src/components/bloks/collaboration.tsx

Facts

Registry
blok
Type
registry:block
Access
Free
Files written
1
Licence
NOASSERTION
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

blok.sitecore.com Sitecore/blok on GitHub Raw registry item This item as JSON

More from blok

All 72 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
All site sectionall-siteblokBlocksFree1 dep
Dashboard widgetdashboard-widgetblokBlocksFree1 dep
Pinned site sectionpinned-siteblokBlocksFree1 dep · 2 files
Sidebar RHSsidebar-rhsblokBlocksFree2 deps
Site cardsite-cardblokBlocksFree1 dep
TopbartopbarblokBlocksFree1 dep · 2 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex