Playbook logo
14.18.0

Overlay

Default

Column 1Column 2Column 3Column 4Column 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5

Overlays help shift focus by dimming or masking background content. This kit supports gradient and solid color modes, with adjustable opacity to suit the context.

Gradient & Opacity

picture of a misty forest
picture of a misty forest

By default, the overlay is rendered as a gradient. Setting the gradient prop to false renders the overlay as a solid color. You can adjust the transparency of the solid overlay by using the opacity prop.

Color

picture of a misty forest
picture of a misty forest
picture of a misty forest
picture of a misty forest

The color prop is used to change the color of the solid or gradient mask. Gradient overlays always start opaque and fade to transparent.

NOTE: Images are set to display: block to remove the default inline spacing caused by line height. This ensures the image fully fills the container without unexpected gaps.

Layout

Column 1Column 2Column 3Column 4Column 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5

The optional layout prop accepts the position and size of the overlay as a key:value pair.

The position key accepts bottom (default), top, y (for both top and bottom) right, left, or x (for both left and right), which sets the side(s) where the color overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of bottom starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.

The size value is full (100%) by default, but accepts our spacing tokens or a percentage value as a string, and literally translates to how much of the container is covered by the overlay(s).

Multi-directional

Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content

Optionally, you can pass multi-directional options (x or y) to the position key, which creates multiple overlays.

Your color is still applied as the starting edge to both overlays, and each mask will fade to transparent moving toward its opposite edge, ending at the size value you set.

NOTE: Multi-directional overlays share the available container space, so passing full or a percentage string greater than 50% to a multi-directional overlay will cause your masks to overlap at the midline of your container. As a best practice, we do not recommend exceeding a percentage size of 25% when using multi-directional overlays.

Vertical Dynamic Multi-directional

Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content

Pass the dynamic prop to make the overlay render while the scrollbar isn't at either end on the scrollbar.

Toggle

Column 1Column 2Column 3Column 4Column 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5
Value 1Value 2Value 3Value 4Value 5

To toggle an overlay, add a button with an event handler. Remove the overlay container to reveal the underlying content. Re-wrap the overlay container to add the overlay back.

Hide Scroll Bar

Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content
Card Content

Pass the scrollBarNone prop to hide the scrollbar from view. This is particularly helpful for small containers where the scrollbar may occupy too much space.

Full Page Opacity


To enable the overlay to cover the full size of your screen, you can pass the fullScreen prop. You can also pass an opacity along with it.

Full Page Using Background Color Tokens


The fullScreen prop also allows you to use color along with it.


Available Props

PropsTypeValues

color

enum
"card_light" | "bg_light" | "card_dark" | "bg_dark" | "black" | "white" | "success" | "error"

data

object
{ [key: string]: string; }

dynamic

false
false

fullScreen

enum
true

gradient

enum
true

layout

object
{ [key: string]: string; }

opacity

enum
"opacity_1" | "opacity_2" | "opacity_3" | "opacity_4" | "opacity_5" | "opacity_6" | "opacity_7" | "opacity_8" | "opacity_9" | "opacity_10"

scrollBarNone

enum
true