Arrow icon
See all demos

Dynamic Font Size

Do you need font-size to be dynamic, and adjust according to another factor such as element height? The following demo shows you how to achieve that. Taking advantage of the calc() function, users can easily adjust font-size of an element according to its height.
Demo instructions
Use the resize tool to adjust element size, and observe how the font-size changes dynamically.
Dynamic Font Size

See the Pen JointJS: dynamic font-size by JointJS (@jointjs) on CodePen.

Made with JointJS+

Only available with the JointJS+ commercial license in the apps/ directory of your package. Don't have a license yet? Start a trial and use the source code of all our demos for free, with no strings attached, for 30 days.

Made with JointJS

Available in the JointJS open-source library which helps developers create simple visual applications in less time.

Speed up your development with a powerful library

Leverage a time-tested JavaScript diagramming library using the best of HTML5 and SVG to accelerate your development.