# Link

The `Link` component routes a new view within the application router. It should be used instead of `<a>` to avoid reloading the page.

### Usage

```javascript
import { Link } from 'components/lib';

function MyComponent({ ...props }){
  return (
    <div>
      <Link url='/' title='Home' text='Go to Home' />
    </div>
  );
}
```

### Props

<table data-full-width="true"><thead><tr><th>Prop</th><th>Description</th><th>Required</th><th>Value</th></tr></thead><tbody><tr><td>children</td><td>children to render</td><td>required if no text prop</td><td>component(s)</td></tr><tr><td>className</td><td>custom style</td><td>optional</td><td>SCSS or Tailwind</td></tr><tr><td>color</td><td>link color</td><td>optional</td><td>string (dark/light), default: primary</td></tr><tr><td>text</td><td>link text </td><td>required</td><td>string</td></tr><tr><td>title</td><td>link title </td><td>required</td><td>string</td></tr><tr><td>url</td><td>destination url</td><td>required</td><td>string</td></tr></tbody></table>

### Notes

* The `Link` component uses the `NavLink` from `react-router-dom` for internal routing and `<a>` for external links.
* The `className` prop allows for custom styling to be applied.
* The `color` prop sets the link color and defaults to the primary color if not specified.
* The `text` and `title` props provide the link text and title, respectively.
* The `url` prop specifies the destination URL.


---

# 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://docs.usegravity.app/gravity-web/components/link.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.
