Skip to content

Commit 70eabe4

Browse files
committed
feat: add image fit modes to README for better image scaling control
1 parent 9811bea commit 70eabe4

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,22 @@ const MyComponent = () => {
249249

250250
---
251251

252+
## 🎨 Image Fit Modes
253+
254+
The `fit` prop controls how images scale within the viewport, using the standard CSS `object-fit` property.
255+
256+
| Mode | Description | Best Use Case |
257+
|------|-------------|---------------|
258+
| `cover` (Default) | **Fills the screen**, cropping edges if aspect ratios differ. | Full-screen background sequences. |
259+
| `contain` | **Shows the full image**. Letterboxing (bars) may appear. | Product showcases where no part of the image should be cut off. |
260+
| `fill` | **Stretches** to fill dimensions. Ignores aspect ratio. | Abstract patterns where distortion is acceptable. |
261+
| `none` | **Original size**. No scaling. | Pixel-perfect displays when the wrapper matches image size. |
262+
| `scale-down` | **Smallest of `none` or `contain`**. | Responsive layouts where images shouldn't upscale beyond native resolution. |
263+
264+
<br />
265+
266+
---
267+
252268
## ⚙️ Configuration
253269

254270
### `ScrollSequence` Props
@@ -300,6 +316,12 @@ const MyComponent = () => {
300316
<td>ARIA label for the canvas. Example: <code>"360 degree view of the product"</code>.</td>
301317
</tr>
302318
<tr>
319+
<td><code>fit</code></td>
320+
<td><code>"cover" | "contain" | "fill" | "none" | "scale-down"</code></td>
321+
<td><code>"cover"</code></td>
322+
<td>Determines how the image is resized to fit its container.</td>
323+
</tr>
324+
<tr>
303325
<td><code>debug</code></td>
304326
<td><code>boolean</code></td>
305327
<td><code>false</code></td>

0 commit comments

Comments
 (0)