Tags Overview
JSDoc recognises over 60 block tags and 2 inline tags. They fall into logical groups based on what they document.
Block tags
Core documentation
| Tag | Description |
|---|---|
@param | Document a function parameter |
@returns | Document the return value |
@yields | Document the value yielded by a generator |
@throws | Document an exception that may be thrown |
@type | Document the type of a symbol |
@typedef | Define a custom type |
@property | Document a property of an object |
@enum | Document a collection of related constants |
@callback | Document a callback function type |
@constant | Document a constant value |
@description | Provide a description (when not at the top of the block) |
@summary | A short summary, separate from the full description |
@example | An inline code example |
@default | Document a symbol's default value |
Classes & Functions
| Tag | Description |
|---|---|
@class | Mark a function as a class constructor |
@classdesc | A description that applies to the class, not its constructor |
@constructs | The function creates instances of the given class |
@function | Document a symbol as a function |
@interface | Document an interface type |
@mixin | Document a mixin object |
@module | Document a JavaScript module |
@namespace | Document a namespace object |
@member | Document a member of a symbol |
@event | Document an event |
@this | Document what this refers to inside a function |
Access & Visibility
| Tag | Description |
|---|---|
@access | Specify the access level of a symbol |
@private | Mark a symbol as private |
@protected | Mark a symbol as protected |
@public | Mark a symbol as public |
@package | Mark a symbol as package-private |
@inner | Mark a symbol as an inner member |
@instance | Mark a symbol as an instance member |
@static | Mark a symbol as a static member |
@global | Mark a symbol as globally scoped |
@readonly | Mark a symbol as read-only |
Relationships
| Tag | Description |
|---|---|
@augments | Indicate that a symbol inherits from a parent |
@implements | Indicate that a symbol implements an interface |
@mixes | Indicate that a symbol mixes in members of another |
@borrows | Indicate that a symbol uses the documentation of another |
@lends | Lend the properties of an object literal to a class |
@memberof | Specify the parent symbol of a symbol |
@alias | Treat a symbol as if it had a different name |
@fires | Document events emitted by a function |
@listens | Document events listened to by a symbol |
Metadata
| Tag | Description |
|---|---|
@author | Document the author of a symbol |
@version | Document the version of a symbol |
@since | Document when a symbol was added |
@deprecated | Mark a symbol as deprecated |
@license | Document the software licence |
@copyright | Document copyright information |
@todo | Document tasks to complete |
@see | Refer to another symbol or resource |
@requires | Document a required module |
@async | Mark a function as asynchronous |
@generator | Mark a function as a generator |
Document control
| Tag | Description |
|---|---|
@abstract | Mark a method as abstract (must be implemented by subclasses) |
@override | Mark a method as overriding a parent class method |
@hideconstructor | Hide the constructor from the documentation |
@ignore | Exclude a symbol from documentation output |
@inheritdoc | Inherit documentation from the parent class |
@variation | Disambiguate symbols with the same name |
@kind | Specify the kind of a symbol |
@name | Specify the name of a symbol |
@exports | Document the member that a module exports |
@external | Document an external type or class |
@file | Describe a file |
Inline tags
Inline tags appear inside description text, wrapped in {curly braces}.
| Tag | Description |
|---|---|
{@link} | Create a hyperlink to another symbol or URL |
{@tutorial} | Create a link to a tutorial |
Other
| Tag | Description |
|---|---|
@tutorial | Link to a tutorial from a symbol's documentation |
Official reference: Official JSDoc reference