0.0.6 • Published 5 years ago

react-avery v0.0.6

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

React Avery

This library makes it easy to create labels which can be printed on-to a 10 label avery sheet.

Name tag story screenshots

Print preview

Name tag print preview

Avery sheet form

Avery sheet form

Main components

Example:

import { StandardRectangle } from 'react-avery';

const { Layout, Sheet } = StandardRectangle;

Sheet

This component by default renders a preview normally, and a proportionally accurate sheet for print media.

Sheet props

{
    selectedLocation: number, // 1-10
    selectLocation: (label: number) => void,
    LabelInsertComponent: ({ location: number }) => JSX.Element,
    className: string, // optional class names for Sheet wrapper
    style: object, // optional styles for Sheet wrapper
}

Layout

This component wraps Sheet to create a flex layout around it, putting form on the left and the sheet on the right. To accomplish this it takes form as its children.

Layout by default renders the SheetPreview normally and SheetPrintView during print media.

Layout props

{
    ...sheetProps,
    children: JSX.Element, // Form for sheet labels
    className: string, // optional class names for Form wrapper
    style: object, // optional styles for Form wrapper
}

Running storybook

Ensure that react is installed globally, it's a peer dependency for react-avery

npm install -g react
npm run link-local
npm run storybook
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago