Template:Simplecalc label

From TibiaCraft
Jump to navigationJump to search

{{{label}}}

Documentation[view] [edit] [history] [purge]

This template is borrowed from Wikipedia Template:Calculator label.

Usage

Add a label for a field from {{simplecalc}}. This associates the label with the element which is better for accessibility. It also means if you click on the label, it selects the field in question.

Generally you just set the for parameter to the id of your calculator widget.

Example

{{simplecalc|type=checkbox|id=mycheck}} {{simplecalc label|Label for checkbox|for=mycheck}}

Produces:

Label for checkbox

Codex mode

If the codex parameter is set, then this label will be displayed in codex mode. In this mode you can also use the optional description and flag parameters.

See https://doc.wikimedia.org/codex/latest/components/demos/label.html#guidelines for guidelines on how best to use codex labels.

As an example:

{{Simplecalc label|codex=true|description=Short description text|label=Label text|flag=(optional)|for=foo}}
<div class="cdx-text-input">{{simplecalc|type=text|class=cdx-text-input__input|default=42|id=foo}}</div>

Produces:

Label text (optional)Short description text
42

TemplateData

Way to add a label to a form control from Template:Simplecalc. Adding labels using this template helps ensure calculators are accessible

Template parameters

ParameterDescriptionTypeStatus
11 label

Text for label

Contentrequired
forfor

The id from the simplecalc template this label is for

Stringrequired
classclass

CSS class or classes to add to label

Stringoptional
class-liveclass-live

CSS classes applied only when the gadget is enabled

Stringoptional
codexcodex

Make this a codex style label

Booleanoptional
codex-classcodex-class

Extra class on the codex wrapper

Example
cdx-radio__label
Stringoptional
descriptiondescription

[codex mode only] Additional description text about the widget that is not part of the label

Contentoptional
description-iddescription-id

[codex mode only] id for the description element

Stringoptional
flagflag

[Codex mode only] Additional information about the widget. Usually to mark a field as optional

Example
(optional)
Contentoptional
stylestyle

CSS for label

Stringoptional
titletitle

Tooltip to show on hover

Stringoptional
[view] [edit] [history] [purge]The above documentation is transcluded from Template:Simplecalc label/doc.