svatar
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Svatar

A tiny and customizable avatar component for Svelte & SvelteKit.

Installation

# NPM
npm install svatar

# YARN
yarn add svatar

Usage Example

<script>
  import Avatar from "svatar";
</script>

<Avatar name="User"/>

Live REPL Example

Properties

Name Required Type Default Description
style No String - Style property for the avatar wrapper.
src No String - Path to the avatar image to display.
alt No String Avatar Image alternate text.
name No String Avatar The name that will be used to compute user initial.
initials No String - Override the computed initials.
bgColor No String Gainsboro The avatar background color.
textColor No String Black Text color of the avatar initials.
size No String 64px The avatar size.
borderRadius No String 50% Border-radius of the avatar.
boxShadow No String - Add box-shadow to the avatar.
square No Boolean False If true, avatar will be a square.
randomBgColor No Boolean False If true, avatar background will be colored randomly.

Supporting

Contributions and suggestions are welcomed.

License

Released under MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i svatar

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

10.4 kB

Total Files

11

Last publish

Collaborators

  • akinmustafa