Skip to main content
Neighborhood Design System v5.1.0

Text

Ready

Text component for rendering various text styles and HTML tags.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdText } from '@fbin-web/neighborhood-core';
Usage
<nbhd-text>Maecenas sed diam eget risus varius blandit sit amet non magna.</nbhd-text>

Properties

PropertyAttributeTypeDefaultDescription
tagtagpspandivh1h2h3h4h5h6pHTML tag that will be rendered for the text element.
variantvariantdefaultbodyeyebrowtitlesubtitlesupportingbodyText styling variant that applies predefined visual styles.
cssClasscss-classstring—Additional CSS class name to apply to the text element.

Slots

NameDescription
(default)Content area.

CSS Parts

NameDescription
baseThe component's base wrapper.
nbhd-text::part(base) {
  /* your styles */
}

CSS Properties

Set these on nbhd-text 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-text-borderColor—transparent
--nbhd-text-borderRadius--nbhd-border-radius-none0
--nbhd-text-borderStyle—none
--nbhd-text-borderWidth--nbhd-border-width-none0
--nbhd-text-color--nbhd-context-color-text-primaryAdapts to surface
--nbhd-text-display—block
--nbhd-text-eyebrow-bpLg-fontSize--nbhd-text-eyebrow-bpMd-fontSize0.8125rem
--nbhd-text-eyebrow-bpLg-marginBlock--nbhd-text-eyebrow-bpMd-marginBlock0px 8px
--nbhd-text-eyebrow-bpMd-fontSize--nbhd-text-eyebrow-fontSize0.8125rem
--nbhd-text-eyebrow-bpMd-marginBlock--nbhd-text-eyebrow-marginBlock0px 8px
--nbhd-text-eyebrow-color--nbhd-context-color-text-secondaryAdapts to surface
--nbhd-text-eyebrow-display--nbhd-text-displayblock
--nbhd-text-eyebrow-fontFamily--nbhd-typography-eyebrow-fontFamilysans-serif
--nbhd-text-eyebrow-fontSize--nbhd-typography-eyebrow-fontSize0.8125rem
--nbhd-text-eyebrow-fontStyle--nbhd-text-fontStyleinherit
--nbhd-text-eyebrow-fontWeight--nbhd-typography-eyebrow-fontWeight700
--nbhd-text-eyebrow-letterSpacing--nbhd-typography-eyebrow-letterSpacing5px
--nbhd-text-eyebrow-lineHeight--nbhd-typography-eyebrow-lineHeight1.4
--nbhd-text-eyebrow-marginBlock--nbhd-space-0 --nbhd-space-20px 8px
--nbhd-text-eyebrow-paddingBlock--nbhd-space-00px
--nbhd-text-eyebrow-paddingInline--nbhd-space-00px
--nbhd-text-eyebrow-textAlign--nbhd-text-textAligninherit
--nbhd-text-eyebrow-textTransform--nbhd-text-textTransforminherit
--nbhd-text-fontFamily--nbhd-typography-body-fontFamilysans-serif
--nbhd-text-fontSize--nbhd-typography-body-fontSize1rem
--nbhd-text-fontStyle—inherit
--nbhd-text-fontWeight—inherit
--nbhd-text-host-display—block
--nbhd-text-inlineSize—auto
--nbhd-text-letterSpacing—inherit
--nbhd-text-lineHeight--nbhd-typography-body-lineHeight1.5
--nbhd-text-marginBlock--nbhd-space-0 --nbhd-space-70px 28px
--nbhd-text-marginInline--nbhd-space-00px
--nbhd-text-maxInlineSize—100%
--nbhd-text-paddingBlock--nbhd-space-00px
--nbhd-text-paddingInline--nbhd-space-00px
--nbhd-text-span-display—inline
--nbhd-text-span-host-display—inline
--nbhd-text-span-marginBlock--nbhd-space-00px
--nbhd-text-subtitle-bpLg-fontSize--nbhd-text-subtitle-bpMd-fontSize1.125rem
--nbhd-text-subtitle-bpLg-marginBlock--nbhd-text-subtitle-bpMd-marginBlock0px 12px
--nbhd-text-subtitle-bpMd-fontSize--nbhd-text-subtitle-fontSize1.125rem
--nbhd-text-subtitle-bpMd-marginBlock--nbhd-text-subtitle-marginBlock0px 12px
--nbhd-text-subtitle-color--nbhd-context-color-text-secondaryAdapts to surface
--nbhd-text-subtitle-display--nbhd-text-displayblock
--nbhd-text-subtitle-fontFamily--nbhd-typography-subheading-fontFamilysans-serif
--nbhd-text-subtitle-fontSize--nbhd-typography-subheading-fontSize1.125rem
--nbhd-text-subtitle-fontStyle--nbhd-text-fontStyleinherit
--nbhd-text-subtitle-fontWeight--nbhd-typography-subheading-fontWeight700
--nbhd-text-subtitle-letterSpacing--nbhd-text-letterSpacinginherit
--nbhd-text-subtitle-lineHeight--nbhd-typography-subheading-lineHeight1.3
--nbhd-text-subtitle-marginBlock--nbhd-space-0 --nbhd-space-30px 12px
--nbhd-text-subtitle-paddingBlock--nbhd-space-00px
--nbhd-text-subtitle-paddingInline--nbhd-space-00px
--nbhd-text-subtitle-textAlign--nbhd-text-textAligninherit
--nbhd-text-subtitle-textTransform--nbhd-text-textTransforminherit
--nbhd-text-supporting-color--nbhd-context-color-text-secondaryAdapts to surface
--nbhd-text-supporting-display--nbhd-text-displayblock
--nbhd-text-supporting-fontFamily--nbhd-typography-supporting-fontFamilysans-serif
--nbhd-text-supporting-fontSize--nbhd-typography-supporting-fontSize0.8125rem
--nbhd-text-supporting-fontStyle--nbhd-text-fontStyleinherit
--nbhd-text-supporting-fontWeight--nbhd-typography-supporting-fontWeight400
--nbhd-text-supporting-letterSpacing--nbhd-text-letterSpacinginherit
--nbhd-text-supporting-lineHeight--nbhd-typography-supporting-lineHeight1
--nbhd-text-supporting-marginBlock--nbhd-space-00px
--nbhd-text-supporting-paddingBlock--nbhd-space-00px
--nbhd-text-supporting-paddingInline--nbhd-space-00px
--nbhd-text-supporting-textAlign--nbhd-text-textAligninherit
--nbhd-text-supporting-textTransform--nbhd-text-textTransforminherit
--nbhd-text-textAlign—inherit
--nbhd-text-textTransform—inherit
--nbhd-text-title-bpLg-fontSize--nbhd-typography-headline-bpLg-fontSize2.125rem
--nbhd-text-title-bpLg-marginBlock--nbhd-space-0 --nbhd-space-50px 20px
--nbhd-text-title-bpMd-fontSize--nbhd-text-title-fontSize1.5rem
--nbhd-text-title-bpMd-marginBlock--nbhd-text-title-marginBlock0px 12px
--nbhd-text-title-color--nbhd-context-color-text-primaryAdapts to surface
--nbhd-text-title-display--nbhd-text-displayblock
--nbhd-text-title-fontFamily--nbhd-typography-headline-fontFamilysans-serif
--nbhd-text-title-fontSize--nbhd-typography-headline-fontSize1.5rem
--nbhd-text-title-fontStyle--nbhd-text-fontStyleinherit
--nbhd-text-title-fontWeight--nbhd-typography-headline-fontWeight700
--nbhd-text-title-letterSpacing--nbhd-text-letterSpacinginherit
--nbhd-text-title-lineHeight--nbhd-typography-headline-lineHeight1.2
--nbhd-text-title-marginBlock--nbhd-space-0 --nbhd-space-30px 12px
--nbhd-text-title-paddingBlock--nbhd-space-00px
--nbhd-text-title-paddingInline--nbhd-space-00px
--nbhd-text-title-textAlign--nbhd-text-textAligninherit
--nbhd-text-title-textTransform--nbhd-text-textTransforminherit

Dependencies

Used by

Esc
↑ ↓ to move↵ to open