Skip to main content
Neighborhood Design System v5.1.0

Spinner

Ready

Spinner is used to indicate that a process is ongoing, such as loading data or performing an action. It provides visual feedback to users that something is happening in the background.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdSpinner } from '@fbin-web/neighborhood-core';
Usage
<nbhd-spinner></nbhd-spinner>

Properties

PropertyAttributeTypeDefaultDescription
sizesizesmallmediumlargexlargemediumThis property sets the size of the spinner.
speedspeedslownormalfastnormalThis property sets the speed of the spinner animation.
labellabelstring—Text announced to screen readers while loading (visually hidden), followed by the text of any visible content. Defaults to "Loading" when there is neither.

Slots

NameDescription
(default)Content area for short text. Screen readers hear its text through the status region, so it shouldn't contain links or buttons.
visualVisual area for spinner.

CSS Parts

NameDescription
baseThe component's base wrapper.
labelThe visually hidden text announced by the status region: the label and the content's text.
indicatorThe spinner's visual indicator.
visualThe spinner's visual representation.
content-containerThe container for the spinner's content.
contentThe content area of the spinner.
nbhd-spinner::part(base) {
  /* your styles */
}

CSS Properties

Set these on nbhd-spinner 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-spinner-borderRadius--nbhd-border-radius-full9999px
--nbhd-spinner-maxInlineSize—500px
--nbhd-spinner-paddingBlockStart--nbhd-space-14px
--nbhd-spinner-segment-zIndex--nbhd-z-11
--nbhd-spinner-size-lg—80px
--nbhd-spinner-size-md—48px
--nbhd-spinner-size-sm—32px
--nbhd-spinner-size-xl—120px
--nbhd-spinner-speed-fast—500ms
--nbhd-spinner-speed-normal—1s
--nbhd-spinner-speed-slow—1.5s
--nbhd-spinner-track-opacity--nbhd-opacity-track0.35
Esc
↑ ↓ to move↵ to open