Skip to main content

Stage

The Stage component is used to quickly scaffold brand-compliant web pages with support for background images and organised content.
The component can be combined with a set of other components to create different variants and layouts:

Import

// with @dhl-official/react-library:
import { DhlStage } from "@dhl-official/react-library"
// with @dhl-official/ui-libraries/react-library:
import { DhlStage } from "@dhl-official/ui-libraries/react-library"

Code

<DhlStage 
imageAlt="Alt text"
pictureSources={[
{
srcSet: 'https://via.placeholder.com/1024',
media: '(min-width: 1024px)'
},
{
srcSet: 'https://via.placeholder.com/768',
media: '(min-width: 768px)'
}
]}
>
Stage content
</DhlStage>

Interactive Demo

Copy Center

Copy Left

Migrating from DUIL 1.0

  • Stage.Actionbox changed to dhl-stage-action-box
  • Stage.Intro changed to dhl-stage-intro
  • Stage.Numbers changed to dhl-stage-numbers
  • Stage.Tiles changed to dhl-stage-tiles
  • Remove Stage.AddShipmentLink
  • Remove Stage.TrackingBar, use dhl-tracking-bar with margin: var(--dui-size-space-8x) 0;
  • stageLink content is rendered in named slot link
  • stageCopyText only supports string
  • upperHeadlineText only supports string
  • mainHeadlineText only supports string
  • When rendering numbers variant, the DhlStageNumbers have to be rendered twice, once as direct children and in named slot numbers to achieve responsiveness for larger screens

Readme

Properties

PropertyAttributeDescriptionTypeDefault
contentAlignmentcontent-alignmentAn optional prop used for the core content elements of the stage For specific variants, the content alignment must be chosen as follows: - Actionbox: left - Intro: center - Numbers: centerOrientation.center \| Orientation.left \| Orientation.rightDHL_STAGE.CONTENT_ALIGNMENT.CENTER
dataClassNamedata-class-nameAn optional class name prop for the component.stringundefined
dataIddata-idAn optional prop. Gives a valid HTML ID attribute value for the component.stringdhl-stage-${getRandomString()}
dataTestiddata-testidAn optional prop. The test id attached to the component as a data-testid attribute.stringundefined
imageAltimage-altA REQUIRED prop used to provide the component default image alternative text value. The default image alt attribute value is set to the HTML img tag child of an HTML picture tagstringundefined
imageSrcimage-srcAn optional prop used to provide the component default image source value. The default image src attribute value is set to the HTML img tag child of an HTML picture tagstringundefined
mainHeadlineColormain-headline-colorAn optional prop used to set the color of the component main headline."black" \| "default" \| "red" \| "white"DHL_STAGE.MAIN_HEADLINE_COLOR.DEFAULT
mainHeadlinePrioritymain-headline-priorityAn optional prop used to set the priority of the component main headline"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "p"DHL_STAGE.MAIN_HEADLINE_PRIORITY.H2
mainHeadlineTextmain-headline-textAn optional prop used to provide copy text situated below the component main headlinestringundefined
pictureSources (required)--A REQUIRED prop used to provide the component's html source tag attributes srcset and media values.{ media: string; srcSet: string; }[]undefined
stageCopyTextstage-copy-textAn optional prop used to provide copy textstringundefined
stageLink--An optional prop used to setup the dhl-link component. The dhl-link variant prop is hardcoded to primary.{ ariaLabel?: string; dataTestid?: string; dataTracking?: string; href: string; clickEvent?: (e: MouseEvent) => null; rel?: string; target?: string; }undefined
stageVariantstage-variantAn optional prop used to set the component's variant."actionBox" \| "copy" \| "intro" \| "numbers" \| "tilesFull" \| "tilesHalf" \| "tracking"DHL_STAGE.STAGE_VARIANT.COPY
upperHeadlineColorupper-headline-coloroptional prop used to set the color of the component upper headline"black" \| "default" \| "red" \| "white"DHL_STAGE.UPPER_HEADLINE_COLOR.DEFAULT
upperHeadlinePriorityupper-headline-priorityAn optional prop used to set the priority of the component upper headline"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "p"DHL_STAGE.UPPER_HEADLINE_PRIORITY.H1
upperHeadlineTextupper-headline-textAn optional prop used to provide copy text situated below the component upper headlinestringundefined

Dependencies

Depends on

Graph


Built by DHL User Interface Library Team!