> 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/rendering.md).

# Rendering

To render the component we can use the `render()` function.

Optionally, we can pass a DOM element or a Selector to indicate where the component should be rendered, the default is `document.body`:

```javascript
import { _ } from "bemtv";

const { template, render } = _`App`();

template`Hello world!`;

// It can be called many times
render();
```

Another alternative is to import the `render()` method from the main module, it works similarly, but takes a `string` as the first argument and the element to render as the second:

```javascript
import { _, render } from "bemtv";

const { template } = _`App`();

template`Hello world!`;

render("App[]", "#my-content");
```
