Skip to content

Canvas text baseline alignment

The textBaseline property changes where glyphs sit relative to a y-coordinate—critical when mixing text with shapes or icons. MDN documents the full enum; this demo renders two canvases for comparison.

Align labels to vector geometry using explicit baselines rather than magic offsets.

Interactive demo

textBaseline

Released under the MIT License.