Description
A formatted text box for any editor to place on their user page—typically inside a {{UserInfobox}}—and customize with information about themselves, or create secondary templates for multiple users to place on their own pages.
Usage
The template's parameters are listed below. It is not necessary to name the first four parameters if they are assigned values in order, so template calls may use the shorthand form {{Userbox|color1|color2|caption|text}}.
{{Userbox
|color1=
|color2=
|caption=
|text=
|border=
|style=
|style1=
|style2=
|headerbackground=
}}
Required parameters
|color1 The color of the left cell's background and the box border.
|color2 The color of the right cell's background.
|caption The content of the left cell. This is often an image, which will stretch the cell if not constrained to fit within a 45px × 45px space.
|text The content of the right cell.
Optional parameters
|border= The box border color, which defaults to color1.
|style= Any additional CSS values to set for the entire box. Do not include quotation marks.
|style1= Any additional CSS for the left cell.
|style2= Any additional CSS for the right cell.
|headerbackground= Determines whether each cell's background is automatically darkened when viewed on a web browser in dark mode. The default value is 1, which applies dark-mode behavior to the right cell only. Setting |headerbackground=0 will disable dark-mode behavior, whereas |headerbackground=2 will apply it to both cells.
Examples
| Description
|
Code
|
Result
|
| Implicit parameters
|
{{Userbox|#CCC|#EEE|blah|blah blah blah}}
|
|
| Explicit parameters
|
{{Userbox
|color1=#CCC
|color2=#EEE
|caption=blah
|text=blah blah blah
}}
|
|
| Different border color
|
{{Userbox|#CCC|#EEE|blah|blah blah blah|border=#F00}}
|
|
| Extra table styling
|
{{Userbox|#CCC|#EEE|blah|blah blah blah|border=#00F|style=border-style:dashed}}
|
|
| Extra cell styling
|
{{Userbox|#CCC|#EEE|blah|blah blah blah|style1=color:#F00|style2=color:#00F}}
|
|
| Fully preserved in dark mode
|
{{Userbox|#CCC|#EEE|blah|blah blah blah|style1=color:#F00|style2=color:#00F|headerbackground=0}}
|
|
| Fully reactive to dark mode
|
{{Userbox|#CCC|#EEE|blah|blah blah blah|style1=color:#F00|style2=color:#00F|headerbackground=2}}
|
|
See also