3.5.2 • Published 4 months ago

@bedrock-layout/cover v3.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@bedrock-layout/cover

A layout helper components that covers a pre-defined height and vertically centers its child component.

Full docs at: bedrock-layout.dev


When to Use

The Cover component should be used to cover a predefined height on the screen and center its child component.

Please note that Cover can only have a single child and will throw an error if you try to add more than one child.

Optionally, you can pass a top or bottom element as prop to it, and Cover will put them above or below the centered element. You can only assign a single ReactNode to both top and bottom props.


How to install

npm install @bedrock-layout/cover

or

yarn add @bedrock-layout/cover


Usage

import { Cover } from '@bedrock-layout/cover';

<Cover>
  <div>1</div>
</Cover>;

data-attribute

For purpose of styling, you can select the outer wrapper as data-bedrock-cover data attribute. The top, children, and bottom are wrapped in an element with the data attributes of data-bedrock-cover-top, data-bedrock-cover-child, and data-bedrock-cover-bottom respectively.


API

* required

PropertyDescriptionTypeDefault
minHeightminimum height you want to coverany valid css size unit as a string (will revert to default if not valid)100vh
gutter*space between each elementOne of Spacing**-
childrentakes a single child elementReactNode-
toptakes a ReactNode and puts it before the child elementReactNode-
bottomtakes a ReactNode and puts it after the child elementReactNode-

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

3.5.2

4 months ago

3.5.1

7 months ago

3.5.0

9 months ago

3.4.0

9 months ago

3.3.8

10 months ago

3.3.7

10 months ago

3.3.6

10 months ago

3.3.5

11 months ago

3.3.4

11 months ago

3.3.3

1 year ago

3.1.9

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.3.2

1 year ago

3.1.8

2 years ago

3.1.7

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.6

2 years ago

3.1.5

2 years ago

3.1.4

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.5.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

2.5.1

2 years ago

2.5.0

2 years ago

2.4.5

2 years ago

2.4.4

3 years ago

2.4.1

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.0

3 years ago

2.2.5

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.3.0

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.4

3 years ago

2.1.0

3 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.17

3 years ago

2.0.18

3 years ago

2.0.16

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

4 years ago

2.0.9

4 years ago

2.0.10

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

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.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago