Native streaming markdown for NativeScript apps.
Tap image to watch it in action.
Before you begin, make sure you have:
- Environment setup (NativeScript 8.x or later)
- Node 22.x or later
# npm
npm install @nstudio/nstreamdown
# yarn
yarn add @nstudio/nstreamdown
# pnpm
pnpm add @nstudio/nstreamdown
# bun
bun add @nstudio/nstreamdown| Framework | Import Path |
|---|---|
| Angular | @nstudio/nstreamdown/angular |
| React | @nstudio/nstreamdown/react |
| Vue | @nstudio/nstreamdown/vue |
| Svelte | @nstudio/nstreamdown/svelte |
| Solid | @nstudio/nstreamdown/solid |
import { Component } from '@angular/core';
import { Streamdown } from '@nstudio/nstreamdown/angular';
@Component({
selector: 'app-my-component',
template: `
<Streamdown [content]="markdown" />
`,
imports: [Streamdown],
})
export class MyComponent {
markdown = `
# Hello World!
This is **bold** and *italic* text.
\`\`\`typescript
const greeting = 'Hello, NativeScript!';
console.log(greeting);
\`\`\`
`;
}import { useState } from 'react';
import { Streamdown } from '@nstudio/nstreamdown/react';
export function MyComponent() {
const [markdown] = useState(`
# Hello World!
This is **bold** and *italic* text.
`);
return <Streamdown content={markdown} />;
}import { Streamdown } from '@nstudio/nstreamdown/solid';
export function MyComponent() {
const markdown = '# Hello World';
const config = { mode: 'streaming', controls: true };
return (
<Streamdown
content={markdown}
config={config}
/>
);
}<script lang="ts">
import { Streamdown } from '@nstudio/nstreamdown/svelte';
let markdown = '# Hello World';
const config = { mode: 'streaming', controls: true };
</script>
<Streamdown
content={markdown}
{config}
/><script setup lang="ts">
import { ref } from 'vue';
import { Streamdown } from '@nstudio/nstreamdown/vue';
const markdown = ref(`
# Hello World!
This is **bold** and *italic* text.
`);
</script>
<template>
<Streamdown :content="markdown" />
</template>For AI-powered apps, enable streaming mode to show content as it arrives:
import { Component, signal } from '@angular/core';
import { Streamdown } from '@nstudio/nstreamdown/angular';
@Component({
selector: 'app-chat',
template: `
<Streamdown
[content]="streamingContent()"
[config]="{
mode: 'streaming',
showCaret: true,
controls: true
}"
/>
`,
imports: [Streamdown],
})
export class Chat {
streamingContent = signal('');
async streamFromAI() {
const response = 'Hello! I am an **AI assistant**...';
const words = response.split(' ');
for (const word of words) {
this.streamingContent.update(c => c + word + ' ');
await this.delay(50);
}
}
private delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
}- Getting Started
- Configuration - Customize streaming behavior and appearance
- Features - Explore all supported markdown features
- Components - Learn about individual markdown components
- API Reference - Complete API documentation
Found a bug or want to contribute a new feature? Contributions are welcome!
npm run setup
npm start| Command | Description |
|---|---|
npm start |
Interactive menu for all development tasks |
Run npm start and choose the focus commands for the package you wish to develop in isolation.
Inspired by Streamdown.ai by Vercel
