New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ui-avatar-svg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ui-avatar-svg

Generate SVG avatars with user initials in pure JS

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

UI Avatar SVG

Generate SVG avatars with user initials in pure JS.

Usage

Generate avatars using a flexible API:

const UIAvatarSvg = require('ui-avatar-svg');

const svg = (new UIAvatarSvg())
    .text('AB')
    .size(64)
    .bgColor('#ff0000')
    .textColor('#ffffff')
    .generate();

The generate() function returns a string <svg...> that can be embedded in your app.

API

  • text(string) - User initials (default AB)
  • round(boolean) - Is the avatar round instead of square (default true)
  • size(integer) - Avatar size in px (default 64)
  • bgColor(string) - Background color (default #ff0000)
  • textColor(string) - Text color (default #ffffff)
  • fontSize(float) - Font size on a scale from 0.1 - 1.0 (default 0.4)
  • fontWeight(string|integer) - Font weight (default normal)
  • fontFamily(string) - Font family (default -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', Sans', 'Droid Sans', 'Helvetica Neue', sans-serif)

Credits

UI Avatar SVG was created by Gilbert Pellegrom from Dev7studios. Released under the MIT license.

Keywords

FAQs

Package last updated on 12 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc