# \#button

**URL:** https://forum.babylonjs.com/tag/button/31.md

[Latest](https://forum.babylonjs.com/latest.md) · [Categories](https://forum.babylonjs.com/categories.md) · [Tags](https://forum.babylonjs.com/tags.md)

---

## [Why GUI.Button cannot resizeToFit / adaptWidthToChildren?](https://forum.babylonjs.com/t/why-gui-button-cannot-resizetofit-adaptwidthtochildren/61534)

<div class="topic-metadata">

**Author:** [@qwiglydee](https://forum.babylonjs.com/u/qwiglydee)\
**Replies:** 1\
**Last updated:** [November 23, 2025, 3:05pm UTC](https://forum.babylonjs.com/t/why-gui-button-cannot-resizetofit-adaptwidthtochildren/61534 "2025-11-23T15:05:48Z")

</div>

Basically, button = rect + textblock But the button takes full screen width. Is it a bug or a feature?

---

## [Messed up linespacing in UI](https://forum.babylonjs.com/t/messed-up-linespacing-in-ui/60356)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://forum.babylonjs.com/u/RainerHeintzmann)\
**Replies:** 2\
**Last updated:** [September 3, 2025, 8:12pm UTC](https://forum.babylonjs.com/t/messed-up-linespacing-in-ui/60356 "2025-09-03T20:12:10Z")

</div>

I noticed that in Babylon 8.25 there is a problem with the line spacing layout in nested layouts. using Buttons or TextBox together with multiline texts (i.e. having a number of \\n in them). Somehow the lines collaps to…

---

## [QUICK REFERENCE: Button](https://forum.babylonjs.com/t/quick-reference-button/54538)

<div class="topic-metadata">

**Author:** [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Replies:** 13\
**Last updated:** [November 9, 2024, 6:28pm UTC](https://forum.babylonjs.com/t/quick-reference-button/54538 "2024-11-09T18:28:09Z")

</div>

Similar to the StandardMaterial reference tables I created, here’s a table that roughly groups Button properties by purpose. It helps me quickly find relevant properties on the Button GUI control. Visual Position & …

---

## [GUI related: how to position a button in one of the corners of a given screen? (SOLVED)](https://forum.babylonjs.com/t/gui-related-how-to-position-a-button-in-one-of-the-corners-of-a-given-screen-solved/52852)

<div class="topic-metadata">

**Author:** [@chicortiz](https://forum.babylonjs.com/u/chicortiz)\
**Replies:** 6\
**Last updated:** [August 18, 2024, 9:20pm UTC](https://forum.babylonjs.com/t/gui-related-how-to-position-a-button-in-one-of-the-corners-of-a-given-screen-solved/52852 "2024-08-18T21:20:03Z")

</div>

Hello Babylon.js Fellas! How are you? Guys, could you help me? I’m trying to change the position of a button. It would be nice if the button could apper on one of the corners of a given screen. At the moment it is app…

---

## [Clicking child button on parent button](https://forum.babylonjs.com/t/clicking-child-button-on-parent-button/48782)

<div class="topic-metadata">

**Author:** [@DavidP](https://forum.babylonjs.com/u/DavidP)\
**Replies:** 4\
**Last updated:** [March 14, 2024, 8:19pm UTC](https://forum.babylonjs.com/t/clicking-child-button-on-parent-button/48782 "2024-03-14T20:19:27Z")

</div>

Hello, How can I ignore a click on parent button, and trigger onPointerUpObservable of my child? Note: I cannot use Rectangle for my parent because I need to apply texture to the parent thank you

---

## [Can't render button in reactjs](https://forum.babylonjs.com/t/cant-render-button-in-reactjs/46715)

<div class="topic-metadata">

**Author:** [@mabak71270](https://forum.babylonjs.com/u/mabak71270)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 12:14pm UTC](https://forum.babylonjs.com/t/cant-render-button-in-reactjs/46715 "2023-12-26T12:14:34Z")

</div>

Merry christmas team, I have this code below to render .glb file and interactive button: useEffect(() =\> { let engine: any = null let scene: any = null let sceneToRender: any = null const initFunction …

---

## [How to change the material of HolographicButton](https://forum.babylonjs.com/t/how-to-change-the-material-of-holographicbutton/46263)

<div class="topic-metadata">

**Author:** [@Qq\_Xia](https://forum.babylonjs.com/u/Qq_Xia)\
**Replies:** 6\
**Last updated:** [December 11, 2023, 10:10am UTC](https://forum.babylonjs.com/t/how-to-change-the-material-of-holographicbutton/46263 "2023-12-11T10:10:38Z")

</div>

Hello, I have a question for this example: The frontMaterial is a read only property, and this example is using set a new material in frontMaterial, and it works. But I am doing it in my project in VScode, it does’t …

---

## [How to hide GUI buttons when they are behind a mesh](https://forum.babylonjs.com/t/how-to-hide-gui-buttons-when-they-are-behind-a-mesh/45251)

<div class="topic-metadata">

**Author:** [@Nshen](https://forum.babylonjs.com/u/Nshen)\
**Replies:** 6\
**Last updated:** [October 31, 2023, 10:22am UTC](https://forum.babylonjs.com/t/how-to-hide-gui-buttons-when-they-are-behind-a-mesh/45251 "2023-10-31T10:22:27Z")

</div>

Hi, I recently started using Babylon and also very new to 3D programming. I wanted to create something like this: https://sketchfab.com/3d-models/anatomy-of-the-human-brain-2019-4870387fd52b4706a87b1f3337356579 where I…

---

## [Creating Button using GUI](https://forum.babylonjs.com/t/creating-button-using-gui/38031)

<div class="topic-metadata">

**Author:** [@Syed\_Yousuf](https://forum.babylonjs.com/u/Syed_Yousuf)\
**Replies:** 2\
**Last updated:** [February 8, 2023, 10:47am UTC](https://forum.babylonjs.com/t/creating-button-using-gui/38031 "2023-02-08T10:47:15Z")

</div>

I am trying to use GUI to create a button and click action on it in scene using the following reference: But i am getting error like this: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading …

---

## [GUI (Plane rotation around mesh)](https://forum.babylonjs.com/t/gui-plane-rotation-around-mesh/22554)

<div class="topic-metadata">

**Author:** [@Naznarok](https://forum.babylonjs.com/u/Naznarok)\
**Replies:** 6\
**Last updated:** [January 29, 2023, 8:42pm UTC](https://forum.babylonjs.com/t/gui-plane-rotation-around-mesh/22554 "2023-01-29T20:42:18Z")

</div>

Hello! I’m trying to recreate UI mechanic shown on this Video. I cant figure out how to rotate Plane around Mesh. I would be grateful for your help :slight\_smile: Playground Screenshot

---

## [How to change the color of a TouchHolographicButton?](https://forum.babylonjs.com/t/how-to-change-the-color-of-a-touchholographicbutton/37083)

<div class="topic-metadata">

**Author:** [@gunpowderfans](https://forum.babylonjs.com/u/gunpowderfans)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 9:25am UTC](https://forum.babylonjs.com/t/how-to-change-the-color-of-a-touchholographicbutton/37083 "2023-01-04T09:25:33Z")

</div>

Can it be other colors not default blue?

---

## [Stuck Control3D if two mouse inputs down at the same time](https://forum.babylonjs.com/t/stuck-control3d-if-two-mouse-inputs-down-at-the-same-time/36443)

<div class="topic-metadata">

**Author:** [@jdup](https://forum.babylonjs.com/u/jdup)\
**Replies:** 4\
**Last updated:** [December 13, 2022, 5:39pm UTC](https://forum.babylonjs.com/t/stuck-control3d-if-two-mouse-inputs-down-at-the-same-time/36443 "2022-12-13T17:39:16Z")

</div>

Hello all, There seems to be a fairly consistent issue with input handling around the Control3D elements. Any time you have two inputs down on a control, it is then forever in the down state, never receiving any additi…

---

## [Recommended way to create irregular custom shaped GUI buttons?](https://forum.babylonjs.com/t/recommended-way-to-create-irregular-custom-shaped-gui-buttons/11873)

<div class="topic-metadata">

**Author:** [@inteja](https://forum.babylonjs.com/u/inteja)\
**Replies:** 11\
**Last updated:** [September 14, 2022, 3:24pm UTC](https://forum.babylonjs.com/t/recommended-way-to-create-irregular-custom-shaped-gui-buttons/11873 "2022-09-14T15:24:28Z")

</div>

I’m really loving Babylon.js GUI but am just wondering if there’s an easy way to create irregular custom shaped GUI buttons like say this: It looks like I’d have to replicate the Rectangle class (modify the \_localDraw…

---

## [Not able to load Scene due to error in button.ts](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952)

<div class="topic-metadata">

**Author:** [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Replies:** 12\
**Last updated:** [May 3, 2022, 12:04pm UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952 "2022-05-03T12:04:54Z")

</div>

I had used babylon js cdns in my project. Everything was working great until yesterday. The version got updated from 4.2 to 5. But now i was unable to load the scene. On opening console, I got this error. Any ideas how …

---

## [How to make conditional slider based on buttons?](https://forum.babylonjs.com/t/how-to-make-conditional-slider-based-on-buttons/24014)

<div class="topic-metadata">

**Author:** [@twinturbotom](https://forum.babylonjs.com/u/twinturbotom)\
**Replies:** 2\
**Last updated:** [September 22, 2021, 5:53pm UTC](https://forum.babylonjs.com/t/how-to-make-conditional-slider-based-on-buttons/24014 "2021-09-22T17:53:46Z")

</div>

Hi, I’m putting together a simple GUI with buttons (global, height, width, depth) that determine what the slider value changes. This way I can have one slider that performs multiple transformations (global, position, e…

---

## [Buttons behaving wierdly](https://forum.babylonjs.com/t/buttons-behaving-wierdly/20865)

<div class="topic-metadata">

**Author:** [@blackarc](https://forum.babylonjs.com/u/blackarc)\
**Replies:** 4\
**Last updated:** [May 18, 2021, 7:52am UTC](https://forum.babylonjs.com/t/buttons-behaving-wierdly/20865 "2021-05-18T07:52:22Z")

</div>

hi, I am working on a scene where in I created 4 image buttons. They are using SVG images over a colored background. I am stretching them so they look nice. Well now they are looking nice, but the problem is that the cl…

---

## [Button to pop up URL](https://forum.babylonjs.com/t/button-to-pop-up-url/20273)

<div class="topic-metadata">

**Author:** [@Philip\_Fong](https://forum.babylonjs.com/u/Philip_Fong)\
**Replies:** 4\
**Last updated:** [April 30, 2021, 5:42pm UTC](https://forum.babylonjs.com/t/button-to-pop-up-url/20273 "2021-04-30T17:42:50Z")

</div>

Hello, Can you click a 3d object and open a pop up window with external URL? Thank you.

---

## [Bug in GUI3D manager](https://forum.babylonjs.com/t/bug-in-gui3d-manager/19811)

<div class="topic-metadata">

**Author:** [@saifshk17](https://forum.babylonjs.com/u/saifshk17)\
**Replies:** 8\
**Last updated:** [April 9, 2021, 7:34pm UTC](https://forum.babylonjs.com/t/bug-in-gui3d-manager/19811 "2021-04-09T19:34:28Z")

</div>

Hello, There is an ongoing bug with the camera on 3D GUI Manager. The arccamera does not rotate at all when a 3D manager is created. Kindly take a look at these two links: (a) https://playground.babylonjs.com/#HJZBRG#0 …

---

## [Making a hold button](https://forum.babylonjs.com/t/making-a-hold-button/17432)

<div class="topic-metadata">

**Author:** [@klee](https://forum.babylonjs.com/u/klee)\
**Replies:** 3\
**Last updated:** [January 13, 2021, 3:35pm UTC](https://forum.babylonjs.com/t/making-a-hold-button/17432 "2021-01-13T15:35:10Z")

</div>

Hi everyone, I’m looking to make a function that trigger an action if the button is holding down. I’m making the eventlistener like this: rightButton.addEventListener(‘mousedown’, function(event) { setTimeout(function…

---

## [HolographicButton imageUrl broken with alpha.2](https://forum.babylonjs.com/t/holographicbutton-imageurl-broken-with-alpha-2/16268)

<div class="topic-metadata">

**Author:** [@mohan\_yadav](https://forum.babylonjs.com/u/mohan_yadav)\
**Replies:** 2\
**Last updated:** [December 3, 2020, 11:40am UTC](https://forum.babylonjs.com/t/holographicbutton-imageurl-broken-with-alpha-2/16268 "2020-12-03T11:40:02Z")

</div>

Hi, Today I was upgrading a 6 month old BabylonJS project to the latest preview and found a bug on Holographic Button - specifically on the imageUrl part. I checked with the docs if the methods has changed, but it seems…

---

## [Best way to create and animate custom button styles, like for a disabled state?](https://forum.babylonjs.com/t/best-way-to-create-and-animate-custom-button-styles-like-for-a-disabled-state/15583)

<div class="topic-metadata">

**Author:** [@kintz\_09](https://forum.babylonjs.com/u/kintz_09)\
**Replies:** 15\
**Last updated:** [November 21, 2020, 1:29am UTC](https://forum.babylonjs.com/t/best-way-to-create-and-animate-custom-button-styles-like-for-a-disabled-state/15583 "2020-11-21T01:29:53Z")

</div>

I’ve been working on some custom buttons for a UI I’m building. The buttons use custom SVG images for the background and another SVG image for the primary content inside the button. Its essentially an icon-button. I fou…

---

## [Button GUI with border radius 100%](https://forum.babylonjs.com/t/button-gui-with-border-radius-100/12737)

<div class="topic-metadata">

**Author:** [@ariwoot](https://forum.babylonjs.com/u/ariwoot)\
**Replies:** 3\
**Last updated:** [July 22, 2020, 10:27am UTC](https://forum.babylonjs.com/t/button-gui-with-border-radius-100/12737 "2020-07-22T10:27:06Z")

</div>

I’d like to achieve what seems like a simple task, border radius of 100%. The button i’m using is a Button.CreateSimpleButton(“button”, “+”); It needs to have a circle shape but the property .cornerRadius accepts only …
