ui.Button
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
क्लिक किए जा सकने वाले बटन पर टेक्स्ट लेबल मौजूद है.
इस्तेमाल | रिटर्न |
---|
ui.Button(label, onClick, disabled, style, imageUrl) | ui.Button |
आर्ग्यूमेंट | टाइप | विवरण |
---|
label | स्ट्रिंग, ज़रूरी नहीं | बटन का लेबल. डिफ़ॉल्ट रूप से, यह खाली स्ट्रिंग होती है. |
onClick | फ़ंक्शन, ज़रूरी नहीं है | बटन पर क्लिक करने पर ट्रिगर होने वाला कॉलबैक. कॉलबैक को बटन विजेट पास किया जाता है. |
disabled | बूलियन, ज़रूरी नहीं | क्या बटन बंद है. डिफ़ॉल्ट रूप से, यह 'गलत' पर सेट होती है. |
style | ऑब्जेक्ट, ज़रूरी नहीं है | सीएसएस की उन स्टाइल का ऑब्जेक्ट जिन्हें इस विजेट के लिए सेट किया जा सकता है. डिफ़ॉल्ट रूप से, यह एक खाली ऑब्जेक्ट होता है. |
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 clickable button widget with customizable text label, click functionality, and appearance.\u003c/p\u003e\n"],["\u003cp\u003eAllows setting an optional image for the button, displaying the label text on hover.\u003c/p\u003e\n"],["\u003cp\u003eCan be disabled to prevent user interaction.\u003c/p\u003e\n"],["\u003cp\u003eProvides flexibility in styling through CSS properties.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a straightforward constructor function for instantiation with various parameters.\u003c/p\u003e\n"]]],["The `ui.Button` function creates a clickable button. It accepts optional arguments: `label` (text), `onClick` (callback function on click), `disabled` (boolean to disable), `style` (CSS styling), and `imageUrl` (image for the button). When clicked, the `onClick` callback is triggered, receiving the button widget. The button can be customized with a text label or an image, and its appearance can be altered via CSS. Only specific URLs are allowed for the image.\n"],null,["# ui.Button\n\n\u003cbr /\u003e\n\nA clickable button with a text label.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------|-----------|\n| `ui.Button(`*label* `, `*onClick* `, `*disabled* `, `*style* `, `*imageUrl*`)` | ui.Button |\n\n| Argument | Type | Details |\n|------------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `label` | String, optional | The button's label. Defaults to an empty string. |\n| `onClick` | Function, optional | A callback fired when the button is clicked. The callback is passed the button widget. |\n| `disabled` | Boolean, optional | Whether the button is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. Defaults to an empty object. |\n| `imageUrl` | String, optional | Optional image url. If provided, the button 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. |"]]