# CurrentPageReference

Gets the current page reference from the router container. This wire is also [available in Lightning Experience](https://developer.salesforce.com/docs/platform/lwc/guide/use-navigate-add-params-url.md).

## Properties

None

## Syntax

```javascript
import { LightningElement, wire } from "lwc";
import { CurrentPageReference } from "lightning/navigation";

export default class Example extends LightningElement {
  @wire(CurrentPageReference)
  propertyOrFunction;
}
```

## Returns

- A [`PageReference`](/docs/platform/lwr/references/csr-reference/pagereference.md) object containing a reference to the current page.

## Example

```javascript
import { LightningElement, wire } from "lwc";
import { CurrentPageReference } from "lightning/navigation";

export default class Example extends LightningElement {
  // Subscribe to page reference updates
  @wire(CurrentPageReference)
  printPageName(pageRef) {
    console.log(`Page name: ${pageRef ? pageRef.attributes.name : ""}`);
  }
}
```
