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

Icon and indicator widgets contain small graphics (about the size of normal text) that efficiently convey information to help users interact with and understand an interface.

Les étiquettes sont aussi utilisées pour aider à identifier les composants des interfaces. La valeur d'une étiquette peut être une chaîne de caractères, un noeud d'étiquettes ou une fonction qui les renvoie.

Icônes
The OOUI library contains over 100 icons that can be used by s to create small graphical elements that handle events. s should rarely be used without a label, though a label may be omitted if space is at a premium (e.g. in a toolbar) or if the icon is used in a context where its meaning is very clear to the user. 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.

Indicateurs
Les indicateurs sont de petites icônes avec des cas d'utilisation très restreints :


 * 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:



Les indicateurs suivants sont inclus dans la bibliothèque OOUI :

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.

Etiquettes
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.