Skip to content

DEV UI: Ability to add logo to card #31785

@melloware

Description

@melloware

Description

It would be nice to have the ability to add a logo to cards for libraries especially without having to build a custom Lit JS element to do it.

image

cc @phillip-kruger

Implementation ideas

I was thinking it would be great if it were flexible to allow for URL, IMG, or SVG.

  1. URL
card.setLogoImage("https://upload.wikimedia.org/wikipedia/commons/7/7e/Apache_Feather_Logo.svg");
  1. Pass a full Image so it can be a data:uri if needed
card.setLogoImage("<img src="src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSK" alt="Apache POI" width="32" height="32">");
  1. Full SVG image
card.setLogoImage("
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg>
<svg width="220px" height="120px"  xmlns="http://www.w3.org/2000/svg">
    <g>
        <text font-size="32"  x="25" y="60">
           Hello, World!
        </text>
    </g>
</svg>  
");

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions