@nstudio/nativescript-markdown-view
A NativeScript view for displaying natively rendered Markdown.
npm i --save @nstudio/nativescript-markdown-view
- Version: 1.0.0
- GitHub: https://github.com/nstudio/nativescript-ui-kit
- NPM: https://www.npmjs.com/package/%40nstudio%2Fnativescript-markdown-view
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
@nstudio/nativescript-markdown-view
A NativeScript view for displaying natively rendered Markdown.
Uses Markwon on Android and TSMarkdownParser on iOS.
npm install @nstudio/nativescript-markdown-view
If using vanilla core:
<!-- test-page.xml -->
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" xmlns:mv="@nstudio/nativescript-markdown-view">
<StackLayout class="p-20">
<mv:MarkdownView markdown="_This_ should be **bold**!" />
</StackLayout>
</Page>
When using flavors, you can register the element for usage in your markup:
import { MarkdownView } from '@nstudio/nativescript-markdown-view'
// Angular
import { registerElement } from '@nativescript/angular'
registerElement('MarkdownView', () => MarkdownView)
// Solid
import { registerElement } from 'dominative';
registerElement('markdownview', MarkdownView);
// Svelte
import { registerNativeViewElement } from 'svelte-native/dom'
registerNativeViewElement('markdownview', () => MarkdownView);
// React
import { registerElement } from 'react-nativescript';
registerElement('markdownview', () => MarkdownView);
// Vue
import Vue from 'nativescript-vue'
Vue.registerElement('MarkdownView', () => MarkdownView)
Use MarkdownView
anywhere.
<MarkdownView markdown="_This_ should be **bold**!" />
API
Property | Default | Description |
---|---|---|
markdown | "" | The markdown to be rendered on screen |
Credits
- Thank you to original author, Florian Reifschneider!
License
Apache License Version 2.0