Tableau UI for Angular

Getting started

Install the package, import a folder's module, import the styles once, and pick the fonts and icons.

Install

The package is on npm; an Angular 22 app has every peer but Monaco already.

npm install tableau-ui-angular
PeerRangeNeeded
@angular/common^22.0.0Yes
@angular/core^22.0.0Yes
@angular/forms^22.0.0Yes
@angular/router^22.0.0Yes
monaco-editor^0.52.2Only for tableau-ui-angular/monaco
rxjs^7.4.0Yes

The Monaco editor's entry point needs monaco-editor installed by the app:

npm install monaco-editor@^0.52.2

The app builds on the Node versions Angular 22 supports: ^22.22.3 || ^24.15.0 || >=26.0.0.

Import a module

Each folder of the library is an entry point, tableau-ui-angular/<folder>. A component folder has a module for its components, such as TableauUiButtonModule in tableau-ui-angular/button; each component page names its own. A standalone component imports the modules it uses. The root, tableau-ui-angular, exports nothing.

import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { TableauUiButtonModule } from 'tableau-ui-angular/button';

@Component({
  selector: 'app-first-button',
  imports: [TableauUiButtonModule],
  template: `<button color="primary" (click)="$count.set($count() + 1)">Clicked {{ $count() }} times</button>`,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FirstButtonComponent {
  protected readonly $count = signal(0);
}

Import the styles

The app's global stylesheet uses the library's styles once. They are SCSS: an app made with CSS renames src/styles.css to src/styles.scss, there and in angular.json. This is the docs site's own styles.scss, with the icons and fonts the next sections set up.

// The library's styles, which every app imports once
@use 'tableau-ui-angular/styles/lib-styles' as libStyles;

// The icons the used-icons script downloads into public/icons. With the material-symbols package instead:
// @use 'material-symbols/rounded'; // icons of type Material Symbols Rounded, the default
// @use 'material-symbols/outlined'; // icons of type Material Symbols Outlined
// @use 'material-symbols/sharp'; // icons of type Material Symbols Sharp
@use '../public/icons/material-icons.css';

// Roboto, the font when Benton Sans isn't there
@import 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap';

// Benton Sans, from public/fonts, once its files are there: see Add-Benton-Sans.md
@include libStyles.font-import('/fonts');

Fonts

The text uses the first of these fonts the browser has.

  • Benton Sans, Tableau's font, which needs a licence. With its files in public/fonts, libStyles.font-import('/fonts') loads them. Add-Benton-Sans.md lists the files, and a Tableau Server you own can give them:
node node_modules/tableau-ui-angular/styles/fonts/downloadFonts.js https://your-tableau-server public/fonts
  • Roboto, Google's open font, which the Roboto import in styles.scss loads; this site uses it.
  • Arial, then Helvetica, then the browser's sans-serif, with nothing to load.

Icons

tab-icon shows a Material Symbols icon by name. The used-icons script downloads only the icons the app lists, a few kilobytes, into a folder styles.scss uses.

  1. List them in a class that extends UsedIcons, from tableau-ui-angular/used-icons. This list, with the library's own, comes to 15 icons.
import { UsedIcons } from 'tableau-ui-angular/used-icons';

// The icons the app uses, by their Material Symbols name; the script adds the library's own
export class Icons extends UsedIcons {
  override usedIcons: string[] = ['home', 'search', 'palette'];
}
  1. Run the script before each build, from the app's package.json, and again when the list changes:
{
  "scripts": {
    "icons": "node node_modules/tableau-ui-angular/used-icons/scripts/update-icons.js src/icons.ts public/icons",
    "prebuild": "npm run icons"
  }
}
  1. Use the CSS it writes, public/icons/material-icons.css, in styles.scss, as above. The commented lines there use the material-symbols package instead, which holds every icon, several megabytes.