Socket
Socket
Sign inDemoInstall

@bedrock-layout/columns

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bedrock-layout/columns

bedrock-layout columns


Version published
Weekly downloads
130
decreased by-61.08%
Maintainers
1
Weekly downloads
 
Created
Source

@bedrock-layout/columns

A layout helper component that creates an n-column layout.

Full docs at: bedrock-layout.dev


When to Use

The Columns can be used to create a columned layout consisting of n number of columns.


How to install

npm install @bedrock-layout/columns

or

yarn add @bedrock-layout/columns


Usage

Basic Usage

The following example creates a simple columned layout containing 5 columns of equal size.

import { Columns } from '@bedrock-layout/columns';

<Columns gutter='size3' columns={5}>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</Columns>;

Usage with Column

@bedrock-layout/columns also contains a Column component which can be used within Columns to define individual sizes of the columns, using the span props, as shown below:

import { Columns, Column } from '@bedrock-layout/columns';

<Columns gutter='size3' columns={3} dense>
  <Column span={2}>
    <div>1</div>
  </Column>
  <Column span={2}>
    <div>2</div>
  </Column>
  <Column>
    <div>3</div>
  </Column>
  <Column span={3}>
    <div>4</div>
  </Column>
  <Column span={2}>
    <div>5</div>
  </Column>
  <Column>
    <div>6</div>
  </Column>
</Columns>;

data-attribute

For styling purposes, you can select data-bedrock-columns and data-bedrock-column for Columns and Column respectively.


API

Columns

* required

PropertyDescriptionTypeDefault
gutter*sets the space between the elementsOne of Spacing**-
columnsnumber of columns to createnumber1
denseused with Column to have a dense layoutbooleanfalse
switchAtThe width threshold at which the container will switch to stack layoutOne of: CSS length, number-

** By default, Spacings is one of spacing-constants values, but this can be overwritten using the ThemeProvider from @bedrock-layout/spacing-constants

Column

PropertyDescriptionTypeDefault
spannumber of columns the element should spannumber1
offsetStartnumber of columns to offset before the elementnumber-
offsetEndnumber of columns to offset after the elementnumber-

Keywords

FAQs

Package last updated on 20 Aug 2024

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