# Use aurelia component in string from api

**URL:** <https://discourse.aurelia.io/t/use-aurelia-component-in-string-from-api/5334>\
**Category:** vNext\
**Created:** [January 2, 2024, 6:51pm UTC](https://discourse.aurelia.io/t/use-aurelia-component-in-string-from-api/5334 "2024-01-02T18:51:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnnn](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/nnnn/32/2465_2.png) [@nnnn](https://discourse.aurelia.io/u/nnnn)\
**Post date:** [January 2, 2024, 6:51pm UTC](https://discourse.aurelia.io/t/use-aurelia-component-in-string-from-api/5334/1 "2024-01-02T18:51:22Z")

</div>

I get back a string from an api request I make in binding method. This string has text which may have a component like

```auto
blah bloop beep shoop <highlight>shquerp merp derp</highlight> plerp.

```

I have a highlight component that I want to use where the `<highlight>` is, and I want to have the text inside highlight passed to default slot of highlight component.

Thanks and happy new year!

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [January 2, 2024, 8:10pm UTC](https://discourse.aurelia.io/t/use-aurelia-component-in-string-from-api/5334/2 "2024-01-02T20:10:39Z")

</div>

Hi @nnnn! Wish you a happy new year as well!

I think firstly you need, [synthetic view](https://docs.aurelia.io/tutorials/synthetic-view). That way, you can hydrate this string into DOM nodes, and attach those to some host node.

If you are using the native slot element in `highlight`, then that’s probably all you need. In case, you are using `au-slot` then you can do one of the following:

- Wrap the projected content for `highlight`from the server; example: `<highlight><span au-slot>shquerp merp derp</span></highlight>`.
- Or, use the `processContent` hook in the `highlight` to make this wrapping happen on client side.
