Skip to content

Avatar

Table of contents
Table of contents

Avatars are images used to represent users and organizations on GitHub. Use the default round avatar for users, and the square argument for organizations or any other non-human avatars.

Examples

Default

<%= render(Primer::AvatarComponent.new(src: "http://placekitten.com/200/200", alt: "@kittenuser")) %>

Arguments

NameTypeDefaultDescription
srcStringN/AThe source url of the avatar image
altStringN/APassed through to alt on img tag
sizeInteger20Adds the avatar-small class if less than 24
squareBooleanfalseUsed to create a square avatar.