1.0.1 • Published 5 years ago

@code.z/react-fixed-align v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

react-fixed-align is a very simple react component to create fixed positioned, full width and full height wrappper components. It uses position: fixed and display: flex internally which you could do easily by yourself. Really its that simple. But if you are lazy enough (like me 🥱) to repeat this in so many screens in your apps you could use the plugin. 😀✌️

Build Status Commitizen friendly semantic-release

Example

import React from "react";
import FixedScreen from "@code.z/react-fixed-align";
import classNames from "./App.module.scss";

function App() {
  return (
    <FixedScreen xAlign="center" yAlign="middle" className={classNames.wrapper}>
      <div style={loginStyles}>
        <h1>Login</h1>
        <input style={inputStyles} type="email" placeholder="email" />
        <input style={inputStyles} type="password" placeholder="password" />
        <button>Login</button>
      </div>
    </FixedScreen>
  );
}

export default App;

Note: If you set middleAlign to true then xAlign and yAlign will be ignored.

PropTypeDefaultRequiredDescription
elString"div"noWrapper element. Any html element
enableXScrollBooleanfalsenoEnable full width scrolling for content overflow
enableYScrollBooleanfalsenoEnable full height scrolling for content overflow
classNamestring-noDdd additional styles
middleAlignBooleanfalsenoMiddle align content
xAlignString"left"noHorizontally align content "left", "center", "right
yAlignString"top"novertically align content "top", "middle", "bottom"
styleObject-noOverride styles or add addtional styles

ENJOY 😀🤚

1.0.1

5 years ago

1.0.0

5 years ago