Avatars

The Avatar component provides the ability to display an avatar for a user (or account or other entity).

It displays an uploaded image or Gravatar based on the email address. If no image is present, then it falls back to displaying initials.

If you're using the Authentication component, then the Avatar component will be automatically installed. If not, then you can follow the installation instructions below:

Installation

Copy
rails g instrumental:avatars

To insert a component into a view:

Copy
rails g instrumental:avatars:insert

Customization

Find all of your customization options (via local variables) in this file:

app/views/shared/components/_avatar.html.erb

Instrumental Components

I created Instrumental Components to make designing and building professional apps with Ruby on Rails easy, fast, and fun. I use it on all of my projects and I hope it helps you build something great.

Brian Casel
Brian Casel
Creator of Instrumental Components
Learn more Send me a question or request