New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-flexbox-slim

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flexbox-slim

Flexbox in React but slim

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-flexbox-slim

NPM

Customizable flexbox grid system for React


Installation

npm install --save react-flexbox-slim


Important Information

  • 12 column grid system by default
  • Utilizing the <Grid> component/wrapper, you can fully customize the grid system (number of columns and breakpoints)
  • The <Grid> component uses the Context API to pass down any customization
  • See the examples for more information
  • We provide esm and umd modules
    • By default, esm is imported
    • To import umd use:
    const { Row, Column } = require('react-flexbox-slim/lib/bundle.umd.js')
    

Defaults

// breakpoints
{
  xs: '0px',
  sm: '540px',
  md: '768px',
  lg: '992px',
  xl: '1200px',
}
// maxColumns
12

Examples

// Basic 12 column grid system, using defaults
<Row justifyContent='center'>
  <Column xs={12} sm={4} md={6} lg={6} xl={3}>
    <p>Hello,</p>
  </Column>
  <Column xs={12} sm={4} md={6} lg={6} xl={3}>
    <p>World!</p>
  </Column>
</Row>
// Customized grid system
const customBreakpoints = {
  xs: '0px',
  sm: '500px',
  md: '800px',
  lg: '1000px',
  xl: '1600px',
};

const customMaxColumns = 16;

<Grid breakpoints={customBreakpoints} maxColumns={customMaxColumns}>
  <Row justifyContent='center'>
    /* Now you can use 16 column grid system */
    <Column xs={16} sm={4} md={6} lg={6} xl={3}>
        <p>Hello,</p>
    </Column>
    <Column xs={16} sm={4} md={6} lg={6} xl={3}>
        <p>World!</p>
    </Column>
  </Row>
</Grid>

Components and Properties

ComponentProps
<Grid>See here for Grid props
<Row>
NameTypeDefaultOne Of
directionString'row'
  • 'row'
  • 'row-reverse'
  • 'column'
  • 'column-reverse'
wrapString'wrap'
  • 'nowrap'
  • 'wrap'
  • 'wrap-reverse'
justifyContentString'flex-start'
  • 'flex-start'
  • 'flex-end'
  • 'center'
  • 'space-between'
alignContentString'flex-start'
  • 'flex-start'
  • 'flex-end'
  • 'center'
  • 'space-between'
  • 'space-around'
  • 'space-evenly'
  • 'stretch'
alignItemsString'flex-start'
  • 'flex-start'
  • 'flex-end'
  • 'center'
  • 'baseline'
  • 'stretch'
<Column>
NameTypeDefault
xsNumber12
smNumber12
mdNumber12
lgNumber12
xlNumber12

Grid Props

NameType
breakpointsObject (see below for shape)
maxColumnsNumber

  • breakpoints

If you wish to only change a single breakpoint value, you may do so. We will combine the default breakpoint values with the object you supplied

Note: this may cause issues with media queries

// breakpoints prop must be of the following shape:
<Grid 
  breakpoints={{
    xs: String,
    sm: String,
    md: String,
    lg: String,
    xl: String
  }}
>

  • maxColumns

Allows you to specify the number of columns for the entire grid system

<Grid maxColumns={16}>

Keywords

FAQs

Package last updated on 27 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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc