# Links

The links written into the document. Web links open in a new tab (scheme-allowlisted — `javascript:` and `data:` URIs are never followed), internal links jump to their page. With [`callbacks.onExternalLink`](https://kernstra.com/docs/web-sdk/config/callbacks/onexternallink) set, the checked address goes to your handler instead and `confirmExternal` no longer applies. The Link tool that writes new links is [`tools.link`](https://kernstra.com/docs/web-sdk/config/tools/link).

- Interface: `LinksConfig`
- Config path: `config.links`

## Example

```ts
links: {
  enabled: true,
  confirmExternal: false,
  pill: true,
}
```

## Options (3)

### `enabled`

- Type: `boolean`
- Default: `true`
- Page: https://kernstra.com/docs/web-sdk/config/links/enabled

Clickable in-document links. A click follows a link in Select and with no tool (not a click that ends a selection over its words); links are not followed in Pan. Web links open in a new tab with `noopener,noreferrer`; only `http:`, `https:`, `mailto:` and `tel:` addresses are followed, and a link with any other scheme reads as no link.

```ts
links: { enabled: false }
```

### `confirmExternal`

- Type: `boolean`
- Default: `true`
- Page: https://kernstra.com/docs/web-sdk/config/links/confirmexternal

Ask before a link leaves the document: a small dialog names the site and shows the full address (or the addressee of a `mailto:`, the number of a `tel:`) and waits for the reader to confirm, since a document written by someone else can put any address under any words. `false` opens web links on the first click. No longer applies once `callbacks.onExternalLink` is set.

### `pill`

- Type: `boolean`
- Default: `true`
- Page: https://kernstra.com/docs/web-sdk/config/links/pill

The pill naming a link's destination on hover / first tap — on a touch screen, after a first tap, with an **Open** button. Off, links stay clickable and a tap follows at once; `confirmExternal` still names a web address before leaving.

Web page: https://kernstra.com/docs/web-sdk/config/links
