Template:IconBox/doc: Difference between revisions

Jump to navigation Jump to search
Vergir (talk | contribs)
Update data attribute names after the iconbox- rename (with help from vergir-bot LLM)
Vergir (talk | contribs)
m update doc
Line 1: Line 1:
== Usage ==
== Usage ==


{{tl|IconBox}} displays a box with a colored header, an icon, and a body of text. It carries no meaning of its own — every part of its appearance is supplied by the caller.
{{tl|IconBox}} displays a box with a colored header, an icon, and a body of text.


For standard ability interactions, use {{tl|AbilityInteraction}} instead. It picks the header, color, icon, and link from a registry, so a given mechanic looks the same on every page. IconBox is for one-off boxes the registry does not cover.
Used by {{tl|AbilityInteraction}}.


== Parameters ==
== Parameters ==
Line 9: Line 9:
<templatedata>
<templatedata>
{
{
"description": "A box with a colored header, an icon, and body text. Presentation is supplied entirely by the caller.",
"description": "",
"params": {
"params": {
"title": {
"title": {
Line 51: Line 51:
== Data attributes ==
== Data attributes ==


The box carries {{code|data-iconbox-icon}}, {{code|data-iconbox-title}}, and {{code|data-iconbox-state}} on its wrapper element. {{code|data-iconbox-state}} is one of {{code|normal}}, {{code|disabled}}, or {{code|partial}}.
The box carries several data attributes:
* {{code|data-iconbox-icon}},
* {{code|data-iconbox-title}},
* {{code|data-iconbox-state}} on its wrapper element.


[[Module:AbilitySection]] reads these to build the hint icons shown beside an ability card, and to link each one to its box.
These are used by [[Module:AbilitySection]] to apply correct styling to its own elements.
 
These attributes are a contract with that module. The CSS class names are '''not''' — they are presentational and may change. Any code that needs to find these boxes should match on the data attributes.


== Examples ==
== Examples ==