0.0
The project is in a healthy, maintained state
A Ruby port of Boring Avatars with a framework-independent SVG core and an opt-in Rails View Helper.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 5.20
>= 1.16
>= 13.0
>= 4.0
>= 0.6
>= 1.10
 Project Readme

Gem Version

boring_avatars

boring_avatars is a Ruby port of Boring Avatars. It provides a framework-independent SVG generator and an opt-in Rails View Helper.

Core

require "boring_avatars"

svg = BoringAvatars.generate(
  "Maria Mitchell",
  variant: :beam,
  size: 64,
  colors: ["#264653", "#2A9D8F", "#E9C46A", "#F4A261", "#E76F51"]
)

Available variants are marble, beam, pixel, sunset, ring, and bauhaus.

Rails

Load the Rails binding explicitly:

gem "boring_avatars", require: "boring_avatars/bindings/rails"

Then use the helper from a view:

<%= boring_avatar(
  current_user.email,
  variant: :bauhaus,
  class: "avatar",
  aria: { label: current_user.name }
) %>

See the architecture documentation for the complete API and compatibility policy.

Type signatures

The gem ships both type signature formats:

  • Sorbet RBI: rbi/boring_avatars.rbi
  • RBS: sig/boring_avatars.rbs

Run bundle exec rake typecheck to validate both definitions. This runs Sorbet and Steep contract checks and fails unless every public API is covered in both formats with zero untyped Sorbet usages (100% public API type coverage). Tapioca can import the RBI exported from the gem's rbi/ directory, while RBS can load the installed gem signature by library name.

License

The gem is available under the MIT License. See THIRD_PARTY_NOTICES.md for the upstream Boring Avatars notice.