Hero Split
ReadyComponent that contains either a video or image as a visual complement to the content.
Preview
Code
npm install @fbin-web/neighborhood-core
import { NbhdHeroSplit } from '@fbin-web/neighborhood-core';
<nbhd-hero-split>
<nbhd-text
slot="eyebrow"
tag="div"
variant="eyebrow"
>Fringilla Mollis Parturient</nbhd-text
>
<nbhd-text
slot="title"
variant="title"
tag="h2"
>Cursus Condimentum Bibendum</nbhd-text
>
<nbhd-text
slot="subtitle"
tag="h3"
variant="subtitle"
>Vulputate Vestibulum</nbhd-text
>
<nbhd-text
slot="content"
tag="div"
>Curabitur blandit tempus porttitor.</nbhd-text
>
<nbhd-cta
variant="primary"
slot="cta"
href="go-to-this-page"
css-class="fun-css-tracking-class"
external
aria-label="Learn more about this thingy">
Learn More
</nbhd-cta>
<nbhd-text
slot="note"
tag="div"
>This is a note - Nulla vitae elit libero, a pharetra augue.</nbhd-text
>
<nbhd-image
slot="media"
src="https://moen.widen.net/content/8luiiucngz/original/1800-workstation-sinks-jumbotron-L.png"
alt="Fun ALT test for images">
</nbhd-image>
</nbhd-hero-split>
npm install @fbin-web/neighborhood-react
import { NbhdHeroSplit } from '@fbin-web/neighborhood-react';
import { NbhdHeroSplit, NbhdCta, NbhdText, NbhdImage } from '@fbin-web/neighborhood-react';
const App = () => (
<>
<NbhdHeroSplit>
<NbhdText
slot="eyebrow"
tag="div"
variant="eyebrow">
Fringilla Mollis Parturient
</NbhdText>
<NbhdText
slot="title"
variant="title"
tag="h2">
Cursus Condimentum Bibendum
</NbhdText>
<NbhdText
slot="subtitle"
tag="h3"
variant="subtitle">
Vulputate Vestibulum
</NbhdText>
<NbhdText
slot="content"
tag="div">
Curabitur blandit tempus porttitor.
</NbhdText>
<NbhdCta
variant="primary"
slot="cta"
href="go-to-this-page"
cssClass="fun-css-tracking-class"
external
ariaLabel="Learn more about this thingy">
Learn More
</NbhdCta>
<NbhdText
slot="note"
tag="div">
This is a note - Nulla vitae elit libero, a pharetra augue.
</NbhdText>
<NbhdImage
slot="media"
src="https://moen.widen.net/content/8luiiucngz/original/1800-workstation-sinks-jumbotron-L.png"
alt="Fun ALT test for images"></NbhdImage>
</NbhdHeroSplit>
</>
);
Media Dimensions
Image widths are preset by the component, so width and height do not need to be provided on nbhd-image. When using provider="widen", images are resized to these widths. Height is auto, so images keep their original aspect ratio and are not cropped.
| Breakpoint | Dimension | Aspect Ratio |
|---|---|---|
Small (≤767px) | 375px x auto | Original |
Medium (≥768px) | 720px x auto | Original |
Large (≥1024px) | 720px x auto | Original |
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
reverse | reverse | boolean | false | Reverse the layout so the media appears on the opposite side of the content. |
shadow | shadow | boolean | false | Apply a shadow to the media block. |
compact | compact | boolean | false | Set the component max-inline-size to --nbhd-size-container-max. |
framed | framed | boolean | false | Wrap the split layout in a framed border container. |
alignment | alignment | startcenterend | start | Set the text alignment for the content details. |
contentAlignment | content-alignment | startcenterend | center | Align the content block within the split layout. |
mediaRadius | media-radius | nonesmallmediumlargefull | none | Apply a border radius to the media element. |
mediaRadiusPattern | media-radius-pattern | contentall | content | Choose whether the radius applies to the content-facing corners only or across all corners. |
surface | surface | noneprimarysecondaryinverseinverse-secondary | primary | Surface theme color for the component. |
marginTop | margin-top | nonesmallmediumlarge | none | Adjust margin above the component. none = 0 small = 24px medium = 48px large = 96px |
marginBottom | margin-bottom | nonesmallmediumlarge | none | Adjust margin below the component. none = 0 small = 24px medium = 48px large = 96px |
paddingTop | padding-top | defaultnonesmallmediumlarge | default | Adjust padding to the top of the component. default = component's top padding none = 0 small = 24px medium = 48px large = 96px |
paddingBottom | padding-bottom | defaultnonesmallmediumlarge | default | Adjust padding to the bottom of the component. default = component's bottom padding none = 0 small = 24px medium = 48px large = 96px |
No properties match.
Slots
| Name | Description |
|---|---|
eyebrow | Content rendered above the title, typically a short label or kicker. |
title | Primary headline content for the split hero layout. |
subtitle | Supporting heading or secondary line beneath the title. |
content | Main body copy for the detail column. |
cta | Call-to-action content rendered within the detail area. |
note | Secondary note or supporting text placed beneath the CTA. |
media | Visual media slot for the image or video content on the opposite side. |
No slots match.
CSS Parts
| Name | Description |
|---|---|
| — | The outer wrapper that hosts the component layout. |
| — | The nested container element that constrains the component width. |
| — | The framed wrapper applied when the framed property is enabled. |
| — | The split flex layout container holding the detail and media columns. |
| — | The text/content column of the hero split layout. |
| — | The slotted eyebrow content area above the title. |
| — | The slotted title content area. |
| — | The slotted subtitle content area. |
| — | The slotted body content area. |
| — | The slotted CTA content area. |
| — | The slotted note content area, styled as a standalone text block. |
| — | The media column containing the image or video slot. |
| — | The actual slotted media content area inside the media column. |
No css parts match.
nbhd-hero-split::part() {
/* your styles */
}
CSS Properties
Set these on nbhd-hero-split or an ancestor to override the defaults. Token is the design token a default comes from and Value is what it resolves to in core Neighborhood; brands may override them. Properties that adapt to surface follow the light or inverse surface they sit on until you set them.
| Property | Token | Value | Description | Copy |
|---|---|---|---|---|
--nbhd-heroSplit-detail-bpLg-gutterMargin | — | 5% | — | |
--nbhd-heroSplit-detail-bpLg-gutterPadding | --nbhd-space-0 | 0px | — | |
--nbhd-heroSplit-detail-bpLg-inlineSize | — | 42% | — | |
--nbhd-heroSplit-detail-bpMd-gutterPadding | --nbhd-space-16 | 64px | — | |
--nbhd-heroSplit-detail-bpXl-gutterMargin | — | 9% | — | |
--nbhd-heroSplit-detail-bpXl-inlineSize | — | 45% | — | |
--nbhd-heroSplit-detail-edge | --nbhd-space-0 | 0px | — | |
--nbhd-heroSplit-detail-gutterMargin | --nbhd-space-0 | 0px | — | |
--nbhd-heroSplit-detail-gutterPadding | --nbhd-space-11 | 44px | — | |
--nbhd-heroSplit-detail-inlineSize | — | 100% | Inline size (width) of the detail section, responsive to screen size. | |
--nbhd-heroSplit-detail-marginInlineEnd | — | Set by the component | — | |
--nbhd-heroSplit-detail-marginInlineStart | — | Set by the component | — | |
--nbhd-heroSplit-detail-paddingBlockEnd | — | Set by the component | — | |
--nbhd-heroSplit-detail-paddingBlockStart | — | Set by the component | — | |
--nbhd-heroSplit-detail-textAlign | — | start | — | |
--nbhd-heroSplit-frame-borderColor | --nbhd-context-color-accent-primary | Adapts to surface | — | |
--nbhd-heroSplit-frame-borderRadius | --nbhd-border-radius-md | 6px | Border radius for the frame container. | |
--nbhd-heroSplit-frame-borderStyle | — | solid | — | |
--nbhd-heroSplit-frame-borderWidth | --nbhd-border-width-emphasis | 2px | — | |
--nbhd-heroSplit-frame-paddingBlock | --nbhd-space-6 | 24px | Block padding (top and bottom) for the frame container. | |
--nbhd-heroSplit-frame-paddingInline | --nbhd-space-6 | 24px | Inline padding (left and right) for the frame container. | |
--nbhd-heroSplit-host-display | — | block | — | |
--nbhd-heroSplit-marginInline | --nbhd-space-0 | 0px | Inline margin for the main hero-split container. | |
--nbhd-heroSplit-maxInlineSize | — | 100% | Maximum inline size (width) of the hero-split container. | |
--nbhd-heroSplit-media-borderEndEndRadius | --nbhd-border-radius-none | 0 | — | |
--nbhd-heroSplit-media-borderEndStartRadius | --nbhd-border-radius-none | 0 | — | |
--nbhd-heroSplit-media-borderRadius-default | --nbhd-border-radius-none | 0 | — | |
--nbhd-heroSplit-media-borderRadius-full | --nbhd-border-radius-full | 9999px | — | |
--nbhd-heroSplit-media-borderRadius-large | --nbhd-border-radius-lg | 12px | — | |
--nbhd-heroSplit-media-borderRadius-medium | --nbhd-border-radius-md | 6px | — | |
--nbhd-heroSplit-media-borderRadius-small | --nbhd-border-radius-sm | 2px | — | |
--nbhd-heroSplit-media-borderStartEndRadius | --nbhd-border-radius-none | 0 | — | |
--nbhd-heroSplit-media-borderStartStartRadius | --nbhd-border-radius-none | 0 | — | |
--nbhd-heroSplit-media-boxShadow | --nbhd-shadow-none | none | — | |
--nbhd-heroSplit-media-bpLg-maxInlineSize | — | 720px | — | |
--nbhd-heroSplit-media-display | — | block | — | |
--nbhd-heroSplit-media-inlineSize | — | 100% | — | |
--nbhd-heroSplit-media-maxInlineSize | — | 100% | — | |
--nbhd-heroSplit-media-overflow | — | hidden | — | |
--nbhd-heroSplit-media-reverse-shadow | --nbhd-shadow-lg-reverse | 20px 10px 20px rgb(from #000000 r g b / 0.15) | — | |
--nbhd-heroSplit-media-shadow | --nbhd-shadow-lg | -20px 10px 20px rgb(from #000000 r g b / 0.15) | Box shadow for the media block when the shadow attribute is set. Reversed layouts use --nbhd-heroSplit-media-reverse-shadow (var(--nbhd-shadow-lg-reverse)). | |
--nbhd-heroSplit-note-borderColor | --nbhd-context-color-accent-primary | Adapts to surface | — | |
--nbhd-heroSplit-note-borderStyle | — | solid | Border style for the note text element's inline-start border. | |
--nbhd-heroSplit-note-borderWidth | --nbhd-border-width-emphasis | 2px | Border width for the note text element's inline-start border. | |
--nbhd-heroSplit-note-fontSize | --nbhd-typography-bodySmall-fontSize | 0.875rem | Font size for the note text element. | |
--nbhd-heroSplit-note-fontStyle | — | italic | Font style for the note text element. | |
--nbhd-heroSplit-note-fontWeight | --nbhd-typography-bodySmall-fontWeight | 400 | — | |
--nbhd-heroSplit-note-letterSpacing | — | normal | — | |
--nbhd-heroSplit-note-lineHeight | — | normal | — | |
--nbhd-heroSplit-note-marginBlock | --nbhd-space-12 | 48px | Block margin for the note text element. | |
--nbhd-heroSplit-note-paddingInline | --nbhd-space-4 | 16px | Inline padding for the note text element. | |
--nbhd-heroSplit-paddingBlock | --nbhd-space-10 | 40px | Block padding (top and bottom) for the hero-split container. |
No hero split match.
Dependencies
Child components <nbhd-hero-split> renders internally. Import them too when you tree-shake.