Velvet Thunder

Avatar

Variants

JP
JP
JP
<DemoSpaceX>
  <VelvetAvatar @variant="emerald" @name="Jake Peralta" />
  <VelvetAvatar @variant="amber" @name="Jake Peralta" />
  <VelvetAvatar @variant="rose" @name="Jake Peralta" />
</DemoSpaceX>

Sizes

JP
JP
JP
<DemoSpaceX>
  <VelvetAvatar @name="Jake Peralta" @size="sm" />
  <VelvetAvatar @name="Jake Peralta" @size="md" />
  <VelvetAvatar @name="Jake Peralta" @size="lg" />
</DemoSpaceX>

Round

JP
<VelvetAvatar @isRound={{true}} @name="Jake Peralta" />

Images

<VelvetAvatar @src="https://avatars.githubusercontent.com/u/7403183" />

Initials

JP
<VelvetAvatar @initials="JP" />

No User Data

<VelvetAvatar />

Signature

Element

HTMLDivElement

Blocks

This component does not accept any blocks.

Arguments

NameDescriptionTypeDefault Value
@initialsThe initials of the user.string""
@isRoundIndicate if the avatar is round.booleanfalse
@nameThe name of the user.string""
@sizeThe size of the avatar.'sm' | 'md' | 'lg'"md"
@srcThe source of the image.string""
@variantThe appearance of the avatar.string | 'primary'"primary"
Arguments marked with * are required.

The order to determine what to render is as follows:

  1. If the @src argument is provided, the image will be rendered
  2. If the @src argument is not provided, the @name argument will be used to determine the initials
  3. If the @name argument is not provided, the @initials argument will be rendered
  4. If the @initials argument is not provided, a user icon will be rendered as a last resort
Alert
Button