# Liveblocks Design

Use this reference when designing or building Liveblocks product interfaces. It
summarizes the public design system at [https://liveblocks.io/design](https://liveblocks.io/design) for agents, automation, and contributors who need compact product UI
guidance.

## Principles

- Make collaboration feel calm, fast, and trustworthy. The interface should
  clarify what changed, who changed it, and what the user can do next.
- Prefer predictable product patterns over one-off invention. Reuse design
  system components before creating new UI.
- Keep density purposeful. Product screens should support scanning, comparison,
  and quick recovery without feeling cramped.
- Ship accessible defaults. Keyboard support, focus states, contrast, semantic
  markup, and reduced-motion behavior are part of the component contract.
- Optimize for developers and operators. Explain constraints plainly, surface
  exact values, and link to the relevant next step.

## Visual Design

- Use the product design system for dashboard and tool interfaces. Start with
  the component pages under [Product components](https://liveblocks.io/design/product).
- Align to the grid, baseline, and visible edges. Adjust by 1px when optical
  alignment reads better than pure geometry.
- Preserve hierarchy with spacing, weight, and contrast before adding more
  color.
- Use tabular numbers for counts, limits, billing values, and metrics.
- Keep icon and text lockups balanced: matching stroke weight, optical size,
  spacing, and color.
- Avoid color-only meaning. Pair status colors with labels, icons, or helper
  copy.
- Design empty, loading, dense, and error states before considering a component
  complete.

## Interaction

- Interactive elements must be keyboard reachable and expose visible
  `:focus-visible` states.
- Use native elements first: `button` for actions, links for navigation,
  `label` with form controls, and tables for tabular data.
- Keep hit targets at least 24px on desktop and 44px on touch devices.
- Loading buttons keep their original label and show progress only after the
  request starts.
- Text inputs submit on Enter. Textareas insert a newline on Enter and submit on
  Cmd/Ctrl+Enter when the surrounding flow supports keyboard submission.
- Compose product form controls with `Field`, `FieldLabel`, and optional
  `FieldDescription` / `FieldError`. Connect labels with matching `htmlFor`
  and `id`, and descriptions with `aria-describedby`. Use `FieldSet` and
  `FieldLegend` for related controls. React Hook Form's `FormItem` already
  composes `Field`.
- Validate after input, not while blocking typing. On submit, show inline errors
  and focus the first invalid field.
- Confirm destructive actions or provide a clear undo window.
- URL state should reflect filters, tabs, pagination, and expanded panels when
  users need to share or restore the view.

## Voice & Content

Copy is part of the design. Keep it precise, human, and free of filler.

- Use sentence case for product UI labels, buttons, titles, tabs, helper text,
  and toasts. Preserve exact product names and acronyms such as Liveblocks, Yjs,
  API, and SSO.
- Name actions with a verb and a noun: `Create project`, `Delete member`,
  `Copy secret key`. Avoid `Confirm`, `OK`, and bare verbs when the object
  is unclear.
- Write errors as what happened plus what to do next: `Invite failed. This
  email is already a member. Choose a different address.`
- Toasts name the specific thing that changed, omit the trailing period, and
  never say `successfully`: `Project deleted`, not `Successfully deleted
  the project.`
- Empty states point to the first useful action: `No rooms yet. Create a room
  or connect the SDK to see activity here.`
- In-progress states use the present participle with an ellipsis:
  `Creating…`, `Saving…`, `Syncing…`.
- Use numerals for counts and limits: `3 projects`, `50 rooms`,
  `10 MB`.
- Use curly quotes, the ellipsis character, and concrete nouns. Skip
  `please`, marketing superlatives, and vague reassurance.
- Prefer direct recovery copy over apologies: `Refresh the page to reconnect`
  instead of `Sorry, something went wrong.`

## Motion

Use motion only when it clarifies a change. Most product interactions should
feel instant; `0ms` is often the right duration for repeated actions such as
keyboard shortcuts, command menus, row selection, and toggles.

- When motion helps reveal or move an element, keep it short and physical.
- Use `cubic-bezier(0.175, 0.885, 0.32, 1.1)` for short reveal transitions
  that need a crisp, slightly physical feel.
- Target roughly 150ms for state changes, 200ms for popovers and tooltips, and
  300ms for overlays, sheets, and dialogs.
- Avoid long, looping, or attention-grabbing animation in product workflows.
- Animate compositor-friendly properties such as `transform` and `opacity`.
  Avoid layout properties such as `top`, `left`, `width`, and `height`.
- Make animations interruptible. A user who reverses direction, presses Escape,
  or changes selection should never wait for motion to finish.
- Set transform origins so motion starts where the element physically belongs:
  popovers from their trigger, drawers from their edge, dialogs from center.
- Honor `prefers-reduced-motion` by removing nonessential motion and replacing
  spatial movement with immediate opacity or state changes.

## Accessibility

- Every icon-only button needs a descriptive `aria-label`.
- Decorative elements should be hidden from assistive technology.
- Use polite `aria-live` regions for toast and inline validation updates.
- Focus must move into dialogs and return to the trigger when they close.
- Avoid disabling browser zoom, paste, or password-manager behavior.
- Skeletons should mirror final layout to avoid layout shift.
- Dates, times, numbers, and currency should be locale aware.

## Product Components

Use these components for Liveblocks dashboard, account, billing, and internal
tooling interfaces.

- [Alert Dialog](https://liveblocks.io/design/product/alert-dialog): A modal dialog that interrupts the user with important content and expects a response.
- [Avatar](https://liveblocks.io/design/product/avatar): An avatar with either initials on a nice background, or an image, rounded or round.
- [Badge](https://liveblocks.io/design/product/badge): Displays a badge or a component that looks like a badge.
- [Banner](https://liveblocks.io/design/product/banner): A banner displays a prominent message.
- [Button](https://liveblocks.io/design/product/button): A button triggers an event or action. They let users know what will happen next.
- [Button Set](https://liveblocks.io/design/product/button-set): Provides single user input from a selection of options.
- [Calendar](https://liveblocks.io/design/product/calendar): A date picker calendar with single and range selection modes.
- [Checkbox](https://liveblocks.io/design/product/checkbox): A checkbox is an input control that allows a user to select one or more options from a number of choices.
- [Code Block](https://liveblocks.io/design/product/code-block): A code block with syntax highlighting.
- [Code Editor](https://liveblocks.io/design/product/code-editor): An inline code editor component.
- [Code Highlight](https://liveblocks.io/design/product/code-highlight): Syntax highlighted code.
- [Context Menu](https://liveblocks.io/design/product/context-menu): A menu that appears when right-clicking.
- [Date Picker](https://liveblocks.io/design/product/date-picker): Date picker components for selecting single dates or date ranges.
- [Dialog](https://liveblocks.io/design/product/dialog): A modal dialog overlay.
- [Divider](https://liveblocks.io/design/product/divider): Visually or semantically separates content.
- [Dropdown Menu](https://liveblocks.io/design/product/dropdown-menu): Displays a menu to the user such as a set of actions or functions, triggered by a button.
- [Field](https://liveblocks.io/design/product/field): Labels, controls, help text, and validation messages for product forms.
- [Form](https://liveblocks.io/design/product/form): Accessible form components with validation support using react-hook-form.
- [Hover Card](https://liveblocks.io/design/product/hover-card): For sighted users to preview content available behind a link.
- [Input](https://liveblocks.io/design/product/input): Displays a form input field.
- [Input OTP](https://liveblocks.io/design/product/input-otp): Accessible one-time password component with copy-paste functionality.
- [Label](https://liveblocks.io/design/product/label): Renders an accessible label associated with controls.
- [Line Chart](https://liveblocks.io/design/product/line-chart): A line chart component.
- [Multiselect](https://liveblocks.io/design/product/multiselect): A multiselect dropdown.
- [Popover](https://liveblocks.io/design/product/popover): Displays rich content in a portal, triggered by a button.
- [Progress Bar](https://liveblocks.io/design/product/progress-bar): Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
- [Progress Circle](https://liveblocks.io/design/product/progress-circle): A circular progress indicator.
- [Radio Group](https://liveblocks.io/design/product/radio-group): A group of radio buttons.
- [Select](https://liveblocks.io/design/product/select): A select dropdown component.
- [Sheet](https://liveblocks.io/design/product/sheet): A slide-out panel that appears from the edge of the screen, commonly used for mobile.
- [Skeleton](https://liveblocks.io/design/product/skeleton): A placeholder loading animation for content that is loading.
- [Spinner](https://liveblocks.io/design/product/spinner): An indicator that can be used to show a loading state.
- [Stack](https://liveblocks.io/design/product/stack): A flexible stack layout.
- [Switch](https://liveblocks.io/design/product/switch): A toggle switch.
- [Tabs](https://liveblocks.io/design/product/tabs): A tabs component.
- [Textarea](https://liveblocks.io/design/product/textarea): Displays a form textarea or a component that looks like a textarea.
- [Theme Switcher](https://liveblocks.io/design/product/theme-switcher): A compact control for switching between light, dark, and system themes with animated transitions.
- [Toast](https://liveblocks.io/design/product/toast): Toast notifications to display feedback to users.
- [Tooltip](https://liveblocks.io/design/product/tooltip): A tooltip component.

## Related Resources

- [Design system](https://liveblocks.io/design)
- [Product components](https://liveblocks.io/design/product)
- [Design reference as Markdown](https://liveblocks.io/design.md)
