# HTML

## Basics

### Installing Widgets

Each widget comes with a Javascript and CSS file.  To add a widgets to your website, you will need to add its corresponding Javascript and CSS to the `<head>` of your website.

**Example:**

```html
<head>
  <script src="https://connect.manifoldxyz.dev/latest/connect.umd.min.js"></script>
  <link rel="stylesheet" href="https://connect.manifoldxyz.dev/latest/connect.css">
</head>
```

The uri for the Javascript and CSS for each widget is as follows:

```
https://<WIDGET_NAME>.manifoldxyz.dev/<WIDGET_VERSION>/<WIDGET_NAME>.umd.min.js
https://<WIDGET_NAME>.manifoldxyz.dev/<WIDGET_VERSION>/<WIDGET_NAME>.css
```

{% hint style="warning" %}
If you always want the latest version, use **latest** for the \<WIDGET\_VERSION>. However, due to the changing nature of the codebase, it is possible that the "newer" **latest** is no longer compatible with the "previous" **latest** used to develop the app. It is thus recommended that you use a specific version of a widget for consistent results.
{% endhint %}

You can find a list of widgets, versions and links [here](/manifold-for-developers/resources/widgets/directory.md).

### Using Widgets

To use a widget, simply add a `<div>` in the `<body>` of your website corresponding to the widget you want to use.

**Example:**

<pre class="language-html"><code class="lang-html">&#x3C;body>
  &#x3C;div  
    data-widget="m-connect"
    data-grant-type="&#x3C;your app grant type, `signature` or `token`>"
    data-client-id="&#x3C;your app client id>"  
    data-app-name="&#x3C;your app name>"  
    data-network="&#x3C;your desired network's chain id>"
  >
<strong>  &#x3C;/div>
</strong><strong>&#x3C;/body>
</strong></code></pre>

You can find a list of widgets, versions and links [here](/manifold-for-developers/resources/widgets/directory.md).

### Styling

Widgets are styled using standard CSS.

Some widgets may include links pointing to additional stylesheets. These additional stylesheets (usually named `<WIDGET_NAME>.manifold-light.css` or `<WIDGET_NAME>.manifold-dark.css`) build **on top of** the base stylesheet (usually named `<WIDGET_NAME>.css`), thus the additional stylesheets should be included **after** the base one.

## Examples

Examples of commonly used features can be found [here](https://github.com/manifoldxyz/manifold-templates/tree/main/html). Please feel free to use this as a starting point to building your own dApp.


---

# 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://docs.manifold.xyz/manifold-for-developers/guides/html.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.
