Select to view content in your preferred language

Is it possible to create a custom button widget in Experience Builder that is only visible to certain users or a particular group?

565
5
03-16-2026 11:17 PM
CuriousDaus
Occasional Contributor

Specifically I want just add this conditional visibility to an existing button widget in Experience Builder via Developer Edition.

0 Kudos
5 Replies
JeffreyThompson2
MVP Frequent Contributor

Any Custom Widget has access to the props.user object. This object contains all the information the Online/Enterprise Portal has on the current user and can be used to customize your Widget to the user.

GIS Developer
City of Arlington, Texas
CuriousDaus
Occasional Contributor

I guess I need to learn React and JavaScript properly to do this thing. I've read and watched documentations and videos about conditional rendering, this is the thing that I should study right? Also, is it better for me to create a new custom button widget with this conditional rendering or just incorporate it in the existing ExB button widget by Esri? The source code of the existing button widget is pretty complex for me so I don't where exactly to incorporate it.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

The conditionality could be as simple as adding a ternary to your JSX. Something like this:

{validUser ? <Button></Button> :  <></>}

As for if you should build on top of the ESRI Button Widget or not, that depends on the level of optionality you are looking for. If you want something as versatile as the ESRI Button, you'll want to clone the ESRI Widget and build on top of it. If you are building a Button to do one specific thing, especially in one specific application, it will be much easier to start with a Button from the Storybook.

GIS Developer
City of Arlington, Texas
0 Kudos
CuriousDaus
Occasional Contributor

I plan to build on top of the ESRI Button Widget. So should I build at widget.tsx or setting.tsx?

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

https://developers.arcgis.com/experience-builder/guide/

This is a case where I feel I would be doing you more harm by answering your question than not. If you are going to do custom development, you will need to be able to do some basic research. Good luck.

GIS Developer
City of Arlington, Texas
0 Kudos