> For the complete documentation index, see [llms.txt](https://bemtv.gitbook.io/bemtvjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bemtv.gitbook.io/bemtvjs/introducing-brackethtml.md).

# Introducing Brackethtml

Consider this variable declaration:

```javascript
const btn = `button[Click me!]`;
```

This syntax is called “Brackethtml” it reduces the redundancy of HTML and still can be easily understood as HTML, in addition to supporting HTML normally.

### **Brackethtml + CSS-in-JS (**[**goober**](https://github.com/cristianbote/goober)**)**

Brackethtml already comes with a built-in CSS-in-JS library. In the previous examples, if we wanted to add some style to our button we could do:

```javascript
const btn = `button[color:blue; ~ Click me!]`;
```

### **Usage rules**

The list below describes the usage rules:

* The HTML tag name must be followed by square brackets:

```javascript
const btn = `button[]`;
```

* The `~` symbol must be used inside tags that may contain children to separate attributes and CSS-in-JS from their children, and must be used between whitespace:

```javascript
const btn = `h1[color:blue; ~ Hey!] img[src="my-avatar.png"]`;
```

* Tag attributes must always come before CSS-in-JS and use only double quotes `"`:

```javascript
const btn = `button[data-username = "Bemtv" padding:50px; ~ Hello!]`;
```

* CSS-in-JS must only use single quotes `'`:

```javascript
const btn = `button[class="hello" font-family:'Courier New'; ~ Click me!]`;
```

### **Special characters**

Some characters should be escaped to be used without Brackethtml interpreting them: `~`, `[`, `]`, `#`, `@`, and `$`.

To escape them just wrap them in parentheses `(` `)`:

```javascript
const btn = `button[Click (~) me!]`;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://bemtv.gitbook.io/bemtvjs/introducing-brackethtml.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
