Skip to content

mkxml/preact-svg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preact-svg

NPM travis-ci

An <SVG> wrapper component that makes inline <svg> work in Preact.

CodePen Demo

preact-svg


Usage Example

import SVG from 'preact-svg';
import { h, render } from 'preact';
/** @jsx h */

const Main = () => (
	<SVG width="100" height="50">
		<path d="M0,0T 50,50 100,50 50,100Z" stroke="#000" stroke-width="2" />
	</SVG>
);

render(<Main />, document.body);

License

MIT

About

🎨 Use inline <svg> in Preact. 🌷

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%