1.2.0 • Published 2 years ago

svelte-avatar v1.2.0

Weekly downloads
133
License
MIT
Repository
github
Last release
2 years ago

A simple avatar component for Svelte.

npm version License: MIT

This component display an avatar image with fallback to the name initials. This component is inspired from react-user-avatar and vue-avatar.

Installation

yarn add svelte-avatar

or

npm install svelte-avatar

Note: to use this library in sapper, install as devDependency. See the link.

Usage

example

with image:

<script>
  import Avatar from "svelte-avatar";
</script>

<Avatar name="John Walker" src="https://avatars0.githubusercontent.com/u/6810985?s=460&u=a2a24f33ad8d17377cef8163f596a7fbd1501cd4&v=4" />

with name:

<script>
  import Avatar from "svelte-avatar";
</script>

<Avatar name="John Walker" />

Prop

Build Setup

# install dependencies
yarn
# or
npm i

# serve gh pages with hot reload at localhost:5000
yarn dev
# or
npm run dev

# build
yarn build
# or
npm run build

Test

yarn test
# or
npm test

NPM Statistics

Download stats for this NPM package

NPM

License

Released under the MIT License.

1.2.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

1.0.0-RC-1

4 years ago

1.0.0-RC-0

4 years ago