# Wrap output with custom HTML (/recipes/wrap-output-with-custom-html)

### JavaScript / TypeScript

```js
const html = await highlight(
  'const x = 1',
  htmlInline({
    language: javascript,
    theme: frappe,
    header: {
      openTag: '<figure><figcaption>index.js</figcaption>',
      closeTag: '</figure>',
    },
  })
)
```

### Rust

```rust
use lumis::{
    formatters::html::HtmlElement, highlight,
    languages::Language, themes, HtmlInlineBuilder,
};

let html = highlight(
    "fn main() {}",
    HtmlInlineBuilder::new()
        .language(Language::Rust)
        .theme(Some(
            themes::get("catppuccin_frappe").unwrap(),
        ))
        .header(Some(HtmlElement {
            open_tag:
                "<figure><figcaption>main.rs</figcaption>"
                    .to_string(),
            close_tag: "</figure>".to_string(),
        }))
        .build()
        .unwrap(),
);
```

### Elixir

```elixir
Lumis.highlight!(
  "const x = 1",
  formatter:
    {:html_inline,
     language: "javascript",
     theme: "catppuccin_frappe",
     header: %{
       open_tag:
         "<figure><figcaption>index.js</figcaption>",
       close_tag: "</figure>"
     }}
)
```


See [Build a code block header with copy button](/recipes/file-title-copy) for a fuller pattern.