npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@foliokit/cms-ui

v1.1.0

Published

Angular shell layout components and theme service for FolioKit CMS

Readme

@foliokit/cms-ui

Angular shell layout components, design tokens, and theme service for the FolioKit CMS. Provides AppShellComponent, ThemeService, page components, and the full CSS/SCSS design token system.

Part of the FolioKit ecosystem.

Install

npm install @foliokit/cms-ui

Peer Dependencies

| Package | Version | |---------|---------| | @angular/cdk | ^21.2.2 | | @angular/common | ^21.2.4 | | @angular/core | ^21.2.4 | | @angular/material | ^21.2.2 | | @angular/platform-browser | ^21.2.4 | | @angular/router | ^21.2.4 | | @foliokit/cms-core | ^1.0.0 | | @foliokit/cms-markdown | ^1.0.0 | | ngx-markdown | ^21.1.0 | | rxjs | ~7.8.0 |


⚠️ Required: Vite pre-bundling exclusion

If your app uses the Angular CLI application builder (Vite-based), you must exclude FolioKit packages from Vite's dep-optimizer. Without this, the bundler inlines a second copy of Angular inside the FolioKit chunk, causing NG0203 injection errors on every standalone route.

// angular.json → projects.<name>.architect.build.options
// (repeat for the "serve" target if it has its own options block)
{
  "prebundle": {
    "exclude": [
      "@foliokit/cms-ui",
      "@foliokit/cms-core",
      "@foliokit/cms-markdown"
    ]
  }
}

⚠️ Required: Angular Material theme setup

AppShellComponent and all page components use Angular Material. Due to how Angular Material M3 theming works, the @include mat.theme(...) mixin must be called in your application's global stylesheet — it cannot be bundled inside a library.

If you skip this step, Material components will render without colour, elevation, or typography. This is the most common issue new consumers encounter.

Add the following to your global styles.scss:

@use '@angular/material' as mat;

// Light theme (also serves as the default)
html,
html[data-theme='light'] {
  @include mat.theme((
    color: (
      theme-type: light,
      primary: mat.$cyan-palette,
      tertiary: mat.$cyan-palette,
    ),
    typography: 'Plus Jakarta Sans',
    density: 0,
  ));
}

// Dark theme
html[data-theme='dark'] {
  @include mat.theme((
    color: (
      theme-type: dark,
      primary: mat.$cyan-palette,
      tertiary: mat.$cyan-palette,
    ),
    typography: 'Plus Jakarta Sans',
    density: 0,
  ));
}

ThemeService (exported from this package) manages the [data-theme] attribute on <html> and persists the user's preference to localStorage.


Getting started

1. Provide the shell configuration

In your app.config.ts, register SHELL_CONFIG alongside provideFolioKit():

import { signal } from '@angular/core';
import { provideFolioKit } from '@foliokit/cms-core';
import { SHELL_CONFIG, ShellConfig, ShellConfigSignal } from '@foliokit/cms-ui';

// SHELL_CONFIG requires a Signal<ShellConfig>, not a plain object.
const shellConfig: ShellConfigSignal = signal<ShellConfig>({
  appName: 'My Site',
  nav: [
    { label: 'Blog', path: '/blog' },
    { label: 'About', path: '/about' },
  ],
});

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideAnimationsAsync(),
    provideHttpClient(withFetch()),
    provideMarkdown(),
    provideFolioKit({ firebaseConfig: environment.firebase }),
    { provide: SHELL_CONFIG, useValue: shellConfig },
  ],
};

2. Wrap your app in the shell

import { AppShellComponent } from '@foliokit/cms-ui';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [AppShellComponent, RouterOutlet],
  template: `
    <folio-app-shell>
      <router-outlet />
    </folio-app-shell>
  `,
})
export class AppComponent {}

3. Import design tokens and Tailwind utilities

In angular.json (or project.json) styles array:

"styles": [
  "node_modules/@foliokit/cms-ui/styles/utilities.css",
  "src/styles.scss"
]

utilities.css is a pre-built snapshot of every Tailwind utility class used by FolioKit component templates. It must be loaded before your own styles so your overrides take precedence.

In your root styles.scss, import the FolioKit SCSS design system:

@use '@foliokit/cms-ui/styles/index' as folio;

@tailwind base;
@tailwind components;
@tailwind utilities;

Design Tokens

@foliokit/cms-ui ships a set of CSS custom properties that define the FolioKit design system: color palette, semantic theme tokens (light/dark), typography, border radii, shadows, and component tokens.

Tokens resolve against the [data-theme] attribute on a parent element (typically <html>). Use ThemeService to switch programmatically:

import { ThemeService } from '@foliokit/cms-ui';

// In a component or service:
readonly theme = inject(ThemeService);

toggleDark() {
  this.theme.toggle();
}

Token Categories

| Prefix | Purpose | |--------|---------| | --slate-*, --cloud-*, --teal-*, --violet-* | Base color palette | | --bg, --bg-subtle | Page backgrounds | | --surface-0 .. --surface-3 | Elevated surface layers | | --border, --border-strong, --border-accent | Borders | | --text-primary, --text-secondary, --text-muted, --text-accent | Typography colors | | --btn-primary-bg, --btn-primary-text, --btn-primary-hover | Button tokens | | --logo-bg, --logo-text, --logo-dot | Logo tokens | | --shadow-sm .. --shadow-xl | Elevation shadows | | --focus-ring, --focus-border | Focus indicators | | --nav-active-bg, --nav-active-color | Navigation highlights | | --font-display, --font-body, --font-mono | Font stacks | | --r-xs .. --r-2xl | Border radii |


Theming — brand colour override

Replace the default teal palette using the folio-theme() Sass mixin:

// src/styles.scss
@use '@foliokit/cms-ui/styles/index' as folio;
@use '@foliokit/cms-ui/styles/theme-factory' as folio-factory;

// Emit [data-theme="light"] and [data-theme="dark"] token blocks for your brand:
@include folio-factory.folio-theme(
  $primary:    #6366f1,  // your accent colour (replaces teal)
  $on-primary: #ffffff,  // text on primary-coloured buttons
  $surface:    #ffffff   // light-theme card surface
);

The mixin overrides --btn-primary-*, --text-accent, --border-accent, --nav-active-*, --surface-0, and --focus-* in both themes. All other tokens keep their default values.

Important: When overriding --btn-primary-bg in dark mode, always also set --btn-primary-text. The default dark value is #ffffff (white), designed for contrast against teal. A dark button background paired with white text may fail WCAG AA — set --btn-primary-text explicitly to a contrasting colour.

Hero card overlay tokens

The hero post card exposes these tokens for photographic treatment customisation:

| Token | Default | |---|---| | --hero-overlay-start | rgba(0,0,0,0.75) | | --hero-overlay-mid | rgba(0,0,0,0.2) | | --hero-chip-bg | rgba(255,255,255,0.18) | | --hero-chip-bg-hover | rgba(255,255,255,0.30) | | --hero-title-color | #ffffff | | --hero-meta-color | rgba(255,255,255,0.75) |


Route customisation

createBlogRoutes() accepts component overrides so you can substitute any page while keeping the library's resolvers and guards:

import { createBlogRoutes, BLOG_ROUTE_PATHS } from '@foliokit/cms-ui';
import { MyAboutPage } from './about/my-about-page.component';

export const appRoutes: Route[] = createBlogRoutes({
  postResolver,
  aboutComponent: MyAboutPage,  // receives { about: AboutPageConfig | null } in route data
  linksComponent: MyLinksPage,
  homeComponent:  MyHomePage,
});

Use BLOG_ROUTE_PATHS when you need to match or augment routes by path string — avoids magic strings:

import { BLOG_ROUTE_PATHS } from '@foliokit/cms-ui';
// BLOG_ROUTE_PATHS.about      === 'about'
// BLOG_ROUTE_PATHS.postDetail === 'posts/:slug'
// BLOG_ROUTE_PATHS.links      === 'links'

Full Documentation

foliokitcms.com/docs/components/shell