Jump to content

Template:Userbox/doc: Difference between revisions

From Consumer Rights Wiki
Testing, I'm trying to make infoboxes accessible in VisualEditor as theyre almost as hard as doing a citation in wikieditor (very hard)
Much more detail + fixed my stupid errors
Line 44: Line 44:
"id": {
"id": {
"description": "Text or image shown on the left side of the userbox (typically short)",
"description": "Text or image shown on the left side of the userbox (typically short)",
"example": "MOD"
"example": "MOD",
"label": "ID",
"suggested": true
},
},
"id-c": {
"id-c": {
"description": "Background color (or gradient) of the ID box.",
"description": "Background color (or gradient) of the ID box. This uses hex colors (#fff for white, #000000 for black).",
"example": "#8f0000"
"example": "#8f0000",
"label": "ID color"
},
},
"info": {
"info": {
"description": "Main text content of the userbox.",
"description": "The main text content of the userbox.",
"example": "This user is a moderator and may be data-mining your contributions, btw."
"example": "This user is a moderator and may be data-mining your contributions, btw.",
"label": "Info",
"required": true
},
},
"info-fc": {
"info-fc": {
"example": "#fff"
"example": "#fff",
"label": "Info font color",
"description": "Font color of the info box. This uses hex colors (#fff for white, #000000 for black)."
},
},
"id-op": {
"id-op": {
"description": "Optional inline styles (e.g. shadows, transitions)"
"description": "Optional inline styles (e.g. shadows, transitions)."
},
},
"info-op": {
"info-op": {
"description": "Optional inline styles (e.g. shadows, transitions)"
"description": "Optional inline styles (e.g. shadows, transitions)."
},
},
"border-op": {
"border-op": {
"description": "Optional inline styles (e.g. shadows, transitions)"
"description": "Optional inline styles (e.g. shadows, transitions)."
},
"border-c": {
"label": "Border color",
"description": "The color of the border. This uses hex colors (#fff for white, #000000 for black)",
"example": "#6a000"
}
}
},
},
"description": "Font color of the info box"
"paramOrder": [
"id",
"info",
"border-c",
"id-c",
"info-fc",
"id-op",
"info-op",
"border-op"
]
}
}
</templatedata>
</templatedata>

Revision as of 11:06, 11 October 2025

Usage

This template displays a customizable userbox using Module:Userbox.

To use it, call the template with the appropriate parameters. All parameters are optional unless otherwise noted.

Basic Example

{{#invoke:userbox|userbox
 | id        = '''MOD'''
 | id-c      = linear-gradient(to bottom, #8f0000, #5a0000)
 | id-fc     = #fff
 | info      = This user is a '''moderator''' and may be ''data-mining your contributions'', btw.
 | info-c    = linear-gradient(to bottom, #8f0000, #5a0000)
 | info-fc   = #fff
 | border-c  = #6a0000
}}

Parameters

id
Text or image shown on the left side of the userbox (typically short)
id-c
Background color (or gradient) of the ID box
id-fc
Font color of the ID box
info
Main text content of the userbox
info-c
Background color (or gradient) of the info box
info-fc
Font color of the info box
border-c
Border color of the userbox
id-op, info-op, border-op
Optional inline styles (e.g. shadows, transitions)
nocat
If set to true, disables automatic categorization

Advanced Styling

You can apply CSS gradients, shadows, and more advanced styles using the -op parameters. For example:

| info-op = box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.2);

See also

No description.

Template parameters

ParameterDescriptionTypeStatus
IDid

Text or image shown on the left side of the userbox (typically short)

Example
MOD
Unknownsuggested
Infoinfo

The main text content of the userbox.

Example
This user is a moderator and may be data-mining your contributions, btw.
Unknownrequired
Border colorborder-c

The color of the border. This uses hex colors (#fff for white, #000000 for black)

Example
#6a000
Unknownoptional
ID colorid-c

Background color (or gradient) of the ID box. This uses hex colors (#fff for white, #000000 for black).

Example
#8f0000
Unknownoptional
Info font colorinfo-fc

Font color of the info box. This uses hex colors (#fff for white, #000000 for black).

Example
#fff
Unknownoptional
id-opid-op

Optional inline styles (e.g. shadows, transitions).

Unknownoptional
info-opinfo-op

Optional inline styles (e.g. shadows, transitions).

Unknownoptional
border-opborder-op

Optional inline styles (e.g. shadows, transitions).

Unknownoptional