Skip to content

SplitCanvasTemplate

Stable

Chat or controls on the left, and the thing you are making on the right.

Also known as split layout, canvas layout, two pane layout

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

A prompt and a canvas

A document on the right. On a narrow screen the two sides stack.

When to use it

Splits the main area in two: chat or controls on the left, the thing being made on the right. The work stays in view while the person keeps changing it.

Made of: Left side · Canvas (right side)

Use it for

  • Editing a document or code with the assistant beside it.
  • A studio with the prompt and options on the left and the chosen draft on the right.
  • Any screen where the result must stay visible while people work.

Not for

Do and avoid

Welcome email

Make it shorter

Welcome email

Hi Sam, thanks for joining. Here is how to get started this week.

Do. Sketch: the draft stays in view on the right while you change it.

Baggage question

Are bags free?
Assistant: Yes, up to 20 kg.
Avoid. Sketch: a plain chat answer on the canvas wastes half the screen.

Do

  • Put a CanvasPanel on the right so it fills the height.
  • Use it when the result should stay in view while the person makes changes.
  • Keep the controls for making things on the left.
  • Check the stacked layout on small screens, where the canvas comes after the left side.

Avoid

  • Do not use it for plain chat. ThreadTemplate is the right frame.
  • Do not put lasting content on the left and short-lived content on the canvas. The canvas is for the thing being made.
  • Do not set fixed heights on the sides. The template handles overflow itself.

On a phone

  • Below the lg breakpoint the conversation and the canvas stack in one column, conversation first, and the page scrolls as one.
  • The stacked canvas is at least 22.5rem tall; from lg up the two sit side by side and scroll separately.
  • Side padding is 1rem on a phone and 1.5rem from sm.

Build your next AI screen with Tattva.

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

Get started