Skip to main content
Neighborhood Design System v5.1.0

Video

Ready

Video element component. This component only supports video from Widen.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdVideo } from '@fbin-web/neighborhood-core';
Usage
<nbhd-video
  src="https://moen.widen.net/stream/hd/moen/xevbnr2frf/CES-SneakPeek2023-JumbotronV3.mp4">
</nbhd-video>

Properties

PropertyAttributeTypeDefaultDescription
srcsrcstring—Video source URL. Supports Widen URLs which are automatically formatted
posterposterstring—Poster image URL displayed before video plays.
altaltstring—Accessible label describing the video content. Embeds use it as the iframe title (default "Video player").
cssClasscss-classstring—Additional CSS class(es) to apply to the video element.
looploopbooleanfalseLoop the video continuously after it completes.
autoplayautoplaybooleanfalseAutoplay the video with playsinline enabled. Displays play/pause control overlay when enabled. Autoplaying video is muted and can always be paused: MP4/Widen video gets a pause button, and YouTube/Vimeo embeds keep the player controls.
mutedmutedbooleanfalseMutes the video audio. Automatically enabled when autoplay is true.
controlscontrolsbooleanfalseDisplay native video controls. When enabled, autoplay functionality is disabled.
noA11yno-a11ybooleanfalseDisables accessibility features for the video component.
playLabelplay-labelstringPlay videoAccessible name of the play button shown on autoplaying video.
pauseLabelpause-labelstringPause videoAccessible name of the pause button shown on autoplaying video.

CSS Parts

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

NameDescription
baseThe component's main wrapper div container.
controlThe play/pause button control overlay (visible when autoplay is enabled without controls).
iconThe SVG icons within the play/pause button (play and pause icons).
embedThe iframe used for embedded YouTube and Vimeo videos.
videoThe HTML video element that displays the video content.
sourceThe source element inside the video that defines the video file.
nbhd-video::part(base) {
  /* your styles */
}

CSS Properties

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

Video

PropertyTokenValue Copy
--nbhd-video-blockSize—100%
--nbhd-video-control-insetBlockEnd—12px
--nbhd-video-control-insetInlineStart—12px
--nbhd-video-control-position—absolute
--nbhd-video-control-svg-blockSize--nbhd-size-icon-xl32px
--nbhd-video-control-svg-inlineSize--nbhd-size-icon-xl32px
--nbhd-video-control-zIndex--nbhd-z-11
--nbhd-video-display--nbhd-media-displayblock
--nbhd-video-embed-blockSize—100%
--nbhd-video-embed-inlineSize—100%
--nbhd-video-inlineSize—100%
--nbhd-video-insetBlockEnd—0
--nbhd-video-insetBlockStart—0
--nbhd-video-insetInlineEnd—0
--nbhd-video-insetInlineStart—0
--nbhd-video-objectFit—cover
--nbhd-video-position—absolute
--nbhd-video-transform--nbhd-media-transformnone
--nbhd-video-transitionDelay--nbhd-media-transitionDelay0s
--nbhd-video-transitionDuration--nbhd-media-transitionDuration0s
--nbhd-video-transitionProperty--nbhd-media-transitionPropertyall
--nbhd-video-transitionTimingFunction--nbhd-media-transitionTimingFunctionease
--nbhd-video-wrapper-aspectRatio—16/9
--nbhd-video-wrapper-blockSize—100%
--nbhd-video-wrapper-display—block
--nbhd-video-wrapper-inlineSize—100%
--nbhd-video-wrapper-insetBlockEnd—auto
--nbhd-video-wrapper-insetBlockStart—auto
--nbhd-video-wrapper-insetInlineEnd—auto
--nbhd-video-wrapper-insetInlineStart—auto
--nbhd-video-wrapper-minBlockSize—auto
--nbhd-video-wrapper-minInlineSize—auto
--nbhd-video-wrapper-objectFit—cover
--nbhd-video-wrapper-position—relative
--nbhd-video-zIndex--nbhd-z-ground0

Media

PropertyTokenValue Copy
--nbhd-media-display—block
--nbhd-media-host-blockSize—100%
--nbhd-media-host-display—block
--nbhd-media-host-inlineSize—100%
--nbhd-media-transform—none
--nbhd-media-transitionDelay—0s
--nbhd-media-transitionDuration—0s
--nbhd-media-transitionProperty—all
--nbhd-media-transitionTimingFunction--nbhd-motion-easing-standardease

Dependencies

Used by

Esc
↑ ↓ to move↵ to open