Imgix APIsRendering APITextText Background Radius

Text Background Radius

txt-radius

The txt-radius parameter rounds the corners of the box drawn by txt-bg. It requires txt-bg; on its own it does nothing.

The value is either a number of pixels or a decimal fraction of the font size, so txt-radius=0.5 is half the font size regardless of how large the text is rendered. A large enough radius rounds the box all the way into a pill, which is the usual shape for a badge or a tag.

Square corners, the default
sandbox-demo
txt-radius=0.2 is 20% of the font size
sandbox-demo
txt-radius=0.6 rounds into a pill
sandbox-demo
A pill badge
sandbox-demo