OOUI/Widgets/Icons, Indicators, and Labels/nl

Pictogram- en indicatorwidgets bevatten kleine afbeeldingen (ongeveer zo groot als normale tekst) die efficiënt informatie overbrengen om gebruikers te helpen communiceren met en begrijpen van een interface.

Labels worden ook gebruikt om interfacecomponenten te identificeren. De waarde van een label kan worden ingesteld op een tekenreeks, een labelnode of een functie die ze retourneert.

Pictogrammen
De OOUI-bibliotheek bevat meer dan 100 pictogrammen die door IconWidgets kunnen worden gebruikt om kleine grafische elementen te maken die gebeurtenissen afhandelen. Een  mag zelden zonder label worden gebruikt, hoewel een label kan worden weggelaten als de ruimte beperkt is (bijvoorbeeld in een werkbalk) of als het pictogram wordt gebruikt in een context waarin de betekenis ervan heel duidelijk is voor de gebruiker. In these cases, consider using a quiet  instead (which can include a label and icon itself).

To create an, use an   with a   (IconWidget & LabelWidget live demo):



s support a number of methods that can be used to handle events and to get or set the value of contained elements. For example,  will return the name of the icon; , which takes either a symbolic icon name or a map of icon names keyed by language, will set the icon; and   will set the icon title. For a full list of supported methods and configuration options, please see the code-level documentation for s.

You need to load related styles somewhere before creating, e.g. via ResourceLoader. Modules named by mask, e.g.   for check icon. Group names can be found in demo page or in code.

Indicators
Indicators are small icons with very limited use cases:


 * To act as indicating elements within widgets on limited screen space, for example to signify a 'clear' action in a SearchInputWidget.
 * To clarify the function of a control that acts in an exceptional way (a dropdown that opens a menu instead of performing an action directly, for example).

s are often used by other widgets (e.g., text inputs, dropdowns, decorated options). In the following example, a  uses an indicator to help clarify that the field is required:



The following indicators are included in the OOUI library:

Methods can be used to set or get the indicator title ( and , respectively) or to get the name of the indicator. For a full list of supported methods and configuration options, please see the code-level documentation for IndicatorWidgets.

Labels
Labels help identify the function of interface elements. Each  can be configured with a   option that is set to a string, a label node, or a function:


 * String: a plaintext string
 * Label Node: a jQuery selection of elements. A jQuery selection is used for anything other than a plaintext label, e.g., a label that includes a link or special styling, such as a gray color or additional graphical elements.
 * Function: a function that will produce a string in the future. Functions are used in cases where the label value is not currently defined. See Extending the Library for more information.

For a full list of supported methods and configuration options, please see the code-level documentation for s.