-
Notifications
You must be signed in to change notification settings - Fork 45
components order
@order N is a standalone within-group sort key for any symbol. The inline
@category … order= only applies
to a symbol that has a @category; @order works on a symbol that lives in
its plain kind section too — a @module, @class, @namespace, etc. with
no category:
/**
* @module config
* @order 1
*/config now sorts first among the modules in the Modules section, instead of
falling back to alphabetical order.
Important
@order is an unknown tag — set tags.allowUnknownTags: true in your
jsdoc.json or JSDoc strips it. See the overview.
(TypeDoc needs no flag.)
Note
This sort key applies to the JSDoc sidebar. @order has no effect on the
TypeDoc API sidebar — within a module, members are ordered by kind and then
alphabetically, not by @order. See
The TypeDoc sidebar.
| Situation | Use |
|---|---|
The symbol has a @category
|
order=N inline on that @category
|
| The symbol sits in its kind section (no category) | the standalone @order N
|
| The symbol has both | both are read — see precedence below |
A missing or non-numeric value is left undefined, so the symbol sorts
last (alphabetically). @order is read by readOrder in
generate-site.ts.
When a symbol carries both a @category … order= option and a standalone
@order, the inline @category order wins — it's the more specific,
co-located declaration. The resolved value is computed as
category?.order ?? readOrder(doclet) in renderContainerPage, and both feed the
same frontmatter.order the sidebar reads.
/**
* `order=1` (from @category) wins; the `@order 9` below is ignored here.
* @category Core order=1
* @order 9
*/
export class Parser {}So reach for the standalone @order precisely when there's no category to
hang an order= off of.
On a guide page (prose), the equivalent is the order frontmatter field,
which sorts the page within its group exactly like @order sorts a symbol —
see Build a guides site.
-
Components overview — the full tag list +
allowUnknownTags. -
@category— grouping (and inlineorder=). - Structure your sidebar — the full ordering model.
This wiki is auto-generated from docs-site/docs. Edit there — changes sync automatically. Full docs: https://ankdev.me/clean-jsdoc-theme/