Skip to main content
The @bitwarden/angular library provides shared Angular-specific code used across the Web, Desktop, and Browser extension clients. It includes reusable components, directives, pipes, and Angular-specific service implementations.

Library Structure

The Angular library is organized by feature domain and Angular artifact type:

Components

Directives

Reusable attribute and structural directives for common behaviors

Pipes

Data transformation pipes for templates

Components

Shared UI components used across Angular applications

Guards

Route guards for authentication and authorization

Directives

The Angular library provides several utility directives for common use cases.

Feature Flag Directive

Conditionally render elements based on feature flags:
Usage:

Event Handling Directives

Usage:

Input Directives

Automatically removes leading and trailing whitespace from input values:
Usage:
Prevents autocomplete, autocorrect, and other browser input modifications:
Usage:
Enables drag-and-drop for text content:
Usage:

Other Directives

Pipes

Transformation pipes for displaying data in templates.

Search Pipe

Filters arrays based on search terms:
Usage:

User Pipes

Formatting Pipes

Services

Angular-specific service implementations and utilities. Manages modal dialogs across the application:
Usage:

Jslib Services Module

Provides dependency injection configuration for common services:

Auth Components & Guards

Authentication Guards

Usage:

Two-Factor Components

Vault Components

Icon Component

Displays favicons for vault items:
Usage:

Vault Items Component

Billing Components

JslibModule (Deprecated)

The JslibModule bundles commonly used Angular artifacts, but is deprecated in favor of importing standalone components directly.
Migration: Import components directly instead of using JslibModule:

Platform Services

Theme Service

Manages application theming:

Import Examples

Best Practices

New components should be created as standalone to avoid dependency on the deprecated JslibModule:
Import specific directives and pipes rather than importing entire modules:
Follow the official Angular style guide for component architecture, naming conventions, and project structure.

Components Library

@bitwarden/components - Shared design system components

Common Library

@bitwarden/common - Platform-agnostic services and models

Auth Angular

@bitwarden/auth/angular - Authentication-specific Angular components

UI Common

@bitwarden/ui-common - Common UI utilities and helpers