ui.Label
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेक्स्ट का लेबल.
इस्तेमाल | रिटर्न |
---|
ui.Label(value, style, targetUrl, imageUrl) | ui.Label |
आर्ग्यूमेंट | टाइप | विवरण |
---|
value | स्ट्रिंग, ज़रूरी नहीं | दिखाने के लिए टेक्स्ट. डिफ़ॉल्ट रूप से, यह खाली स्ट्रिंग होती है. |
style | ऑब्जेक्ट, ज़रूरी नहीं है | सीएसएस की उन स्टाइल का ऑब्जेक्ट जिन्हें इस विजेट के लिए सेट किया जा सकता है. style() फ़ंक्शन का दस्तावेज़ देखें. |
targetUrl | स्ट्रिंग, ज़रूरी नहीं | लिंक करने के लिए यूआरएल. डिफ़ॉल्ट रूप से, यह खाली स्ट्रिंग होती है. |
imageUrl | स्ट्रिंग, ज़रूरी नहीं | इमेज का यूआरएल वैकल्पिक है. अगर यह एट्रिब्यूट दिया जाता है, तो लेबल को इमेज के तौर पर रेंडर किया जाएगा. साथ ही, वैल्यू टेक्स्ट को माउस घुमाने पर दिखाया जाएगा. सिर्फ़ data: यूआरएल और gstatic.com से लोड किए गए आइकॉन इस्तेमाल किए जा सकते हैं. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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. |"]]