Skip to content
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

Add support for ref in Image component #22482

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ Required unless [`layout="fill"`](#layout).

The `<Image />` component optionally accepts the following properties.

### ref

You can pass in a `ref` if you need direct access to the underlying root `<img>`
element that gets rendered by this component. This might be useful in situations
where you need access to the root `<img>` element for animations or maybe in the
case where you want to check the
[image's complete property](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete).

### layout

The layout behavior of the image as the viewport changes size. Defaults to
Expand Down
Loading