Blocks

Board

Cards in lists, moved by dragging: across lists, up and down, with lists that reorder too. For tasks, pipelines and anything that moves through stages.

Examples

A translation workshop

Drag a card to another list, or a list by its grip. On a phone, press and hold a card first. Add cards at the bottom of a list; open one to rename it, label it or delete it. The board is kept in this browser.

  • To translate

  • In progress

  • Checking

  • Copied

Press Space to pick up, arrow keys to move, Space again to drop, Escape to cancel.

Press Space to pick up. Arrows move it, Space drops it, Escape puts it back. Enter opens the card.

Card

<script lang="ts">
	import { onMount } from 'svelte';
	import Board, { type BoardColumn, type BoardLabel } from '#lib/blocks/board/Board.svelte';

	const labels: BoardLabel[] = [
		{ id: 'greek', name: 'Greek', color: 'var(--ui-accent)' },
		{ id: 'persian', name: 'Persian', color: 'var(--ui-warning)' },
		{ id: 'urgent', name: 'Urgent', color: 'var(--ui-danger)' },
		{ id: 'review', name: 'Review', color: 'light-dark(#0369a1, #38bdf8)' }
	];
	const sample = (): BoardColumn[] => [
		{
			id: 'todo',
			title: 'To translate',
			cards: [
				{ id: 'euclid', title: "Euclid's Elements, books 7–9", labels: ['greek'] },
				{ id: 'ptolemy', title: 'Ptolemy’s Almagest', labels: ['greek', 'urgent'] },
				{ id: 'kalila', title: 'Kalila and Dimna', labels: ['persian'] }
			]
		},
		{
			id: 'doing',
			title: 'In progress',
			cards: [
				{ id: 'galen', title: 'Galen on the pulse', labels: ['greek'] },
				{ id: 'sindhind', title: 'Star tables (Zij al-Sindhind)', labels: ['review'] }
			]
		},
		{
			id: 'check',
			title: 'Checking',
			cards: [{ id: 'aristotle', title: 'Aristotle, On the Soul', labels: ['greek', 'review'] }]
		},
		{ id: 'done', title: 'Copied', cards: [{ id: 'hippocrates', title: 'Hippocratic aphorisms' }] }
	];

	// Kept in this browser, so the board is as you left it after a reload.
	const KEY = 'sinaui-board';
	let columns = $state(sample());
	let loaded = false;
	onMount(() => {
		try {
			const saved = JSON.parse(localStorage.getItem(KEY) ?? 'null');
			if (Array.isArray(saved)) columns = saved;
		} catch {
			// Nothing saved, or storage blocked: start from the demo board.
		}
		loaded = true;
	});
	$effect(() => {
		const json = JSON.stringify(columns);
		if (!loaded) return;
		try {
			localStorage.setItem(KEY, json);
		} catch {
			// Storage blocked: changes last until reload.
		}
	});
</script>

<Board bind:columns {labels} label="Translation board" />

Installation

npx sinaui add blocks/board

Props

PropTypeDefault
columns{ id, title, cards: { id, title, labels? }[] }[] (bindable)required
labels{ id, name, color }[][]
labelstring'Board'
onmove(card, { column, index }) => Promise<void> | void: save a drop

A dropped card moves at once. If onmove rejects, it goes back to where it was picked up and a short message says so (mount <Toaster /> once in your layout to show it).

Keyboard

KeyDoes
SpacePick up a card, then drop it
↑ ↓Move it within its list
← →Move it to the next list
EscapePut it back
EnterOpen the card

Accessibility

  • Every pick-up, move and drop is announced with the list and position.
  • Lists are named with their card count; each card is a button.
  • Dragging near the board's sides or a list's ends scrolls it.
  • With reduced motion, cards move without sliding or tilting.
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