Skip to main content
Neighborhood Design System v5.1.0

Finish

Ready

A visual component for displaying color swatches.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdFinish } from '@fbin-web/neighborhood-core';
Usage
<nbhd-finish
  name="Chrome"
  identifier="64430"
  href="https://shop.moen.com/products/64430"
  image="https://moen.widen.net/content/3d7ihxrfrz/png/chrome_100.png"
  label="finish">
</nbhd-finish>

Properties

PropertyAttributeTypeDefaultDescription
hrefhrefstring—Specifies the URL to link to when the finish is clicked.
product—ProductContent—Product option data associated with the finish. This property is not settable via attribute.
namenamestring—The name of the finish.
identifieridentifierstring—The identifier of the finish.
imageimagestring—The URL of the finish image.
shapeshapecirclesquarecircleThe shape of the finish.
labellabelstringfinishThe label for the finish.
activeactivebooleanfalseWhether the finish is active and selected. Shown with a thicker border (not color alone) and announced as current on linked finishes.

Product Content Data Structure

The ProductContent interface defines the structure for product content data used with finish components.

PropertyTypeRequiredDescription
titlestringNoThe title of the product content.
identifierstringNoThe identifier of the product content.
imageMediaContentNoMediaContent object containing image/video data for the product content. See Media Structure section for details.
badgesstring[]NoAn array of badge labels for the product content.

Media Content Structure

The MediaContent interface defines the structure for media objects used in product content.

PropertyTypeRequiredDescription
srcstringYesThe source URL of the media file.
altstringYesAlternative text for the media, used for accessibility.
cssClassstringNoAdditional CSS class to apply to the media element.
cropbooleanNoEnable crop for the media when displayed.
imageFocuscentertoptop-rightrightbottom-rightbottombottom-leftlefttop-leftNoThe focal point for the media image.

Events

NameDescriptionEvent Detail
nbhd-finish-hoverEmitted when the mouse enters the finish component.{ product: ProductOption }
nbhd-finish-hover-outEmitted when the mouse leaves the finish component.{}

CSS Parts

NameDescription
baseThe component's base wrapper.
wrapperWrapper around the finish image.
imageThe finish image.
linkLink wrapping finish image.
nbhd-finish::part(base) {
  /* your styles */
}

CSS Properties

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

PropertyTokenValueDescription Copy
--nbhd-finish-active-borderWidth--nbhd-border-width-heavy4pxThicker border marks the selected finish without relying on color alone (WCAG 1.4.1).
--nbhd-finish-blockSize--nbhd-size-control-sm28px—
--nbhd-finish-borderColor--nbhd-context-color-interactive-defaultAdapts to surface—
--nbhd-finish-borderRadius--nbhd-border-radius-full9999px—
--nbhd-finish-borderStyle—solid—
--nbhd-finish-borderWidth--nbhd-border-width-emphasis2px—
--nbhd-finish-focus-outlineOffset—3px—
--nbhd-finish-host-display—block—
--nbhd-finish-inlineSize--nbhd-size-control-sm28px—
--nbhd-finish-marginBlock--nbhd-space-00px—
--nbhd-finish-marginInline--nbhd-space-00px—
--nbhd-finish-maxBlockSize--nbhd-size-control-sm28px—
--nbhd-finish-maxInlineSize--nbhd-size-control-sm28px—
--nbhd-finish-overflow—hidden—
--nbhd-finish-transitionDuration--nbhd-motion-duration-slow0.5s—
--nbhd-finish-transitionProperty—border-color—
--nbhd-finish-transitionTimingFunction--nbhd-motion-easing-standardease—

Dependencies

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

Used by

Esc
↑ ↓ to move↵ to open