Socket
Socket
Sign inDemoInstall

@spark-web/columns

Package Overview
Dependencies
66
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @spark-web/columns

--- title: Columns storybookPath: page-layout-columns--default isExperimentalPackage: false ---


Version published
Maintainers
2
Created

Readme

Source

title: Columns storybookPath: page-layout-columns--default isExperimentalPackage: false

Use the columns primitive to layout content in configurable columns.

Each child represents a single column. By default that column will span 1 fraction of the total number of children.

<Columns>
  <Placeholder />
  <Placeholder />
  <Placeholder />
</Columns>

Examples

Gap

The spacing between children can be adjusted using the gap prop.

<Columns gap="large">
  <Placeholder />
  <Placeholder />
  <Placeholder />
</Columns>

Vertical alignment

Columns can be aligned vertically using the alignY prop.

<Stack gap="medium" dividers>
  <Columns gap="small" alignY="top">
    <Placeholder />
    <Placeholder label="top (default)" height={64} />
    <Placeholder />
  </Columns>
  <Columns gap="small" alignY="center">
    <Placeholder />
    <Placeholder label="center" height={64} />
    <Placeholder />
  </Columns>
  <Columns gap="small" alignY="bottom">
    <Placeholder />
    <Placeholder label="bottom" height={64} />
    <Placeholder />
  </Columns>
  <Columns gap="small" alignY="stretch">
    <Placeholder />
    <Placeholder label="stretch" height={64} />
    <Placeholder />
  </Columns>
</Stack>

Collapsing across breakpoints

Columns can be collapsed into a single vertical stack responsively using the collapseBelow prop.

<Columns gap="large" collapseBelow="desktop">
  <Placeholder />
  <Placeholder />
  <Placeholder />
</Columns>

Template

If you need more control over how your columns are distributed, you can use the template prop. template receives an array of numbers that represent the relative width of each column.

<Columns gap="small" template={[1, 3, 1]} collapseBelow="tablet">
  <Box border="field" padding="small">
    <Text>nav</Text>
  </Box>
  <Box border="field" padding="small">
    <Text>main</Text>
  </Box>
  <Box border="field" padding="small">
    <Text>aside</Text>
  </Box>
</Columns>

Props

Box props are also included as Column props and are not listed here (excluding display, alignItems, gap, flexDirection, justifyContent and flexWrap).

Extra props are passed into the underlying Box component.

FAQs

Last updated on 23 Jan 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc