
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
react-layout-views
Advanced tools
Easy peasy layouts for React & React Native.
Creating UI layouts should be simple and declarative.
The aim of this library is to provide a simple and intuative API for composing layouts by abstracting away certain flex concepts like flex-direction and main/cross axis alignment and replacing these with more intuitive terms like horizontal
, bottom
, right
, and center
.
// 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>
$ npm install react-layout-views
// Web
import { Layout, Section } from 'react-layout-views`
// Native
import { Layout, Section } from 'react-layout-views/native`
...
<Layout />
The Layout
component wraps multiple Section
components.
grow?: boolean | number
how should the Layout fill its containerspacing?: number (native) / string (web e.g. 20px, 2%, etc.)
spacing between child <Section />
shorizontal?: boolean
are child sections arranged horizontally or verticallyAlignment props arrange child Sections
accordingly and can be combined (e.g. <Layout bottom right>...</Layout>
).
center?: boolean
top?: boolean
right?: boolean
bottom?: boolean
left?: boolean
<Section />
The Section
component subdivides a Layout
and contains other components or another Layout
.
grow?: boolean | number
how should the Section
fill its containerAlignment props arrange child content accordingly and can be combined (e.g. <Section center right>...</Section>
).
center?: boolean
centerVertical?: boolean
centerHorizontal?: boolean
top?: boolean
right?: boolean
bottom?: boolean
left?: boolean
npm 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
The npm package react-layout-views receives a total of 0 weekly downloads. As such, react-layout-views popularity was classified as not popular.
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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.