import { provideWr } from 'ngwr';
import { withDensity } from 'ngwr/density';
import { withTheme } from 'ngwr/theme';
import { withToast } from 'ngwr/toast';
export const appConfig: ApplicationConfig = {
providers: [
provideWr(
withDensity({ defaultDensity: 'sm' }),
withToast({ position: 'bottom-end', duration: 6000 }),
withTheme({ defaultMode: 'dark' }),
),
],
};| Feature | Entry point | What it sets |
|---|---|---|
withDensity() | ngwr/density | Default density: sm, md, lg or touch |
withToast() | ngwr/toast | Toast defaults: position, duration, maxStack, labels |
withTheme() | ngwr/theme | Default mode (light, dark or auto) and the storage key |
withDates() | ngwr/date | { locale } pins the date locale (default: LOCALE_ID); { adapter } is your own adapter |
withStorage() | ngwr/storage | Storage engine, key prefix and default TTL |
withMeta() | ngwr/meta | Title template and default Open Graph and Twitter tags |
- Pass features at bootstrap. Only
withDates()also works in a route'sproviders. - The same feature twice throws in dev mode.
withDensity()and[wrDensity]need@use 'ngwr/density'in your global styles. No component loads it, and without it the setting does nothing.- On a prerendered page, also ship
wrThemePrePaintScript()with the same options aswithTheme().