npm i --save @outloud/nativescript-ui-svg
- Version: 0.0.9
- GitHub: https://github.com/nativescript-community/ui-svg
- NPM: https://www.npmjs.com/package/%40outloud%2Fnativescript-ui-svg
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
NativeScript SVG widget
A NativeScript SVG plugin. Very basic implementation for now
Installation
Run the following command from the root of your project:
tns plugin add @nativescript-community/ui-svg
Configuration
For now only vue
(and core) is supported.
import CanvasSVG from '@nativescript-community/ui-svg/vue';
Vue.use(CanvasSVG);
It works in 3 ways!.
CanvasSVG
extending Canvas
<CanvasSVG>
<CSVG horizontalAlignment="left" src="~/assets/svgs/Ghostscript_Tiger.svg" height="100%" stretch="aspectFit" />
</CanvasSVG>
or SVGView
which is a basic svg view with support for auto sizing
<SVGView height="30%" src="~/assets/svgs/Ghostscript_Tiger.svg" stretch="aspectFit" backgroundColor="red" />
Or within and canvas extending view
<CanvasLabel>
<CGroup fontSize="18" verticalAlignment="middle" paddingLeft="20">
<CSpan text="test" fontWeight="bold" />
<CSpan text="test2" color="#ccc" fontSize="16" />
</CGroup>
<CSVG horizontalAlignment="left" src="~/assets/svgs/Ghostscript_Tiger.svg" height="10" stretch="aspectFit" />
</CanvasSVG>
For full example / doc look at the vue demo and the typings.