ui.Label
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Libellé textuel.
Utilisation | Renvoie |
---|
ui.Label(value, style, targetUrl, imageUrl) | ui.Label |
Argument | Type | Détails |
---|
value | Chaîne, facultative | Texte à afficher. La valeur par défaut est une chaîne vide. |
style | Objet, facultatif | Objet des styles CSS autorisés avec leurs valeurs à définir pour ce widget. Consultez la documentation de style(). |
targetUrl | Chaîne, facultative | URL à associer. La valeur par défaut est une chaîne vide. |
imageUrl | Chaîne, facultative | URL de l'image (facultatif). Si un libellé est fourni, il sera affiché sous forme d'image et le texte de la valeur s'affichera lorsque l'utilisateur pointera dessus avec la souris. Seules les URL de données et les icônes chargées depuis gstatic.com sont autorisées. |
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 2025/07/26 (UTC)."],[[["\u003cp\u003eCreates a text label UI element that can optionally display an image and link to a URL.\u003c/p\u003e\n"],["\u003cp\u003eCustomization options include text value, CSS styling, target URL, and image URL.\u003c/p\u003e\n"],["\u003cp\u003eImage URLs are restricted to data URLs and icons from gstatic.com, displayed on hover with the text value as a tooltip.\u003c/p\u003e\n"],["\u003cp\u003eDefault values are provided for optional arguments, resulting in an empty label with no styling or linking.\u003c/p\u003e\n"]]],["The `ui.Label` function creates a text label with optional styling, a target URL, and an image. The `value` argument sets the displayed text, `style` customizes the CSS, `targetUrl` defines a link, and `imageUrl` displays an image with hover text. The text, style, URL, and image arguments are all optional and have default values. The label will only allow images from gstatic.com or data urls.\n"],null,["# ui.Label\n\n\u003cbr /\u003e\n\nA text label.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------|----------|\n| `ui.Label(`*value* `, `*style* `, `*targetUrl* `, `*imageUrl*`)` | ui.Label |\n\n| Argument | Type | Details |\n|-------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | String, optional | The text to display. Defaults to an empty string. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. See style() documentation. |\n| `targetUrl` | String, optional | The url to link to. Defaults to an empty string. |\n| `imageUrl` | String, optional | Optional image url. If provided, the label will be rendered as an image and the value text will be shown on mouse hover. Only data: urls and icons loaded from gstatic.com are allowed. |"]]