# Link

## Overview

Links are used as navigational elements. They may appear on their own, within a sentence or paragraph, or directly following the content.

<figure><img src="https://2985180403-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhSQqKqKx7I7rVBbqF_%2Fuploads%2Ftts9Ql0gNHXL4B3UDDMH%2Flink.png?alt=media&#x26;token=c73412a3-c82e-45c1-a81e-6a68cda0cba5" alt=""><figcaption></figcaption></figure>

### Widget API

| Property | Description                                                                                                                                                                                                |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url      | <p>The destination that this link leads to.</p><ul><li><strong>Type:</strong> <code>String</code></li><li><strong>Default:</strong> required</li></ul>                                                     |
| onTap    | <p>Called when the link is tapped, it also passes the url value.</p><ul><li><strong>Type:</strong> <code>Function(String url)</code></li><li><strong>Default:</strong> required</li></ul>                  |
| enable   | <p>Whether the widget is enabled or not.</p><ul><li><strong>Type:</strong> <code>bool</code></li><li><strong>Default:</strong> <code>true</code></li></ul>                                                 |
| caption  | <p>A caption text to display instead of the url. If it's null, then the URL will be displayed.</p><ul><li><strong>Type:</strong> <code>String?</code></li><li><strong>Default:</strong> optional</li></ul> |
| fontSize | <p>The size of glyphs (in logical pixels) to use when painting the text.</p><ul><li><strong>Type:</strong> <code>double</code></li><li><strong>Default:</strong> <code>14</code></li></ul>                 |

### Example

```dart
CLink(
 url: 'www.google.com',
 onTap: (url) {},
);

// OR

CLink(
 url: 'www.google.com',
 caption: 'Google',
 onTap: (url) {},
);

// OR

CLink(
 enable: false,
 caption: 'Google',
 url: 'www.google.com',
 onTap: (url) {},
);
```
