Socket
Socket
Sign inDemoInstall

div

Package Overview
Dependencies
6
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    div

<Div row> Use flexbox with ease in React! </Div>


Version published
Weekly downloads
36
increased by38.46%
Maintainers
1
Install size
10.9 kB
Created
Weekly downloads
 

Readme

Source

div

<Div row> Use flexbox with ease in React! </Div>

NPM JavaScript Style Guide

Features

  • Easy to read & use flexbox!
  • Accepts all standard div props! (like style, className and id)
  • Typescript support!

Install

# with yarn:
yarn add div

# with npm:
npm install --save div

Usage

import React, { Component } from 'react'

import { Div } from 'div'

const Example = () => {
  return (
    <Div row>
      <Div column flex={1}>
        A third of the space
      </Div>
      <Div column flex={2}>
        Two thirds of space!
      </Div>
    </Div>
  )
}

Props

(All props are optional)

flex: {number | string}

  • Applies flex: {number}.
  • Reminder: the flex shorthand params are in this order: flex-grow, flex-shrink, flex-basis (without commas)

row: {boolean}

  • Makes div a flex row.
  • Applies display: flex and flex-direction: row.

column: {boolean}

  • Makes div a flex column.
  • Applies display: flex and flex-direction: column.

reverse: {boolean}

  • Reverses the flex-direction if column or row are specified.

wrap: {boolean}

  • Applies flex-wrap: 'wrap'.
  • By default, a div's flex-wrap is 'nowrap'.

center: {boolean}

  • Centers content if row or column are specified.
  • Applies justify-content: 'center' and align-items: 'center'.

License

MIT © Wulf

FAQs

Last updated on 27 Jan 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc