Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@boringer-avatars/svelte

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boringer-avatars/svelte

Procedurally generate Avatars for your applications. Use these avatars as placeholders until your users upload their own images. Several variants and styles to choose from.

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
36
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

@boringer-avatars/svelte

Procedurally generate Avatars for your applications. Use these avatars as placeholders until your users upload their own images. Several variants and styles to choose from.

Warning: Generated Code

This library is generated using [Mitosis](https://github.com/BuilderIO/mitosis).

This repo is forked from boring-avatars. It aims to create cross-framework implementations for as many frameworks as possible. (Angular, React, Vue, Solid, Svelte, Qwik, etc).

Installation

npm install @boringer-avatars/svelte
# or
yarn add @boringer-avatars/svelte
# or
pnpm add @boringer-avatars/svelte

Usage

<script lang="ts">
          import { Avatar } from "@boringer-avatars/svelte/package";
        </script>

        <Avatar
          title={false}
          size={400}
          variant="beam"
          name="testing"
          square={false}
          colors={["#FFAD08", "#EDD75A", "#73B06F", "#0C8F8F", "#405059"]}
        />

Props

The options you can pass into the component are listed below.

Required

  • name: string. name is used to determine the exact drawing of each avatar. This is what makes it different for each user. You can also use ID values rather than names. This is the only required value.

Optional

  • variant: Variant. Determines the style of avatar. Valid values include: "pixel", "bauhaus", "ring", "beam", "sunset", "marble". Defaults to "beam".

  • colors: string[]. An array of valid Hex colors. 5 different colors is the optimal amount. More or less will still work. Defaults to: ["#92A1C6", "#146A7C", "#F0AB3D", "#C271B4", "#C20D90"].

  • square: boolean. Decides whether Avatar is a Circle or Square. Defaults to: false

  • hasTitle: boolean. Decides whether Avatar displays a title value. Defaults to: false

  • size: string. Determines the width and height of the image. You can use any valid css value. eg: "42px", "42%", "42vw", etc. Defaults to: 42px

License

MIT License

Copyright (c) 2021 boringdesigners

Copyright (c) 2022-2023 cmgriffing

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 22 Feb 2023

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