Skip to content

Document image fit names and how each fit draws - #576

Merged
simonhamp merged 2 commits into
mainfrom
docs/image-fit
Oct 23, 2026
Merged

simonhamp merged 2 commits into
mainfrom
docs/image-fit

Conversation

@simonhamp

@simonhamp simonhamp commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The image page said fit modes 0 and 1 draw the same, and 2 and 3 draw the same. That was how iOS used to behave. NativePHP/mobile-ui#153 made both platforms follow CSS object-fit, and NativePHP/mobile-air#572 lets fit take a name or an ImageFit case as well as the integer.

This rewrites the fit prop and the fit() method for that: the four fits as they draw now, contain as the default, and the note that an image with a width but no height takes its height from the image's aspect ratio. The examples use fit="cover" and fit="contain" instead of the integers, on this page and on the modal, bottom sheet, carousel, lazy grid and stack pages. Both entries get a "Changed 4.7" badge.

Things to watch:

  • Neither change is tagged yet. The names need mobile 4.7 and the drawing changes need the next mobile-ui release, so this should merge after those.
  • The examples now use names. A Jump build on 4.6 casts fit="cover" to 0, so the preview draws none instead of cover until Jump ships 4.7.

🤖 Generated with Claude Code

The image page said fit modes 0/1 and 2/3 each draw the same way, which
was only ever true on iOS and stopped being true with mobile-ui#153.
Describe the four fits as they draw now on both platforms, the names and
ImageFit cases fit takes from 4.7 (mobile-air#572), and that an image
with a width and no height sizes from its aspect ratio. The examples use
the names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp marked this pull request as ready for review October 23, 2026 12:28
Modal, bottom sheet, carousel, lazy grid and stack examples still passed
:fit="1" and :fit="2". Switch them to fit="contain" and fit="cover" so
every v4 page uses the names the image page documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit 2ba7577 into main Oct 23, 2026
3 checks passed
@simonhamp
simonhamp deleted the docs/image-fit branch October 23, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant