# @ng-web-apis/view-transition

> This is a library for declarative use of View Transition API with Angular

Latest version **5.5.0** (published 2026-11-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ng-web-apis/view-transition
pnpm add @ng-web-apis/view-transition
yarn add @ng-web-apis/view-transition
bun add @ng-web-apis/view-transition
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.5.0 |
| Published | 2026-11-25 |
| First published | 2023-09-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 827 |
| Author | Vsevolod Arutiunov |
| Maintainers | marsibarsi, waterplea, vladimir.potekhin, defenderbass |
| Keywords | angular, ng, view transition, view transition api |

## Links

- npm: https://www.npmjs.com/package/@ng-web-apis/view-transition
- Repository: https://github.com/taiga-family/ng-web-apis
- Homepage: https://github.com/taiga-family/ng-web-apis/blob/main/libs/view-transition/README.md
- Issues: https://github.com/taiga-family/ng-web-apis/issues
- npm.io page: https://npm.io/package/@ng-web-apis/view-transition

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) 2.9.1

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 5.5.0 (latest) — 2026-11-25
- 4.15.0 (v4-lts) — 2026-09-29
- 5.4.1 — 2026-10-29
- 5.4.0 — 2026-09-29
- 4.14.1 — 2026-06-09
- 5.3.0 — 2026-05-18
- 5.2.0 — 2026-03-23
- 5.0.4 — 2026-03-23
- 5.1.0 — 2026-02-05
- 5.0.3 — 2026-01-13
- 5.0.2 — 2025-12-25
- 5.0.1 — 2025-12-19
- 5.0.0 — 2025-12-19
- 4.14.0 — 2025-12-19
- 4.12.2 — 2025-10-06
- … 30 more at https://npm.io/package/@ng-web-apis/view-transition/versions

## README

# ![ng-web-apis logo](https://raw.githubusercontent.com/taiga-family/ng-web-apis/main/libs/view-transition/logo.svg) View Transition API for Angular

[![npm version](https://img.shields.io/npm/v/@ng-web-apis/view-transition.svg)](https://npmjs.com/package/@ng-web-apis/view-transition)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/@ng-web-apis/view-transition)
[![codecov](https://codecov.io/github/taiga-family/ng-web-apis/graph/badge.svg?flag=view-transition)](https://codecov.io/github/taiga-family/ng-web-apis/tree/main/libs/view-transition)

This service is an abstraction over
[view transition API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) for Angular

## Install

```bash
npm i @ng-web-apis/view-transition
```

## How to use

1. Import the `WaViewTransitionService` into your Angular component or service where you want to use it.

```ts
import {WaViewTransitionService} from '@ng-web-apis/view-transition';
```

2. Inject the `WaViewTransitionService` into your component's constructor or with `inject` (Angular 14+).

```ts
// in constructor
constructor(private viewTransitionService: WaViewTransitionService) {}

// via inject
viewTransitionService = inject(WaViewTransitionService);
```

3. Use the `startViewTransition` method to initiate a view transition. This method takes a callback function that
   returns a `Promise<void>` or `void`. You can perform any necessary DOM changing logic within this callback.

```ts
startTransition() {
  this.viewTransitionService.startViewTransition(() => {
    // Your DOM changing logic goes here
    return this.animateTransition();
  }).subscribe({
    next: (transition) => {
      // Callback is done and transition is about to begin
      console.log('View transition is about to begin:', transition);
    },
    complete: () => {
      console.log('View transition completed');
    },
    error: (error) => {
      // Handle any errors that occur during the transition
      console.error('View transition error:', error);
    },
  });
}
```

## Demo

You can [try online demo here](https://taiga-family.github.io/ng-web-apis/view-transition)

## See also

Other [Web APIs for Angular](https://taiga-family.github.io/ng-web-apis/) by
[@ng-web-apis](https://github.com/taiga-family/ng-web-apis)

---
_Source: https://npm.io/package/@ng-web-apis/view-transition · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
