Blocks

Messaging

Everything people expect from a messaging app, in one block: direct messages, groups and channels in one list, threads, search across everything, and the small things like drafts, receipts and "typing…". On a phone it becomes list, conversation, details, with a way back from each.

Examples

A workspace

Open a conversation and send something: people type back, and your message goes from Sent to Read. Try a thread in #translation, the voice note in Observatory crew, search with filters, and Forward, Pin or Save from a message's menu. Narrow the window to see the phone layout.

Pick a conversation

Or start a new one with anyone in your workspace.

New conversation

Pick one person for a direct message, or several for a group.

People

No one by that name.

Forward message

To
<script lang="ts">
	import { onMount } from 'svelte';
	import Button from '#lib/ui/Button.svelte';
	import Messaging from '#lib/blocks/messaging/Messaging.svelte';
	import { createMock } from '#lib/blocks/messaging/mock.js';

	const api = createMock();
	// Stops the demo's pretend replies when the example goes away.
	onMount(() => () => api.stop());
	let failing = $state(false);
	let reset: ReturnType<typeof setTimeout> | undefined;
	onMount(() => () => clearTimeout(reset));
</script>

<div class="demo">
	<div class="frame"><Messaging {api} label="Bayt al-Hikma" initial="crew" /></div>
	<Button
		variant="secondary"
		size="sm"
		onclick={() => {
			api.failNext();
			failing = true;
			clearTimeout(reset);
			reset = setTimeout(() => (failing = false), 1500);
		}}>{failing ? 'The next request will fail' : 'Fail the next request'}</Button
	>
</div>

<style>
	.demo {
		display: grid;
		justify-items: start;
		gap: 1rem;
		inline-size: 100%;
	}
	.frame {
		inline-size: 100%;
		block-size: min(40rem, 85dvh);
	}
</style>

A new workspace

Before anyone has written: start a direct message or a named group.

Pick a conversation

Or start a new one with anyone in your workspace.

New conversation

Pick one person for a direct message, or several for a group.

People

No one by that name.

Forward message

To
<script lang="ts">
	import { onMount } from 'svelte';
	import Messaging from '#lib/blocks/messaging/Messaging.svelte';
	import { createMock } from '#lib/blocks/messaging/mock.js';

	const api = createMock({ empty: true });
	onMount(() => () => api.stop());
</script>

<div class="frame"><Messaging {api} label="New workspace" /></div>

<style>
	.frame {
		inline-size: 100%;
		block-size: 30rem;
	}
</style>

Installation

npx sinaui add blocks/messaging

What's included

  • One list for direct messages, groups and channels: pinned first, unread in bold with counts, an @ for mentions, muted ones quieter, and archived ones out of the way.
  • Search every message, or one conversation, by words, person, date, or whether it has a picture, file or link. A result opens its conversation at that message.
  • Threads beside the conversation, or full screen on a phone.
  • Forward to another conversation, pin, save for later, edit with a visible history, and delete for yourself or for everyone.
  • Pictures, files, voice messages and link previews; read receipts, "seen by" in groups, typing and last seen.
  • Details for each conversation: members and who's online, pinned messages, shared pictures and files, notifications, pin and archive.
  • Unsent text is kept per conversation while you move between them.
  • Loading, empty and error states everywhere, with a way to try again.

Keyboard

Everything in Chat's keyboard table, plus Tab through the list, the conversation and its details, and Escape to close a dialog.

Introduction
Theming
Changelog
Button
Action button
Confirm button
Copy button
Hold to confirm
Split button
Calendar
Checkbox
Color picker
Combobox
Date picker
Date range picker
File drop
Form
Input
Mention input
Multi select
Number field
OTP input
Password input
Phone input
Radio cards
Radio group
Rich text editor
Search field
Segmented control
Select
Signature pad
Slider
Switch
Tag input
Upload
Wheel picker
Textarea
Time field
Toggle group
Toolbar
Alert dialog
Command palette
Context menu
Dialog
Drawer
Dropdown
Hover card
Popover
Tooltip
Announcement bar
Alert
Empty state
Meter
Progress
Rolling number
Skeleton
Spinner
Toast
Avatar
Avatar group
Badge
Card
Carousel
Chart
Chat
Code block
Data table
Folder
Kbd
Mind map
Resizable panels
Scroll area
Separator
Sortable
Table
Tag group
Virtual list
Audio player
Image
Image compare
Video
Visualizer
Breadcrumb
File tree
Menubar
Navigation menu
Pagination
Sidebar layout
Stepper
Tabs
Alarm clock
Clock
Dynamic island
Fluid orb
Hourglass
Stopwatch
Timer
AI chat
AI media
Auth
Board
Booking
Dashboard
File explorer
Messaging
Notifications
Settings
Team
Overview
Pricing
Agent chat
Calendar
Voice agent
Mail inbox
CMS
Blog
Marketing site
E-commerce
AI agents
SaaS landing page
SaaS app
Accordion
Dark theme
Light theme