Skip to content

developit/preact-svg

Folders and files

NameName
Last commit message
Last commit date
Jun 6, 2016
May 9, 2016
May 9, 2016
Nov 20, 2015
May 9, 2016
Nov 20, 2015
Nov 20, 2015
Jun 7, 2016
Nov 20, 2015
Jul 17, 2016
Jun 7, 2016
Sep 7, 2016
Jun 7, 2016

Repository files navigation

Notice: preact-svg is deprecated and obsolete.

As of Preact 5.x, SVG is now supported right out of the box, so there is no need for preact-svg.

preact-svg

NPM travis-ci

This library provides an <SVG> wrapper component that makes inline <svg> work in Preact version 4 and prior.

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