⚠ Please use
@schoolsquirrel/letter-avatar
With this plugin you can create beautiful looking letter avatars in your nativescript app!
Install the plugin from using tns plugin add nativescript-letter-avatar
.
Define the namespace
<Page class="page"
loaded="pageLoaded"
navigatingTo="onNavigatingTo"
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:ns="nativescript-letter-avatar">
Use the plugin:
<ns:LetterAvatar id="myAvatar" text="AB"></ns:LetterAvatar>
You can also add custom styles:
<ns:LetterAvatar color="blue" padding="5" borderRadius="7" id="myAvatar" text="AB"></ns:LetterAvatar>
Unfortunately, CSS properties are not supported.
For more info and examples check out the demo folder.
In your app.module.ts
include the library like so:
import { LetterAvatarModule } from "nativescript-letter-avatar/angular";
and add it to the imports array:
@NgModule({
bootstrap: [
...
],
declarations: [
...
],
imports: [
...
LetterAvatarModule, // <--- add this here
],
schemas: [
...
],
})
export class AppModule { }
The use it in your .html file:
<LetterAvatar text="AB"></LetterAvatar>
You can add custom styles:
<LetterAvatar color="blue" padding="5" borderRadius="7" text="AB"></LetterAvatar>
Unfortunately, CSS properties are not supported.
For more info and examples check out the demo and the demo-angular folder.
MIT