Skip to main content
cngx-src documentation

provideTagConfig

Functioncommon/display

projects/common/display/tag/config/provide-tag-config.ts

Description#

Application-root configuration cascade for the tag family. Pass any combination of withTagDefaults / withTagGroupDefaults / withTagColors / withTagSlots features in bootstrapApplication's providers array.

Resolution priority (high → low):

  1. Per-instance Input binding.
  2. provideTagConfigAt(...) in a parent component's viewProviders.
  3. provideTagConfig(...) at the application root.
  4. Library defaults (CNGX_TAG_DEFAULTS).

The provider deep-merges supplied features with the library defaults so consumers only declare keys they want to override.

bootstrapApplication(AppComponent, {
  providers: [
    provideTagConfig(
      withTagDefaults({ variant: 'subtle' }),
      withTagColors({
        'my-brand': {
          bg: '#4f46e5',
          color: '#ffffff',
          border: 'transparent',
        },
      }),
    ),
  ],
});

Signature#

provideTagConfig(...features: undefined)

Parameters#

@paramfeatures

Returns#

EnvironmentProviders