Skip to main content

Crate badgelib

Crate badgelib 

Source
Expand description

Generate customizable SVG badges.

Build a Badge by setting its label, value, solid or gradient backgrounds, and optional custom icon, then render it with Badge::to_svg. Helpers such as Badge::for_version and Badge::for_downloads provide common badge formats and colors. Enable the simple-icons feature to select logos by their Simple Icons slugs.

§Example

use badgelib::{Badge, Color};

let svg = Badge::new()
  .label("build")
  .value("passing")
  .value_color(Color::Green)
  .to_svg();

assert!(svg.starts_with("<svg"));

Structs§

Badge
A configurable badge that can be rendered as SVG or JSON.

Enums§

Animation
An opinionated background animation applied to a badge.
Color
A badge background or logo color.
Error
An error returned by badgelib.
Period
Time period used by Badge::for_downloads.
Style
Visual treatment applied to the badge background and corners.

Type Aliases§

Result
A result returned by badgelib.