# Navigation/Routers

Our component library supports SPAs and routers, to use your router instead of regular href based redirection you can use combination of below properties.

| Property       | Description                                                                   | Type                       |
| -------------- | ----------------------------------------------------------------------------- | -------------------------- |
| useNavigator   | Enables/Disables the use of event listener instead of href attribute on links | string ("true" \| "false") |
| navigatorClick | Use it to capture the on click event after useNavigator is set to true        | EventListener              |

**Step 1:**

Set use-navigator to "true".

**Step 2:**

Use Event Listener for event `navigatorClick` to capture and handle your desired behavior in javascript.

The path clicked can be found in `event.detail`.

<pre><code>// Sample Use in dda-header
&#x3C;dda-header
      first-logo-href="https://www.dubai.gov.ae"
      first-logo-src="https://www.dof.gov.ae/Style Library/img/gov-logo.svg"
      first-logo-white-src="https://www.dof.gov.ae/Style Library/img/gov-logo-white.svg"
      first-logo-alt="Dubai-Digital-Authority"
      use-navigator="true"
......
/>

&#x3C;script>
<strong>      const ddaHeader = document.querySelector("dda-header");
</strong>      ddaHeader.addEventListener("navigatorClick", (event) => {
        alert("Event Listener Triggered");
        console.log(event.detail)
      });      
&#x3C;/script>

</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://designsystem.dubai.ae/developers/navigation-routers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
