Skip to content

Store Badge Creator: Explain how to adjust the size of the store badge #5252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
softworkz opened this issue Dec 30, 2024 · 4 comments
Open
Assignees
Labels

Comments

@softworkz
Copy link
Contributor

Type of issue

Missing information

Feedback

The badge image appears to ignore any sizing applied to the badge element (ms-store-badge), which makes it impossible to include it in an html layout.
Please add information how to adjust the badge size.
Thanks

Page URL

https://learn.microsoft.com/en-us/windows/apps/publish/microsoft-store-app-badge

Content source URL

https://github.com/MicrosoftDocs/windows-dev-docs/blob/docs/hub/apps/publish/microsoft-store-app-badge.md

Author

@GrantMeStrength

Document Id

9c3935cd-075c-8799-0d27-5117533cd22e

@GrantMeStrength
Copy link
Contributor

Hi Ankur - Hoping you can take a look at this issue. Thanks!

@AnkurSinganjude
Copy link
Contributor

@rudyhuyn can you please help with this question?

@JudahGabriel
Copy link

JudahGabriel commented Feb 27, 2025

Hi, I work on the badge.

From the badge generator, you can either use the badge web component -- which does fancy things like rendering the badge in the user's language and honors the user's browser dark/light mode setting -- or you can use a plain HTML badge.

Web component badge that detects browser theme and language:

<script type="module" src="https://get.microsoft.com/badge/ms-store-badge.bundled.js"></script>
<!-- replace 9nksqgp7f2nh with the ID of your app -->
<ms-store-badge
	productid="9nksqgp7f2nh"
	window-mode="direct"
	theme="auto"
	size="large"
	language="en-us">
</ms-store-badge>

Alternately, you can use the plain image badge, no script required:

<a href="https://apps.microsoft.com/detail/9nksqgp7f2nh?mode=direct">
   <img src="https://get.microsoft.com/images/en-us%20dark.svg" width="200"/>
</a>

To style the web component, you can use CSS parts:

ms-store-badge::part(img) {
    max-height: 52px;
}

Or if you prefer the plain image badge, you style it like you would any other element.

You can read more about styling and badge options on our App Badge repo.

Hope this helps!

p.s. I'll update the Microsoft Docs site with this info.

learn-build-service-prod bot added a commit that referenced this issue Mar 10, 2025
…c_temp

For protected branch, push strategy should use PR and merge to target branch method to work around git push error
JudahGabriel added a commit to JudahGabriel/windows-dev-docs that referenced this issue May 2, 2025
@JudahGabriel
Copy link

I've submitted this PR to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants