0.0.5 • Published 9 months 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
9 months ago
0.0.4
1 year ago
0.0.3
1 year ago
0.1.22
1 year ago
0.1.19
1 year ago
0.1.18
1 year ago
0.1.17
1 year ago
0.1.14
1 year ago
0.1.13
1 year ago
0.1.12
1 year ago
0.1.11
1 year ago
0.1.10
1 year ago
0.1.9
1 year ago
0.1.3
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago
0.1.0
1 year ago
0.0.16
1 year ago
0.0.15
1 year ago
0.0.14
1 year ago
0.0.13
1 year ago
0.0.12
1 year ago
0.0.11
1 year ago
0.0.10
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago