3.5.0 • Published 1 month ago

@bedrock-layout/cover v3.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month 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.0

1 month ago

3.4.0

1 month ago

3.3.8

3 months ago

3.3.7

3 months ago

3.3.6

3 months ago

3.3.5

4 months ago

3.3.4

4 months ago

3.3.3

5 months ago

3.1.9

10 months ago

3.2.1

8 months ago

3.2.0

9 months ago

3.3.1

7 months ago

3.3.0

7 months ago

3.3.2

7 months ago

3.1.8

1 year ago

3.1.7

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.6

1 year ago

3.1.5

1 year ago

3.1.4

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.5.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

2.5.1

2 years ago

2.5.0

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

2.4.1

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.0

2 years ago

2.2.5

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.4

2 years ago

2.1.0

2 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

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 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

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago