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

layabout

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

layabout

Simple layout components for React

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-81.25%
Maintainers
1
Weekly downloads
 
Created
Source

Layabout

build_status

Simple layout components for React.

Philosophy

  • Be light on configuration, preferring to have new components over complex APIs. Understand usage directly from the component name rather than derived from combinations of props.
  • Aim to solve a set of common problems, not all problems and variations.
  • Be light on DOM detritus. Prefer to style existing children and containers rather than to create "wrappers" which can impact accessibility.
  • Inline and override styles to reduce conflicts, dependencies, and declutter class names.

Components

ColumnLayout

Lays out its children one by one according to a set of relative column widths. Overflow continues onto the new row, following the same template.

columns (optional) set of values for sizing columns amongst the total space.

Options:

  • Array of relative column sizes. e.g. [2, 3] where the first column will take up 40% and the second 60%.

If no value is provided the children will be spaced equally amongst the available space.

container (optional) Element to hold container styles and render children into.

Options:

  • String representation of a HTML DOM element. e.g. "section".
  • React component type can be either class or functional. Note that ColumnLayout provides a style prop to the container. It is up to the provided container to pass this to a child element which can render it (eg. a HTML DOM element).

If no element is provided a div will be rendered as the container.

gutterSpacing TO BE IMPLEMENTED

  • Spacing between columns. Can be standard style units such as %, px, em.
Example
<ColumnLayout
  columns={[10, 13, 5]}
  gutterSpacing="2px"
  container={Article}
>
  <section></section>
  <section></section>
  <section></section>
</ColumnLayout>

In the example above the sections would have spacing of 10/28ths, 13/28ths, and 5/28ths of the total available width.

Future

  • pass multiple layouts and the ability to switch. Useful for media queries.

Keywords

FAQs

Package last updated on 17 Jan 2017

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