Getting Started

Download Pixie

Download latest version of pixie and extract the .zip file. There's a single Pixie folder that contains the editor files, sourcecode, changelog, simple example file and documentation.

Quick Start

If you want to use or preview pixie fast without integrating it into existing project, you can use included example.html file. You can simply double click this file to view pixie locally, or you can upload all pixie files to your server and rename example.html to index.html

Integration

Before integrating pixie, make sure to copy assets folder from the .zip file to your server or anywhere else where the assets can be publicly accessed via a url (s3 bucket for example).

Vanilla JS

The snippet below includes minimal code necessary to get the editor running in a simple web file.

<!DOCTYPE html>
<html lang="en">
<head>
 <style>
    html, body, #editor-container {
      width: 100%;
      height: 100%;
    }
  </style>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no" />
  <title>Pixie Example</title>
  <script src="dist/pixie.umd.js"></script>
</head>
<body>
<div id="editor-container"></div>
<script>
  Pixie.init({
    selector: "#editor-container",
    baseUrl: 'assets',
    image: "assets/images/samples/sample1.jpg",
  });
</script>
</body>
</html>

A couple of notes about above example:

React JS

  1. Create a local_modules folder and paste pixie folder into it. 

  2. Install pixie locally by using this command from project root: npm install ./local_modules/pixie

  3. Now you can import Pixie module into your app as any other dependency.

The snippet below includes minimal code necessary to get the editor running in a react component.

import React, {useEffect} from "react";
import { Pixie } from "pixie";

export function EditorDemo() {
  useEffect(() => {
    Pixie.init({
      selector: "#container",
      baseUrl: "pixie",
      image: "pixie/images/samples/sample1.jpg",
    }).then((instance) => {
      // editor is fully loaded!
      console.log(instance);
    });
  }, []);
  return <div id="container" />;
}

The example above assumes that pixie assets are accessible at https://your-site.com/pixie url.

Angular / VueJs / Svelte etc.

Pixie can be installed in other frameworks using the ReactJs guide above. The only difference would be where and when Pixie.init is called.