2.1.0 • Published 3 years ago

@bedrock-layout/switcher v2.1.0

Weekly downloads
35
License
MIT
Repository
github
Last release
3 years ago

DEPRECATION WARNING

This package is deprecated and will no longer be maintained. All the functionality has been added to the Split and Columns components, respectively. It is recommended that you use those components going forward.

@bedrock-layout/switcher

The switchers are layout primitive that start as either a Split or Columns primitive but will switch to a Stack when the container size is below the switchAt value.

Full docs at: bedrock-layout.dev

When to Use

It is used to create a split or a column layout that will stack at a certain container width.

How to install

npm install @bedrock-layout/switcher

Usage

import { SplitSwitcher, ColumnsSwitcher } from '@bedrock-layout/switcher';

<SplitSwitcher gutter='lg' fraction='2/3'>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</SplitSwitcher>

<ColumnsSwitcher gutter='lg' columns={4}>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</ColumnsSwitcher>

data-attribute

For purposes of styling, you can select data-bedrock-layout-columns-switcher and data-bedrock-layout-split-switcher.

API

SplitSwitcher

* required

PropertyDescriptionTypeDefault
gutter*sets space between each elementone of spacing**-
fractionsets the fractional splittest1/2
switchAtsets the width thatnumber or valid CSS length as a stringbreakPoints.smallOnly

ColumnsSwitcher

* required

PropertyDescriptionTypeDefault
gutter*sets space between each elementone of spacing**-
columnsnumber of columnsnumber1
denseused with Column to have a dense layoutbooleanfalse
switchAtsets the width thatnumber or valid CSS length as a stringbreakPoints.smallOnly

** By default, spacings are one of the spacing-constants, but can be overridden using the ThemeProvider from styled-components

2.1.0

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.11

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago