Skip to content

CanvasPanel

Stable

A side panel for a document, code or design that stays after the chat message.

Also known as canvas, artboard, workspace

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Versioned document

With more than one version, Previous and Next appear and turn off at the ends.

When to use it

A side panel for work that lasts longer than one message, such as a document, code or a design. It keeps versions, so people can go back while the chat moves on.

Made of: Title · Version buttons · Regenerate · Your own buttons · Close · Scrolling content

Use it for

  • A draft document or code that the assistant keeps editing.
  • Moving between versions of the same piece of work.
  • The right side of SplitCanvasTemplate.

Not for

  • A reply that only matters in the conversation: use Message.
  • A code snippet inside a reply: use CodeBlock.

Do and avoid

Do. Work that will change sits in a panel, with its versions kept.
Avoid. A one-line reply in a side panel pulls people away from the chat.

Do

  • Give the panel a height. It fills it and scrolls its own content.
  • Use it for content that stays after the message that made it.
  • Start version numbers at 1, and update the content when the version changes.
  • Mark made content with an AI label in your own buttons area.

Avoid

  • Do not use it for one-off messages. Replies belong in the conversation.
  • Do not put the main controls for making things inside it. They belong in the main column.
  • Do not give a version count above 1 without saying which version is shown, or the buttons stay hidden.

On a phone

  • It is a side panel with no phone layout of its own, so on a phone you must give it the full screen or a sheet yourself.
  • It fills the height of its parent and scrolls its content inside, so the parent needs a set height.
  • The title is cut to one line and the version, regenerate and close controls wrap below it. Each control has a 44px tap area on a touch screen.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started