---
title: "Morphing Toolbar"
url: "https://sanyam.sh/lab/morphing-toolbar"
date: "2026-11-08"
---

# Morphing Toolbar

Pick a tool and draw. Esc steps back.

a drawing toolbar that becomes each tool's options: pick the pen and the bar morphs into its colours and width, and its glyph flies over to become back.

key insight: every view is mounted the whole time and only the top of a stack shows. a change of view springs the bar to the new view's width, slides the two views a few pixels, and flies whatever they share across as a clone.

escape steps back, v, p, s, t and e pick a tool, and shift squares a shape or snaps a line.

- Source: https://github.com/SanyamPunia/www/blob/main/components/labs/morphing-toolbar/toolbar.tsx
