1.1.1 • Published 4 years ago

monument-ui v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Monument UI

NPM version NPM downloads

About

Monument UI is a JavaScript library which will help you add 3D element and text effect to existing components or to create new ones.

Demo

See plugin in action

How to Install

First, install the library in your project by npm:

$ npm install monument-ui

Or Yarn:

$ yarn add monument-ui

Getting Started

• Connect libary with project using ES6 import:

import { Element, Text } from 'monument-ui';

• Later create component and pass options:

<Element
  as={ /* component or DOM element */ }
  color={ /* color value */ }
  shadow={ /* shadow value */ }
  colorify={ /* true / false */ }
  perspective={ /* x, y */ }
  clickable={ /* 'push' / 'pull' */ }
  hoverable={ /* 'pull' / 'push' */ }
  touchable={ /* 'push' / 'pull' */ }
/>

<Text
  as={ /* component or DOM element */ }
  color={ /* color value */ }
  shadow={ /* shadow value */ }
  colorify={ /* true / false */ }
  perspective={ /* x, y */ }
/>

Props

Element component

NameTypeDefaultDescriptionAvailable options
colorstringColor of depth effectColor value in hex, rgb(a) etc.
shadowstringShadow added to elemente.g.: 10px 10px 20px #222a
colorifybooleanfalseChange color for each layerEnable true / disable false
perspectiveobject{ x: 5, y: 5 }Horizontal and vertical depth lengthObject with x and y values
clickablestringundefinedAction for element on click (only desktop)push (move down), pull (move up)
hoverablestringundefinedAction for element on hover (only desktop)pull (move up), push (move down)
touchablestringundefinedAction for element on touch (only mobile)push (move down), pull (move up)

Text component

NameTypeDefaultDescriptionAvailable options
colorstringColor of depth effectColor value in hex, rgb(a) etc.
shadowstringShadow added to texte.g.: 10px 10px 20px #222a
colorifybooleanfalseChange color for each layerEnable true / disable false
perspectiveobject{ x: 5, y: 5 }Horizontal and vertical depth lengthObject with x and y values

Example

export default function App() {
  // state, effects, etc.

  return (
    <Element
      as="button"
      clickable="push"
      color="#f00"
      perspective={{ x: 10, y: '-5em' }}
      style={{ /* style */ }}
    >
      <Text
        as="h2"
        color="#f00"
        colorify
        perspective={{ x: -4, y: 6 }}
      >
        Hello World!
      </Text>
    </Element>
  );
}

License

This project is licensed under the MIT License © 2018-present Jakub Biesiada

1.1.1

4 years ago

1.1.1-beta.2

4 years ago

1.1.1-beta.1

4 years ago

1.1.0

5 years ago

1.1.0-beta.2.1

5 years ago

1.1.0-beta.2

5 years ago

1.1.0-beta.1.2

5 years ago

1.1.0-beta.1.1

5 years ago

1.1.0-beta.1

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.5

5 years ago

1.0.0-beta.4

5 years ago

1.0.0-beta.3

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago

1.0.0-alpha.1

5 years ago

0.1.0-alpha.3

5 years ago

0.1.0-alpha.2

5 years ago

0.1.0-alpha.1

5 years ago

0.0.1

6 years ago