
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-layout-views
Advanced tools
Easy layouts for React & React Native
Creating UI layouts should be simple and declarative.
The aim of this library is to provide an intuitive API for composing layouts by abstracting away certain flex concepts like axis alignment and replacing these with more intuitive terms like horizontal, bottom, right, and center.
Another goal of this library is to provide consistent spacing between layout elements.
// This example produces a horizontal layout where
// each section is spaced by 20px and the first section is
// pushing its siblings to the right.
<Layout horizontal spacing='20px'>
<Section grow>Content 1</Section>
<Section>Content 2</Section>
<Section>Content 3</Section>
</Layout>
// This example shows the previous example with
// the addition of a nested layout contained
// by the last section in the parent layout.
<Layout horizontal spacing='20px'>
<Section grow>Content 1</Section>
<Section>Content 2</Section>
<Section>
<Layout spacing='10px'>
<Section>Content 1</Section>
<Section>Content 2</Section>
<Section>Content 3</Section>
</Layout>
</Section>
</Layout>
// This example shows how styles may be applied
// directly to `Layout` and `Section`.
<Layout horizontal spacing='20px' style={{background: 'red'}}> // does not produce inline styles
<Section grow>Content 1</Section>
<Section>Content 2</Section>
<Section style={{padding: '1em'}}>Content 3</Section> // does not produce inline styles
</Layout>
$ npm install react-layout-views
import { Layout, Section } from 'react-layout-views' // web
// OR
import { Layout, Section } from 'react-layout-views/native' // native
...
<Layout />A Layout wraps one or many Section components. By default child Sections are arranged vertically. Adding the horizontal prop arranges children across the X axis.
Spacing between child Sections is set via the spacing prop as a CSS length for web or number for React Native.
The grow prop is used to define how a Section fills available space inside a Layout. Alignment props (e.g. top, right, etc.) may be combined to position content.
basis?: string | number
By default, Layout will wrap Sections according to this value. On web, this can be any CSS length. Native accepts a number or percentage string.
bottom?: boolean
center, centerHorizontal, left, rightcenter?: boolean
top, right, bottom, leftcenterHorizontal?: boolean
top, bottomcenterVertical?: boolean
left, rightgrow?: boolean | number
fill available space of parent Section or other flex element
horizontal?: boolean
align child Sections horizontally
left?: boolean
top, bottom, center, centerVerticalnoWrap?: boolean
prevent default wrapping of horizontal Layout
reverse?: boolean
reverse order of child Sections
right?: boolean
top, bottom, center, centerVerticalspacing?: string
top, bottom, center, centerVerticaltop?: boolean
left, right, center, centerHorizontalwrapEven?: boolean
horizontal Layout's wrapped orphan Sections maintain their basis-defined widths and remain aligned with preceding row columns<Section />The Section component subdivides a Layout and contains other components or another Layout. The grow prop is used to define how a Section fills available space inside a Layout. Alignment props (e.g. top, right, etc.) may be combined to position content.
basis?: string | number
ideal width (flex-basis)
bottom?: boolean
center, centerHorizontal, left, rightcenter?: boolean
top, right, bottom, leftcenterHorizontal?: boolean
top, bottomcenterVertical?: boolean
left, rightgrow?: boolean | number
left?: boolean
top, bottom, center, centerVerticalright?: boolean
top, bottom, center, centerVerticaltop?: boolean
left, right, center, centerHorizontalnpm run setup install project and test app depsnpm run dist or npm run dist:watch - buildnpm run apps:run - start storybook for web and nativenpm run apps:test - run visual regression tests with lokiFAQs
Easy layouts for React & React Native
We found that react-layout-views demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.