Installation

Set up and use the design system on your platform

Prerequisites

  1. Make sure your Node.js version is set to 20.11.1
    1. Download and install NVM
    2. In the terminal of your choice, run the following commands:

                                                        
                                                        
                                                            nvm install 20.11.1
                                                        nvm use 20.11.1
                                                        
                                                            
  1. Set up your repo user and obtain NPM access to repo.backbase.com, by following the steps described in Set up for web development.
  2. Set up your Angular project to use Angular 18 or later. For more information on upgrading, see Angular migration guide.

Set up dependencies

  1. In the root directory of your project, install the dependencies.

                                                        
                                                        
                                                            npm install --save @backbase/ui-ang
                                                        
                                                            

                                                        
                                                        
                                                            "projects": {
                                                            "<app-name>": {
                                                                ...
                                                                "architect": {
                                                                    "build": {
                                                                        "options": {
                                                                            "outputPath": "",
                                                                            "index": "",
                                                                            "main": "",
                                                                            "styles": [
                                                                                "apps/<app-name>/src/styles.scss"
                                                                            ],
                                                                            ...
                                                        
                                                            
  1. The name and the directory of your main stylesheet file is specified. In above example this is apps/<app-name>/src/styles.scss.
  2. To import the Web Design System styles, edit this main stylesheet file by adding the following at top of the file.

                                                        
                                                        
                                                            @import "@backbase/ui-ang/scss/main";
                                                        
                                                            

Example usage

  1. To import a Web Design component, you must use the name of the module as listed in Web Components.
  2. In the module you want to consume the component in, use the following format for your import statement.

                                                        
                                                        
                                                            import { ButtonModule } from "@backbase/ui-ang/button"
                                                        
                                                            
  1. After the module is imported, you can use the selectors in that module.
  2. The following example imports LogoModule so that the <bb-logo-ui> selector can be used in the app.

                                                        
                                                        
                                                            // app.module.ts
                                                        
                                                        import { BrowserModule } from "@angular/platform-browser";
                                                        import { CommonModule } from "@angular/common";
                                                        import { NgModule } from "@angular/core";
                                                        
                                                        import { LogoModule } from "@backbase/ui-ang/logo";
                                                        
                                                        import { AppComponent } from "./app.component";
                                                        
                                                        @NgModule({
                                                          declarations: [AppComponent],
                                                          imports: [BrowserModule, CommonModule, LogoModule],
                                                        })
                                                        export class AppModule {}
                                                        // app.component.ts
                                                        
                                                        import { Component } from "@angular/core";
                                                        
                                                        @Component({
                                                          selector: "bb-app-root",
                                                          template: `
                                                            <div class="app">
                                                              <div class="top-bar">
                                                                <bb-logo-ui type="full"></bb-logo-ui>
                                                              </div>
                                                              <div class="main">...</div>
                                                            </div>
                                                          `,
                                                        })
                                                        export class AppComponent {
                                                          constructor() {}
                                                        }