seact v0.1.17
Seact
| under development
example
import Seact from 'seact'
import sketch from 'sketch/dom'
const document = sketch.getSelectedDocument()
const page = document.selectedPage
Seact.render(
<group lock adjustToFit style={{ backgroundColor: '#e43', borderColor: '#ddd' }}>
<text frame={{ x: 200, y: 200, widht: 200, height: 200 }} text="hello wolrd" />
</group>,
page,
)usage
The library help build constructed layers to sketch board by jsx which uses the javascript API. To use this library, you should ensure your sketch version >= v49. And it is recommended to init your project through skpm.
insallation
npm install --save-dev seactbabel config
The example above ensure you're using compiler to transfrom jsx to valid javascript code like babel.
If you are using babel, you should install plugin to transform jsx
npm install --dev babel-plugin-transform-react-jsxThen you should set config in .babelrc:
{
"plugins": [["transform-react-jsx", { "pragma": "Seact.h" }]]
}7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago