clients/libs/tools/generator/components
Nick Krantz 9e1ab2864c
Some checks failed
Chromatic / Check PR run (push) Has been cancelled
Scan / Check PR run (push) Has been cancelled
Testing / Run tests (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (macos-14) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (ubuntu-22.04) (push) Has been cancelled
Testing / Run Rust tests on ${{ matrix.os }} (windows-2022) (push) Has been cancelled
Testing / Rust Coverage (push) Has been cancelled
Chromatic / Chromatic (push) Has been cancelled
Scan / SAST scan (push) Has been cancelled
Scan / Quality scan (push) Has been cancelled
Testing / Upload to Codecov (push) Has been cancelled
avoid aria-label for screen reader only text (#15119)
2025-06-20 15:57:33 -05:00
..
src avoid aria-label for screen reader only text (#15119) 2025-06-20 15:57:33 -05:00
jest.config.js Implement and extend tsconfig.base across projects (#14554) 2025-06-02 20:38:17 +00:00
package.json [PM-18363] Remove internal dependencies from package.json (#13448) 2025-02-20 15:04:39 +01:00
readme.md [PM-8282] credential generator (#11398) 2024-10-08 14:08:34 -04:00
tsconfig.json Implement and extend tsconfig.base across projects (#14554) 2025-06-02 20:38:17 +00:00
tsconfig.spec.json [PM-7289] Create generator libraries (#9432) 2024-05-30 15:38:31 -04:00

Using generator components

The components within this module require the following import.

import { GeneratorModule } from "@bitwarden/generator-components";

The credential generator provides access to all generator features.

<!-- Bound to active user -->
<tools-credential-generator />

<!-- Bound to a specific user -->
<tools-credential-generator [user-id]="userId" />

<!-- receive updates when a credential is generated.
     `$event` is a `GeneratedCredential`.
-->
<tools-credential-generator (onGenerated)="eventHandler($event)" />

Specialized components are provided for username and password generation. These components support the same properties as the credential generator.

<tools-password-generator [user-id]="userId" (onGenerated)="eventHandler($event)" />
<tools-username-generator [user-id]="userId" (onGenerated)="eventHandler($event)" />

The emission behavior of onGenerated varies according to credential type. When a credential supports immediate execution, the component automatically generates a value and emits from onGenerated. An additional emission occurs each time the user changes a setting. Users may also request a regeneration.

When a credential does not support immediate execution, then onGenerated fires only when the user clicks the "generate" button.