# @bedrock-layout/cover

> bedrock-layout cover

Latest version **4.0.1** (published 2026-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bedrock-layout/cover
pnpm add @bedrock-layout/cover
yarn add @bedrock-layout/cover
bun add @bedrock-layout/cover
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2026-02-04 |
| First published | 2020-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 449 |
| Author | Jarvis1010 <travis.mair@gmail.com> |
| Maintainers | jarvis1010 |
| Keywords | cover, layout, react |

## Links

- npm: https://www.npmjs.com/package/@bedrock-layout/cover
- Repository: https://github.com/Bedrock-Layouts/Bedrock
- Homepage: https://bedrock-layout.dev/
- Issues: https://github.com/Bedrock-Layouts/Bedrock/issues
- npm.io page: https://npm.io/package/@bedrock-layout/cover

## Dependencies (2)

- [@bedrock-layout/type-utils](https://npm.io/package/@bedrock-layout/type-utils.md) ^0.2.0
- [@bedrock-layout/spacing-constants](https://npm.io/package/@bedrock-layout/spacing-constants.md) ^4.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2026-02-04
- 4.0.0 — 2026-02-03
- 3.5.4 — 2025-05-05
- 3.5.3 — 2025-02-07
- 3.5.2 — 2024-08-20
- 3.5.1 — 2024-06-03
- 3.5.0 — 2024-04-08
- 3.4.0 — 2024-03-26
- 3.3.8 — 2024-02-14
- 3.3.7 — 2024-02-14
- 3.3.6 — 2024-02-14
- 3.3.5 — 2024-01-18
- 3.3.4 — 2024-01-12
- 3.3.3 — 2023-12-03
- 3.3.2 — 2023-10-15
- … 82 more at https://npm.io/package/@bedrock-layout/cover/versions

## README

# `@bedrock-layout/cover`

A layout helper component that covers a predefined height and vertically centers its children.

Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/)

---

## When to Use

The `Cover` component is used to cover a predefined height on the screen and vertically center one child. Use the `CoverCentered` component (or an element with the `data-br-cover-centered` attribute) to mark which child should be centered.

---

## How to install

`npm install @bedrock-layout/cover`

or

`yarn add @bedrock-layout/cover`

---

## Usage

```javascript
import { Cover, CoverCentered } from "@bedrock-layout/cover";

<Cover minHeight="50vh" gap="size2">
  <div>I am on top.</div>
  <CoverCentered>
    <div>I am centered</div>
  </CoverCentered>
  <div>I am on bottom.</div>
</Cover>;
```

---

## data-attribute

For purpose of styling, you can select the outer wrapper as `data-br-cover` data attribute. Use the `CoverCentered` component (or an element with `data-br-cover-centered` attribute) to mark which child should be vertically centered.

---

## API

\* required

### Cover Props

| Property  |                Description                 |                   Type                    |  Default  |
| :-------: | :----------------------------------------: | :---------------------------------------: | :-------: |
| minHeight |      Minimum height you want to cover      | `CSSLength` \| `number` \| `SizesOptions` |   100%    |
|    gap    |         Space between each element         |             One of `Spacing`              |     -     |
|  variant  | Sets the content to stretch to full height |      "default" \| "stretch-content"       | "default" |
|  padding  |       Adds padding inside the Cover        |              `PaddingConfig`              |     -     |

`Spacing` values are the spacing constants (for example: `size000`, `size00`, `size0`, `size1`, ... `size15`).

### CoverCentered

The `CoverCentered` component is used to mark which child should be vertically centered within the Cover. It accepts all standard HTML attributes and can be rendered as any HTML element using the `as` prop.

---
_Source: https://npm.io/package/@bedrock-layout/cover · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
