1.2.0 • Published 3 years ago

pikaso-react v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

use-pikaso

React hook for Pikaso

Language Test, Build and Publish npm coverage

Install

NPM

npm install use-pikaso --save

Yarn

yard add use-pikaso

Getting Started

import React, { useEffect } from 'react'
import usePikaso from 'use-pikaso'

export function Component() {
  const [ref, editor] = usePikaso()
  
 useEffect(() => {
    if (!editor) {
      return
    }
    
    editor.shapes.circle.insert({
      x: 100,
      y: 100,
      radius: 20,
      fill: 'red'
    })
  }, [editor])

  return (
    <div
      ref={ref}
      style={{
        width: '400px',
        height: '400px'
      }}
    />
  )
}

Documentation

https://github.com/pikasojs/pikaso

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago