Skip to content

subschema/subschema-image

Repository files navigation

Subschema Image

Allows for uploading of an image with a preview.

##Demo See it in action here

Or run it

  git clone https://github.com/subschema/subschema-image.git
  cd subschema-image
  npm install
  npm run hot &
  open http://localhost:8082

##Installation

 $ npm install subschema-image
``

##Usage
```jsx

 import React, {Component} from 'react';
 import Subschema, {loader, Form} from 'Subschema';
 import imageloader from 'subschema-image';
 
 loader.addLoader(imageloader);
 
 //A simple Schema for this demo.
 var schema = {
     schema: {
         image: {
             "type": "Image",
             "help": "Single Image"
         },
         images: {
             "type": "ImageList",
             "help": "Multiple Images"
         }
     }
 }
 
 export default class App extends Component {
 
     render() {
         return <div>
             <h3>Subschema Image Type</h3>
             <Form schema={schema}/>
         </div>
     }
 }