Learn about visual thememore

Avatar

The avatar component displays an image to identify a record.

Demo

Profile picture of Robert C. Hernandez

Link for section titled Installation
Installation

NPM package
@skyux/avatarView in NPM | View in GitHub None found.
Install with NPM
npm install --save-exact @skyux/avatar None found.

Link for section titled SkyAvatarModule
SkyAvatarModule

Type: Module

import { SkyAvatarModule } from '@skyux/avatar';

Link for section titled SkyAvatarComponent
SkyAvatarComponent

Type: Component

Selector: sky-avatar

Inputs

canChange: boolean

Whether users can change the image. To select a different image, users click the image or drag another image on top of it, much like the sky-file-drop component in the file attachment module.

Default: false

maxFileSize: number | undefined

The maximum file size for the image in bytes.

Default: 512000 bytes

name: string | undefined

The name of the record that the avatar represents. If the src property does not specify an image, the component displays initials from the first and last words in the name. To ensure that the component extracts the correct initials, specify a name with no prefix or suffix, or just specify initials with a space between them. This property is not required, but the component requires either the name or src property.

size: SkyAvatarSize | undefined

The size of the avatar. Acceptable values are: "small", "medium", and "large".

Default: "large"

src: SkyAvatarSrc | undefined

The image to identify a record. This property is not required, but the component requires either the name or src property.

Outputs

avatarChanged: EventEmitter<SkyFileItem>

Emits a SkyFileItem object when the image is updated.

Link for section titled SkyAvatarSize
SkyAvatarSize

Type: Type alias
type SkyAvatarSize = "large" | "medium" | "small"

Link for section titled SkyAvatarSrc
SkyAvatarSrc

Type: Type alias
type SkyAvatarSrc = string | Blob | File