Use Text Outlines in React with SVG, JSX, or TSX

Keep UI labels, headings, and translated copy as HTML. A fixed wordmark is a good candidate for SVG paths because its letterforms travel with the file.
Generate and choose a format
Reproduce this example in the generator with AV prefilled. The sample uses ABeeZee Regular at size 96, fill on, no stroke, and Separate Characters off. In the output area, choose React JSX for JavaScript or React TSX for TypeScript. Use the standalone SVG for an image with its own fixed fill.
| Format | Use it for |
|---|---|
| SVG | A cached image with a known intrinsic ratio |
| JSX | An inline SVG component in a JavaScript project |
| TSX | A typed component that accepts size, color, and accessibility props |
Render the TSX export
Download the AV component
and save it next to your component as AVComponent.tsx. It uses an actual
exported path, sets the intrinsic width and height, and uses currentColor for
the fill.
import AVComponent from './AVComponent'
export function BrandLabel() {
return (
<AVComponent
role="img"
aria-label="AV"
style={{ width: 64, height: 'auto', color: '#4f46e5' }}
/>
)
}
export function DecoratedHeading() {
return (
<h2>
<AVComponent
aria-hidden="true"
focusable="false"
width={32}
height={31}
/>
AV
</h2>
)
}
Check sizing, color, and accessibility
- Sizing. Keep the exported
viewBox. Set the width in CSS and let height follow the aspect ratio. If you add a stroke, check the edges at the smallest display size. - Theme color. The current TSX export moves the generated group's fill onto the root
<svg>so thefillprop can control it. You can also choosecurrentColorin the React export tool. When pasting raw SVG markup by hand, change the nested<g>fill tocurrentColoror remove it so it can inherit. A fill on a child takes precedence over inheritance. - Accessible name. Give a meaningful inline SVG
role="img"and an appropriate name. If adjacent text already says the same thing and the graphic is decorative, hide it from assistive technology. An external SVG used via<img>usesalt.
FAQ
Can I keep the letters editable? Use HTML for text that changes or needs translation. Use an SVG <text> element when the lettering must belong to the graphic and you can control the font.
When should I separate characters? Enable it only when you need to style, position, or animate individual glyphs. Inspect ligatures if you need separate letters.
For static assets and SVG imports in Next.js, see the Next.js guide.
Related tools and guides
Try the tool with your own text
Open the main TextToSVG tool to test the settings from this blog post in your own browser, or return to the blog for more workflow articles.