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

@luanedcosta/vue-profile-picture

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luanedcosta/vue-profile-picture

Lightweight vue component to render the user picture or his name initials.

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Vue Profile Picture

Lightweight vue component to render the user picture or his name initials It's easy to customize with your style and change the behavior using the properties of the component.

Instalation

To install the package in your project you can type:

  • npm i @luanedcosta/vue-profile-picture
  • yarn add @luanedcosta/vue-profile-picture
  • Or download it from the repository: https://github.com/LuanEdCosta/vue-profile-picture

Once installed you can use the component as a plugin:

There's no options, so you can ignore the second parameter of Vue.use()

import VueProfilePicture from '@luanedcosta/vue-profile-picture'

Vue.use(VueProfilePicture)

Or you can import the component locally:

import { VueProfilePicture } from '@luanedcosta/vue-profile-picture'

export default {
    components: { VueProfilePicture }
}

Simple Usage

If exists an image the component will render a <img> tag. If the user doesn't have an image his initials will appear in place of the image.

<vue-profile-picture name="Username" img="Image src"/>

Props

The table below contains all component props.

PropertyTypeDefaultRequiredExplanation
nameStringtrueName of the user
classesStringnullfalseHTML class property for the <img> tag or <div> with the initials
stylesObjectnullfalseHTML style property for the <img> tag or <div> with the initials
noStyleBooleanfalsefalseRemove all default component classes to allow you to define your own css classes
numOfInitialsNumber2falseNumber of letters that will appear with the user doesn't have image
nameSeparatorStringwhite spacefalseCharacter or string that separates each user name
transformNumber1false1 = Initials uppercase; 2 = Initials lowercase; 0 = Don't transform the text
firstNameBooleanfalsefalseThe component will show only the firstname initials
lastNameBooleanfalsefalseThe component will show only the lastname initials
defString'-'falseIf the component didn't find an image neither the user name the component will display this property value on screen
imgStringnullfalseThe src for the image. The same as the src property of the <img> tag
altStringnullfalseThe same as alt property of the <img> tag
draggableString"true"falseIf true the image can be draggable

Keywords

FAQs

Package last updated on 06 Jul 2019

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