Skip to content

docs: add preload example for NuxtImg#2124

Merged
danielroe merged 4 commits into
nuxt:mainfrom
divagueame:patch-1
Feb 25, 2026
Merged

docs: add preload example for NuxtImg#2124
danielroe merged 4 commits into
nuxt:mainfrom
divagueame:patch-1

Conversation

@divagueame
Copy link
Copy Markdown
Contributor

Added example for passing an object to the preload prop to define fetch priority.

🔗 Linked issue

related to nuxt/nuxt.com#2061

❓ Type of change

  • [X ] 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Document preload options.

From this other PR, I learned preload could take an object as a prop, but it's not documented on the site. This PR adds this information.

nuxt/nuxt#34341

Added example for passing an object to the preload prop to define fetch priority.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 18, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2124

commit: 43ce95b

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

Documentation for the nuxt-img component's preload prop was updated to document an object form that can set fetchPriority on the preload link tag. The change adds an example (:preload="{ fetchPriority: 'high' }"), states that fetchPriority maps to the lowercase fetchpriority attribute, and lists accepted values (auto, high, low). No runtime behavior or exported/public API signatures were changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly relates to the changeset by explaining that it documents the preload prop accepting an object to define fetch priority, references the related GitHub issue, and includes a link to the source PR that inspired the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding a preload example to NuxtImg documentation, which matches the file update in docs/content/2.usage/1.nuxt-img.md.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 6.83%. Comparing base (07fd47d) to head (557ca6a).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2124   +/-   ##
=====================================
  Coverage   6.83%   6.83%           
=====================================
  Files         80      80           
  Lines       3729    3729           
  Branches     142     142           
=====================================
  Hits         255     255           
  Misses      3424    3424           
  Partials      50      50           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/content/2.usage/1.nuxt-img.md`:
- Line 371: Update the prose to use the camelCase key name "fetchPriority" to
match the JS object example for the preload prop (mentioning the preload prop
and the object key fetchPriority), and append a brief note listing the valid
values ("auto", "high", "low") so readers see the full set of options.
- Around line 371-375: Update the docs example and prose to state that the
preload.fetchPriority accepts three values—'auto', 'high', and 'low'—not just
'high', and update the example to show one or more of these values; also clarify
that the JS property is camelCase fetchPriority (as defined in BaseImageProps)
but becomes the lowercase HTML attribute fetchpriority on the generated preload
link (handled in NuxtImg component), so readers understand the mapping.

Comment thread docs/content/2.usage/1.nuxt-img.md Outdated
Comment thread docs/content/2.usage/1.nuxt-img.md Outdated
@danielroe danielroe changed the title docs: enhance NuxtImg documentation with preload props example docs: add preload example for NuxtImg Feb 24, 2026
@danielroe danielroe added this pull request to the merge queue Feb 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Feb 25, 2026
@danielroe danielroe enabled auto-merge February 25, 2026 10:09
@danielroe danielroe added this pull request to the merge queue Feb 25, 2026
Merged via the queue into nuxt:main with commit eb4f5d0 Feb 25, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Feb 25, 2026
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.

3 participants