Skip to main content
Neighborhood Design System v5.1.0

Video Player

Ready

A simple video player component that can contain contextual content below the video.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdVideoPlayer } from '@fbin-web/neighborhood-core';
Usage
<nbhd-video-player>
  <nbhd-video
    slot="media"
    autoplay
    muted
    loop
    class="media-css-class-sld-3"
    src="https://moen.widen.net/content/g0qximw21k/original/Moen-SWN-2023_1080p.mp4">
  </nbhd-video>

  <nbhd-text
    slot="content"
    tag="div">
    Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean lacinia bibendum nulla sed
    consectetur. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Curabitur
    blandit tempus porttitor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget
    lacinia odio sem nec elit. Donec id elit non mi porta gravida at eget metus.
  </nbhd-text>
</nbhd-video-player>

Properties

PropertyAttributeTypeDefaultDescription
compactcompactbooleanfalseEnables compact layout with constrained max-inline-size.
controlscontrolsbooleanfalseDisplay video player controls. When disabled, video will autoplay, loop, and be muted.
sdsdbooleanfalseDisplay video player in standard definition (4:3) aspect ratio instead of widescreen (16:9).
surfacesurfacenoneprimarysecondaryinverseinverse-secondaryprimarySets the surface theme applied to the component container.
marginTopmargin-topnonesmallmediumlargenoneAdjust margin above the component.
none = 0
small = 24px
medium = 48px
large = 96px
marginBottommargin-bottomnonesmallmediumlargenoneAdjust margin below the component.
none = 0
small = 24px
medium = 48px
large = 96px
paddingToppadding-topdefaultnonesmallmediumlargedefaultAdjust padding to the top of the component.
default = component's top padding
none = 0
small = 24px
medium = 48px
large = 96px
paddingBottompadding-bottomdefaultnonesmallmediumlargedefaultAdjust padding to the bottom of the component.
default = component's bottom padding
none = 0
small = 24px
medium = 48px
large = 96px

Slots

Named slots for customizing video player content

NameDescription
mediaCustom media content to replace the default video element. Falls back to rendering video from data.media when no slot content is provided.
contentCustom content to display below the video player. Falls back to rendering text from data.content when no slot content is provided.

CSS Parts

Styleable parts exposed for CSS custom styling using ::part() selector

NameDescription
baseThe main
wrapper element for the entire video player component.
containerThe element used to layout the media and content areas.
mediaThe media wrapper
that contains the media slot.
media-slotThe slot that renders custom media content for the video player.
contentThe content slot used for text or custom content displayed below the media.
nbhd-video-player::part(base) {
  /* your styles */
}

CSS Properties

Set these on nbhd-video-player 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.

PropertyTokenValue Copy
--nbhd-videoPlayer-content-marginBlock--nbhd-space-6 --nbhd-space-024px 0px
--nbhd-videoPlayer-host-display—block
--nbhd-videoPlayer-marginInline--nbhd-space-00px
--nbhd-videoPlayer-maxInlineSize—100%
--nbhd-videoPlayer-media-aspectRatio—16 / 9
--nbhd-videoPlayer-media-inlineSize—100%
--nbhd-videoPlayer-media-overflow—hidden
--nbhd-videoPlayer-media-position—relative
--nbhd-videoPlayer-paddingBlock--nbhd-space-1248px

Dependencies

Child components <nbhd-video-player> renders internally. Import them too when you tree-shake.

Esc
↑ ↓ to move↵ to open