Hierarchy (view full)

Constructors

Properties

activateDefaultSheetListeners?: boolean = false

An optional override to whether the target tab should use default sheet event listeners. Defaults to false.

Remarks

The default sheet listeners pertain to the default 5e sheets. Behaviors include but are not limited to

  • data-action click handling
  • drag-and-drop behaviors
  • rollable items click handling
  • item controls click handling
  • proficiency toggling
  • ... etc.

Leaving this field false means you wish to take full control of the event handling of your content.

enabled?: ((context) => boolean)

Optional function to determine whether the tab should be visible when viewing the sheet. When excluded, it defaults to true. The context field is the relevant application context (item sheet, character sheet, etc.).

Type declaration

    • (context): boolean
    • Parameters

      • context: any

      Returns boolean

getData?: ((context) => any)

An optional function that provides the relevant application context (item sheet context, character sheet context, NPC sheet context, etc.) and expects the same data or a replacement object in return. The return value is passed to the Handlebars template.

Type declaration

    • (context): any
    • Parameters

      • context: any

      Returns any

onRender?: ((params) => void)

Optional function which is called each time a change detection cycle occurs on the sheet. It is called after this tab's content is optionally re-rendered to the DOM.

Type declaration

path: string = ''

The path to the handlebars template. Use a leading slash to look in the UserData directory.

Example: A template in a module's templates directory

"/modules/my-module-id/templates/my-module-template.hbs"

renderScheme: RenderScheme = 'handlebars'

Optionally determines whether to refresh content each time an application render occurs.

For svelte-based content, the default is "force". For HTML and Handlebars content, the default is "handlebars".

tabContentsClasses: string[] = []

An optional array of CSS classes to apply to the tab contents container.

tabId: string = ''

The required static ID associated with a tab.

Remarks

A tabId is a unique string of text that identifies your tab. It needs to be in a format that can be put into an HTML attribute. The tab ID is always required to register a tab.

A tabId must be unique to the target sheet. For example, the character sheet can only have one "my-module-id-my-spellbook-tab" ID, and the NPC sheet can also only have one "my-module-id-my-spellbook-tab" ID, etc.

Advice for crafting a unique tab ID:

  • for modules, use your module ID as a prefix (e.g., "my-module-id")
    • for world scripts, use your game world name (e.g., "my-game-world")
  • add a hyphenated version of the tab title (e.g., for a tab titled "My Spellbook Tab", use "my-spellbook-tab")
  • join these two pieces together with a hyphen:
"my-module-id-my-spellbook-tab"
title: CustomTabTitle = ''

The title to display on the tab. Accepts localization keys and plain text.