Content Box

The Content Box block is a custom alternative to the Group block. It offers extended layout and design features, including sticky and pinned variations, advanced background options, as well as responsive and hover-specific styling values.

Content Boxes can receive dynamic images as backgrounds (see Dynamic Images documentation) and can also be used as child blocks of the List (Greyd) block (see List (Greyd) documentation).

You can find the Content Box block in the Greyd category of the block inserter. An empty Content Box is essentially a blank wrapper that can hold any other block. Blocks can be inserted using the standard block inserters.

Screenshot of a Content Box block in the editor, without any content, explained in the paragraphs before and after.

In addition to the standard block controls, the toolbar includes:

  • Align: Controls the horizontal alignment of the box. Alignment only has an effect if a Maximum width is set.
  • Trigger: Adds dynamic trigger actions to the block (see Trigger documentation).

Settings

Screenshot of the Content Box settings, explained in the following paragraphs.

The Content Box offers different block variations:

  • Content Box (default): A standard wrapper element for grouping any content.
  • Sticky Box: Remains at the top of the viewport while scrolling, but only within the boundaries of its parent container.
  • Pinned Box: Fixed in the viewport and always visible, even when scrolling.
  • Floating Box: Positioned independently from the surrounding layout, disappears when scrolling.

The Sticky Box has some additional Sticky Settings, while the Pinned Box and Floating Box share the same set of Position Settings.

Under Background element, the Content Box offers extensive settings, see the next section below for more details.

Under Behaviour, you can change the transition duration in seconds and the transition animation, for example when setting different hover colors. You can choose from these options:

  • Ease
  • Linear
  • Ease in
  • Ease out
  • Ease in out

Under Actions, you can assign a Trigger Event to the Content Box here (see Trigger documentation).

The block also supports Animations, including background animation. In the Advanced section, you can find settings for HTML anchor, additional CSS classes, the Greyd Styles Class, CSS Animation, toggles to hide the block per breakpoint and Inline Styling.

Background element

The Background element can be an image, video, or animation. This feature is also shared with the Content Box block. You start by selecting the type of background via a button group: None, Image, Video, or Animation.

For all background types other than “None”, you can also configure opacity and scroll behavior. The scroll behavior determines how the background moves: it can scroll with the content, be fixed, or apply vertical/horizontal parallax effects. Since fixed and parallax behaviors can cause rendering issues on iOS, they are disabled on mobile by default. You can override this with a toggle and fine-tune the Parallax speed with a percentage-based control (−200% to +200%).

Screenshot of the Background element settings of the Content Box block with Image selected, explained in the following paragraphs.

If you choose Image, you can select either a static image or a dynamic one in the sidebar. The dynamic images can be the featured image, website logo or any additional field on the post type that is a “file/media” field type.

A block toolbar button also allows replacing the image easily but only shows the selection settings.

Additional image settings include size (Cover, Contain, Initial), repetition options (horizontally, vertically or both), and positioning (Top, Center, Bottom and for each of these Left, Center, Right).

Screenshot of the Background element settings of the Content Box block with Video selected, explained in the following paragraph.

If you choose Video, you can embed a video from YouTube or Vimeo by pasting a URL. You can also define the aspect ratio (16/9, 21/9, 4/3, or 1/1).

Screenshot of the Background element settings of the Content Box block with Animation selected, explained in the following paragraph.

When using Animation, you can upload a .json animation file (see the Lottie documentation). Available settings include playback behavior at SVG animation (e.g. Start automatically, Start as soon as visible, Sync with scroll), positioning, and width. For width it’s possible to use CSS functions like calc() or custom CSS variables.

Sticky Settings

Screenshot of the Sticky settings for the Sticky Box, explained in the following paragraphs.

Available only when the variation is set to Sticky Box. A sticky box remains at the top of the viewport while scrolling, but only within the boundaries of its parent container.

With the Offset setting, you can change the space between the top of the screen and the Content Box, when the box remains at the top of the viewport. By default there is no space and you can either add a positive or negative value. The setting is based on the Range Unit Control component and can be adjusted per breakpoint.

The Show preview button allows you to activate a live preview in the editor. You can deactivate this preview by clicking the button again.

Position Settings

Screenshot of the Position settings for the Pinned Box or Floating Box, explained in the following paragraphs.

The Position settings are only available when the variation is set to Pinned Box or Floating Box. Like in the Sticky Settings, there’s a Show preview button to preview the behaviour of the Content Box in the editor.

The options for Top, Right, Bottom and Left are empty by default. If a value is added, the box will be positioned to the side where the value is set, with the value as gap between the viewport side and the Content Box. All options offer the settings of the Range Unit Control component, with spacing presets available to choose from. Every option can also be individually set per breakpoint.

Styles

Screenshot of the Styles tab for the Content Box block, explained in the following paragraphs.

In the Styles tab under Colors, you can set a text and background color for the Content Box. You can also set a separate color for the hover state.

Under Spaces, you can set spacing for Inside (padding) and Outside (margin) the Content Box. The settings are combined for top and bottom as well as left and right, which can be separated. The setting offers various options based on the Range Unit Control component, with spacing presets available as well. All values can be also adjusted per breakpoint.

Under Size, you can set a Minimum height and Minimum width with the Range Unit Control component. If a maximum width is set, a separate setting called Alignment appears below with the options Left, Center and Right. The Alignment of the content setting is always available, with the options Top, Center, Bottom and Spreaded. All settings can be adjusted per breakpoint.

Under Border radius you can set rounded corners via the Border Radius component.

Under Border you can set border width, style and color and adjust it for the hover state.

Under Shadow you can set a drop shadow for the popover with the Drop Shadow Control component.

Video

You are currently viewing a placeholder content from Vimeo. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information

Last updated: