0.0.5 • Published 2 years ago
xshape v0.0.5
xshape
Install
npm install xshape
Usage
import { useXShape, XShapeStage, URLImage, createRootMachine } from 'xshape';
// url is optional
// data format see: https://github.com/tony40508/xshape/blob/main/public/mockData.json
const rootMachine = createRootMachine('initial-shape-data-url');
function App() {
const {
componentProps,
// other props see: https://github.com/tony40508/xshape/blob/main/src/App.tsx
} = useXShape(rootMachine);
return (
<XShapeStage
{...componentProps}
// enable to configure finish condition in limited options
// see: https://github.com/tony40508/xshape/blob/main/src/utils/types.d.ts
handleMouseDown={(e) => {
componentProps.handleMouseDown(e, 'ctrl+click');
}}
>
{/* URLImage is optional */}
<URLImage url="background-image-url" />
</XShapeStage>
);
}
Run the example locally
npm install
npm run dev
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.1.22
2 years ago
0.1.19
2 years ago
0.1.18
2 years ago
0.1.17
2 years ago
0.1.14
2 years ago
0.1.13
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago
0.0.16
2 years ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago