# How to use HTML react GUI

**URL:** <https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442>\
**Category:** Questions\
**Tags:** react, gui\
**Created:** [March 15, 2022, 11:46am UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442 "2022-03-15T11:46:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/todilo/32/19084_2.png) [@Todilo](https://forum.babylonjs.com/u/Todilo)\
**Post date:** [March 15, 2022, 11:46am UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/1 "2022-03-15T11:46:00Z")

</div>

I am using react-babylonjs and am finding the babylon 2d UI to be hard making it look good. Does anyone know if it possible to incorporate a react-ui as the HTML/UI . That way I could even use a css framework/library using those components. But don’t know how to connet the HTML GUI with react.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 15, 2022, 4:02pm UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/2 "2022-03-15T16:02:58Z")

</div>

I am not sure to understand, the question is about how to connect React to normal HTML elements ?

---

<div class="post-metadata">

**Author:** ![Todilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/todilo/32/19084_2.png) [@Todilo](https://forum.babylonjs.com/u/Todilo)\
**Post date:** [March 15, 2022, 8:04pm UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/3 "2022-03-15T20:04:14Z")

</div>

I’m sorry, my question was poorly formulated.

Does anyone have code for placing react components on top of the canvas used for babylon rendering. The reason I am asking is because I am using the react-babylonjs library. And the 2d ui components (like rectangle, button etc) that you put inside a _adtFullscreenUi_ isn’t as nice looking and a bit hard for me to control.

Something like the [https://brianzinn.github.iano/react-babylonjs/?path=/story/gui--html-text](https://brianzinn.github.iano/react-babylonjs/?path=/story/gui--html-text) example but for 2d UI.

If that makes more sense?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 15, 2022, 8:52pm UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/4 "2022-03-15T20:52:26Z")

</div>

Yup definitely, you should be able to do it with css, maybe @brianzinn has some examples handy ?

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [March 15, 2022, 11:02pm UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/5 "2022-03-15T23:02:11Z")

</div>

Check this repo with live site. The DOM on the canvas optionally carries over to AR with DOM overlay:

> **[GitHub - brianzinn/xr-dom-overlay-react: React Babylonjs and xr-dom-overlay](https://github.com/brianzinn/xr-dom-overlay-react)**
>
> React Babylonjs and xr-dom-overlay. Contribute to brianzinn/xr-dom-overlay-react development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 10:22am UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/6 "2022-04-14T10:22:16Z")

</div>

Hello @Todilo just checking in, was your question solved? 😃

---

<div class="post-metadata">

**Author:** ![Todilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/todilo/32/19084_2.png) [@Todilo](https://forum.babylonjs.com/u/Todilo)\
**Post date:** [April 14, 2022, 10:49am UTC](https://forum.babylonjs.com/t/how-to-use-html-react-gui/28442/7 "2022-04-14T10:49:09Z")

</div>

Yes, thank you! I didn’t really get the performance I was looking for and not all the components was available with the same customization, but it was good enough.
