Socket
Book a DemoInstallSign in
Socket

@fe.whnhouse/flex.box

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fe.whnhouse/flex.box

A Flex and Box React Component Wrapper around Flexbox.

1.0.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

flex.box

Installation

You can simply install this Repo via npm. It requires you to use styled-components and react (they are listed as peer dependencies of this project).

npm install @fe.whnhouse/flex.box

yarn add @fe.whnhouse/flex.box

Usage

The module exposes two Styled Components, FlexParent and FlexChild. Together, they allow the combination of all flex props, converted in a simple API:

interface IFlexChildProps {
  grow?: number
  shrink?: number
  order?: number
  alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'
  basis?: number | 'auto'
  style?: React.CSSProperties
}

interface IFlexParentProps {
  fullWidth?: boolean
  fullHeight?: boolean
  justify?: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between' | 'space-evenly'
  align?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline'
  alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between' | 'strech'
  direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse'
  wrap?: 'nowrap' | 'wrap' | 'wrap-reverse'
  style?: React.CSSProperties
}

The components can then simply be used like this:

const App = () => {
    return (
    <FlexParent direction="column justify="space-between" align="center">
        <FlexChild>First Child</FlexChild>
        <FlexChild>Second Child</FlexChild>
        <FlexChild>Third Child</FlexChild>
      </FlexParent>

    )
}

Example

The example folder provides a react-app using this module as example. Feel free to take a look.

Keywords

Flexbox

FAQs

Package last updated on 21 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.