This package has been deprecated

Author message:

Please use @schoolsquirrel/letter-avatar

nativescript-letter-avatar
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

nativescript-letter-avatar

Build Status GitHub license Maintenance Open Source Love Greenkeeper badge

With this plugin you can create beautiful looking letter avatars in your nativescript app!

How it looks like

picture 1

Installation

Install the plugin using tns plugin add nativescript-letter-avatar

Usage

NativeScript Core:

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.

Angular Version:

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.

License

MIT

Package Sidebar

Install

npm i nativescript-letter-avatar

Weekly Downloads

20

Version

0.3.0

License

MIT

Unpacked Size

17.6 MB

Total Files

872

Last publish

Collaborators

  • hrueger