All Projects → wdtamagi → svelte-avatar

wdtamagi / svelte-avatar

Licence: MIT license
An avatar component for Svelte

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
Svelte
593 projects

Projects that are alternatives of or similar to svelte-avatar

hue.tools
Simple toolbox for working with colors. Color mixing, blending, conversion, modification, detailed information, etc.
Stars: ✭ 331 (+2658.33%)
Mutual labels:  svelte
fangpenlin-avataaars-generator-angular
Angular implementation of @fangpenlin's avataaars-generator
Stars: ✭ 20 (+66.67%)
Mutual labels:  avatar
mathesar
Web application providing an intuitive user experience to databases.
Stars: ✭ 95 (+691.67%)
Mutual labels:  svelte
ProjectKorra
The Official Plugin for ProjectKorra.
Stars: ✭ 65 (+441.67%)
Mutual labels:  avatar
template-electron-svelte
Starter project with basic Svelte and Electron setup
Stars: ✭ 23 (+91.67%)
Mutual labels:  svelte
plugins
Elder.js plugins and community plugins.
Stars: ✭ 80 (+566.67%)
Mutual labels:  svelte
svelte-stripe-js
Everything you need to add Stripe Elements to your Svelte project
Stars: ✭ 139 (+1058.33%)
Mutual labels:  svelte
svelte-starter-kit
Svelte with brilliant bells and useful whistles
Stars: ✭ 384 (+3100%)
Mutual labels:  svelte
svelte-bricks
Naive Svelte Masonry component without column balancing (ragged columns at the bottom)
Stars: ✭ 22 (+83.33%)
Mutual labels:  svelte
vue-avatar-editor
Avatar editor for Vue.js. Demo on : https://fpluquet.github.io/vue-avatar-editor/
Stars: ✭ 85 (+608.33%)
Mutual labels:  avatar
eslint-plugin-svelte
ESLint plugin for Svelte using AST
Stars: ✭ 22 (+83.33%)
Mutual labels:  svelte
spigot-bending
Minecraft plugin that allows players to bend elements as in the series
Stars: ✭ 14 (+16.67%)
Mutual labels:  avatar
SvelteScaling
Does Svelte scale?
Stars: ✭ 21 (+75%)
Mutual labels:  svelte
type-kana
A quiz app to help you learn hiragana and katakana, the Japanese syllabaries
Stars: ✭ 21 (+75%)
Mutual labels:  svelte
svelte3-translation-ru
Russian translation of the official Svelte resources
Stars: ✭ 49 (+308.33%)
Mutual labels:  svelte
svelte-match-media
a matchMedia plugin for svelte 3
Stars: ✭ 38 (+216.67%)
Mutual labels:  svelte
felt-mockup
retired mockup 💚 customizable community tools that feel good
Stars: ✭ 47 (+291.67%)
Mutual labels:  svelte
sveld
Generate TypeScript definitions for your Svelte components
Stars: ✭ 281 (+2241.67%)
Mutual labels:  svelte
svelte-fullcalendar
A Svelte component wrapper around FullCalendar
Stars: ✭ 123 (+925%)
Mutual labels:  svelte
mmss-client
No description or website provided.
Stars: ✭ 16 (+33.33%)
Mutual labels:  svelte
Svelte

Svelte Avatar

A simple avatar component for Svelte.



npm versionLicense: 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

NameRequiredDefaultTypeDescription
style N - String Style property for avatar wrapper.
name N Avatar String The name that will be used to compute user initial (when 'src' property not set).
initials N - String Force the displayed initials by overriding the computed ones.
src N - String Path to the avatar image to display.
bgColor N lightGray String The avatar background color to use if no image is provided.
textColor N white String The font color used to render the user initials.
size N 50px String The avatar size.
borderRadius N 50% String The border-radius css property of avatar.
square N false Boolean If true, Avatar will be a Square
randomBgColor N false Boolean If true, Avatar background will be colored randomly

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].