Repository navigation
feat(icon): let consumers rewrite icon URLs with IconUrlContext - #267
Merged
Merged
Conversation
N43527
marked this pull request as ready for review
October 22, 2026 22:38
N43527
commented
Oct 22, 2026
|
|
||
| type IconUrlResolver = (url: string) => string; | ||
|
|
||
| const IconUrlContext = createContext<IconUrlResolver>((url) => url); |
Contributor
Author
There was a problem hiding this comment.
Means if no one using this has said anything different, then reuse the same functionality
(that way only mint export will be updated to have this fix)
dks333
approved these changes
Oct 22, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IconandLanguageIconalways point at the icons CDN.mint exportneeds to load them from the exported bundle instead (air-gapped sites, strict CSP), but there was no way to change the URL, including for icons drawn inside other components likeExpandable.Adds
IconUrlContext, a function that receives the icon URL and returns the one to render. The default returns it unchanged, so existing consumers see no difference.Test plan
pnpm build,pnpm lint:checkNote
Low Risk
Additive API with identity default; only affects how icon mask URLs are computed when a provider overrides them.
Overview
Introduces
IconUrlContext, a React context whose value is an(url) => stringresolver (default: identity), exported from the icon package so hosts likemint exportcan remap CDN icon URLs to local bundle paths for air-gapped or strict-CSP sites.IconandLanguageIconnow run every CDN/mask icon URL through that resolver before settingmaskImage/WebkitMaskImage, including Mintlify CDN absolute icon strings. Behavior is unchanged when no provider is supplied.Reviewed by Cursor Bugbot for commit b9be99b. Bugbot is set up for automated code reviews on this repo. Configure here.