#raw text component

1 messages · Page 1 of 1 (latest)

feral tusk
#

is it possible for a component to "print" just raw text (without any tag):

---
---

hello
sweet hollowBOT
#

Hi @feral tusk. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, it is possible for an Astro component to render raw text. You can use the is:raw directive to instruct the Astro compiler to treat any children of that element as text. This means that all special Astro templating syntax will be ignored inside of this component. Here is an example:

---
import MyComponent from '../components/MyComponent.astro';
---
<MyComponent is:raw>hello</MyComponent>

In this example, the text "hello" will be treated as raw text and will be rendered as is, without any tags.

You can find more information about this in the Astro documentation (https://docs.astro.build/en/reference/directives-reference#israw).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: