Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.
ui.Button
Stay organized with collections
Save and categorize content based on your preferences.
A clickable button with a text label.
| Usage | Returns | ui.Button(label, onClick, disabled, style, imageUrl) | ui.Button |
| Argument | Type | Details | label | String, optional | The button's label. Defaults to an empty string. |
onClick | Function, optional | A callback fired when the button is clicked. The callback is passed the button widget. |
disabled | Boolean, optional | Whether the button is disabled. Defaults to false. |
style | Object, optional | An object of allowed CSS styles with their values to be set for this widget. Defaults to an empty object. |
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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],["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"]]