# Using a React library

Add the [library CDN](https://v4.mui.com/components/buttons/) to the widget's *3rd party libraries*:

```
https://unpkg.com/@material-ui/core@4.11.4/umd/material-ui.development.js
```

In this path, `umd` indicates that the CDN bundle uses the UMD format.

In the code editor's HTML tab, add the following:

```html
<div id="root"></div>
```

Switch to the JavaScript (JSX) tab and paste the following:

```javascript
const { createRoot } = ReactDOM;
const { Button } = MaterialUI;


function App() {
    return (
        <>
            <Button variant="contained" color="primary">
                First button using React and Material UI
            </Button>
            <Button variant="outlined" color="secondary">
                Another button
            </Button>
        </>
    );
}


```

After you save the changes, the widget renders like this:

<figure><img src="/files/bwF7MwIAT9MvKVfH35ba" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ubidots.com/dashboards-and-widgets/html-canvas/examples/using-a-react-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
