Code Monkey home page Code Monkey logo

layout's Introduction

Layout

Layout is a responsive helper component that we use in our responsive designs at Walmart Labs.

This screenshot shows a simple multi-column layout using the Bootstrap grid.

Simple multi-column layout

In this case it's 3 columns wide in x-small and 4 columns wide in small.

In this next example we show specifying the widths of the individual columns (in 12 column layout values) for both x-small and small.

Layout with column sizes

Running the example

To install and run do:

npm install
npm run showcase

Usage

Default column options are based on a 12 column layout.

Simple Multi-Columns

Using the following props allows you to pass in a number of columns (max 12) (integer) to display the columns at a consistent width.

Each prop type correlates to a breakpoint:

  • x-small - integer Displays at <= 768px
  • small - integer Displays between 768px and 992px
  • medium - integer Displays between 992px and 1200px
  • large - integer Displays above 1200px

Options:

Number of columns: 1, 2, 3, 4, 6, 12

custom column widths at specific breakpoints

Using the following props allows you to pass in an array of column ratios. This is different than the above option.

  • x-small-sizes - Displays each child column at defined widths at <= 768px
  • small-sizes - Displays each child column at defined widths between 768px and 992px
  • medium-sizes - Displays each child column at defined widths between 992px and 1200px
  • large-sizes - Displays each child column at defined widths above 1200px

Options:

Array of width of columns: 1, 2, 3, 4, 6, 12

layout's People

Contributors

kenwheeler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.