Skip to main content

{@link}

Syntax

{@link namepath}
{@link namepath|link text}
{@link namepath link text}
{@link URL}
{@link URL|link text}

Overview

{@link} creates a hyperlink inside description text. The link target can be a JSDoc namepath to another documented symbol, or an absolute URL.

  • {@link} — uses the default link style from the template (typically the name, possibly formatted as code).
  • {@linkcode} — forces code formatting for the link text.
  • {@linkplain} — forces plain text (no code formatting) for the link text.
TypeScript Supported

TypeScript supports {@link} for inline hyperlinks to symbols and URLs in JSDoc comments.

TypeScript docs →

Examples

/**
* Creates a new {@link User} from the given data.
*/
function createUser(data) {}
/**
* See the {@link User|user model} for the full schema.
*/
/**
* See the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API MDN Fetch API} docs.
*/
/**
* Calls {@link MyClass#myMethod} under the hood.
*/

Force code formatting

/**
* Use {@linkcode Array.prototype.map} to transform the array.
*/

In @see tags

/**
* @see {@link parseCSV}
* @see {@link https://tools.ietf.org/html/rfc4180 RFC 4180}
*/

See also

Official reference: jsdoc.app/tags-inline-link