Socket
Socket
Sign inDemoInstall

@bedrock-layout/columns

Package Overview
Dependencies
6
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bedrock-layout/columns

bedrock-layout columns


Version published
Weekly downloads
166
decreased by-17.41%
Maintainers
1
Install size
31.9 kB
Created
Weekly downloads
 

Readme

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

Last updated on 26 Mar 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