@sonnetjs/svg
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

sonnetjs/svg

sonnetjs/svg is a library for creating SVG elements using a simple and declarative API.

Features

  • Create SVG elements using a simple and declarative API.
  • Set attributes and properties of SVG elements using chainable methods.
  • Add children to SVG elements using children method.

Usage

  1. Run the following command to create a new SonnetJS project.
npx create-sonnet-app@latest
  1. Change directory to the newly created project.
cd [my-sonnet-app]
  1. Install the dependencies
npm i
  1. Install sonnetjs/svg
npm i @sonnetjs/svg
  1. Start the development server
npm run dev

Documentation

This is a simple example of how to use sonnetjs/svg to create an SVG element.

import { svg, rect } from '@sonnetjs/svg';

const element = svg()
  .width(100)
  .height(100)
  .children(rect().x(10).y(10).width(80).height(80).fill('red'));

License

sonnetjs/svg is licensed under the MIT license.

Package Sidebar

Install

npm i @sonnetjs/svg

Weekly Downloads

1

Version

0.0.11

License

MIT

Unpacked Size

85.6 kB

Total Files

4

Last publish

Collaborators

  • htmujahid