> ## Documentation Index
> Fetch the complete documentation index at: https://docs.napps.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AppNavigation

`AppNavigation` lets you navigate to app screens from JavaScript.

Use this instead of browser navigation APIs such as `window.location`, `history`, or links.

## Global Name

```ts theme={null}
AppNavigation
```

## API

```ts theme={null}
interface AppNavigation {
  navigateToCart(): void;
  navigateToProductDetail(productID: string): void;
  navigateToProductQuickAdd(productID: string): void;
  navigateToCollection(collectionID: string, title?: string): void;
  navigateToExternalPage(url: string, title: string): void;
}
```

## Methods

### navigateToCart

Opens the cart.

```ts theme={null}
AppNavigation.navigateToCart();
```

### navigateToProductDetail

Opens a product detail page. The `GID` prefix is not required.

```ts theme={null}
AppNavigation.navigateToProductDetail("gid://shopify/Product/123");
```

### navigateToProductQuickAdd

Opens the quick add flow for a product. The `GID` prefix is not required.

```ts theme={null}
AppNavigation.navigateToProductQuickAdd("gid://shopify/Product/123");
```

### navigateToCollection

Opens a collection. The `GID` prefix is not required.

```ts theme={null}
AppNavigation.navigateToCollection(
  "gid://shopify/Collection/123",
  "Summer"
);
```

### navigateToExternalPage

Opens an external page.

```ts theme={null}
AppNavigation.navigateToExternalPage(
  "https://example.com/size-guide",
  "Size Guide"
);
```
