You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/en/guides/migrate-to-astro/from-gatsby.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,7 +320,7 @@ See more about [Styling in Astro](/en/guides/styling/).
320
320
321
321
### Gatsby Image Plugin to Astro
322
322
323
-
Convert Gatsby's `<StaticImage />` and `<GatsbyImage />` components to [Astro's own image integration components](/en/guides/images/#image--astroassets), or to a [standard HTML `<img>` / JSX `<img />`](/en/guides/images/#images-in-ui-framework-components) tag as appropriate in your React components.
323
+
Convert Gatsby's `<StaticImage />` and `<GatsbyImage />` components to [Astro's own image integration components](/en/guides/images/), or to a [standard HTML `<img>` / JSX `<img />`](/en/guides/images/#images-in-ui-framework-components) tag as appropriate in your React components.
324
324
325
325
```astro title="src/pages/index.astro"
326
326
---
@@ -331,7 +331,7 @@ import rocket from '../assets/rocket.png';
331
331
<img src={rocket.src} alt="A rocketship in space.">
332
332
```
333
333
334
-
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/guides/images/#properties) and note that several will differ from Gatsby's attributes.
334
+
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/reference/modules/astro-assets/#image-properties) and note that several will differ from Gatsby's attributes.
335
335
336
336
To continue using [images in Markdown (`.md`) files](/en/guides/images/#images-in-markdown-files) using standard Markdown syntax (`![]()`), you may need to update the link. Using the HTML `<img>` tag directly is not supported in `.md` files for local images, and must be converted to Markdown syntax.
Copy file name to clipboardExpand all lines: src/content/docs/en/guides/migrate-to-astro/from-nextjs.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -422,9 +422,9 @@ See more about [Styling in Astro](/en/guides/styling/).
422
422
423
423
### Next Image Plugin to Astro
424
424
425
-
Convert any Next `<Image />` components to [Astro's own image component](/en/guides/images/#image--astroassets) in `.astro` or `.mdx` files, or to a [standard HTML `<img>` / JSX `<img />`](/en/guides/images/#images-in-ui-framework-components) tag as appropriate in your React components.
425
+
Convert any Next `<Image />` components to [Astro's own image component](/en/guides/images/) in `.astro` or `.mdx` files, or to a [standard HTML `<img>` / JSX `<img />`](/en/guides/images/#images-in-ui-framework-components) tag as appropriate in your React components.
426
426
427
-
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/guides/images/#properties) and note that several will differ from Next's attributes.
427
+
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/reference/modules/astro-assets/#image-properties) and note that several will differ from Next's attributes.
Copy file name to clipboardExpand all lines: src/content/docs/en/guides/migrate-to-astro/from-nuxtjs.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,9 +487,9 @@ See more about [Styling in Astro](/en/guides/styling/).
487
487
488
488
### Nuxt Image Plugin to Astro
489
489
490
-
Convert any [Nuxt `<nuxt-img/>` or `<nuxt-picture/>` components](https://image.nuxtjs.org/components/nuxt-img) to [Astro's own image component](/en/guides/images/#image--astroassets) in `.astro` or `.mdx` files, or to a [standard HTML `<img>`](/en/guides/images/#images-in-ui-framework-components) or `<picture>` tag as appropriate in your Vue components.
490
+
Convert any [Nuxt `<nuxt-img/>` or `<nuxt-picture/>` components](https://image.nuxtjs.org/components/nuxt-img) to [Astro's own image component](/en/guides/images/) in `.astro` or `.mdx` files, or to a [standard HTML `<img>`](/en/guides/images/#images-in-ui-framework-components) or `<picture>` tag as appropriate in your Vue components.
491
491
492
-
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/guides/images/#properties) and note that several will differ from Nuxt's attributes.
492
+
Astro's `<Image />` component works in `.astro` and `.mdx` files only. See a [full list of its component attributes](/en/reference/modules/astro-assets/#image-properties) and note that several will differ from Nuxt's attributes.
Copy file name to clipboardExpand all lines: src/content/docs/en/reference/components-reference.mdx
+1-130Lines changed: 1 addition & 130 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,136 +115,7 @@ import { Prism } from '@astrojs/prism';
115
115
116
116
This component provides language-specific syntax highlighting for code blocks by applying Prism's CSS classes. Note that **you need to provide a Prism CSS stylesheet** (or bring your own) for syntax highlighting to appear! See the [Prism configuration section](/en/guides/markdown-content/#prism-configuration) for more details.
117
117
118
-
See the [list of languages supported by Prism](https://prismjs.com/#supported-languages) where you can find a language’s corresponding alias. And, you can also display your Astro code blocks with `lang="astro"`!
119
-
120
-
## `<Image />`
121
-
122
-
```astro title="src/components/MyComponent.astro"
123
-
---
124
-
// import the Image component and the image
125
-
import { Image } from 'astro:assets';
126
-
import myImage from "../assets/my_image.png"; // Image is 1600x900
127
-
---
128
-
129
-
<!-- `alt` is mandatory on the Image component -->
130
-
<Image src={myImage} alt="A description of my image." />
131
-
```
132
-
133
-
```html
134
-
<!-- Output -->
135
-
<!-- Image is optimized, proper attributes are enforced -->
136
-
<img
137
-
src="/_astro/my_image.hash.webp"
138
-
width="1600"
139
-
height="900"
140
-
decoding="async"
141
-
loading="lazy"
142
-
alt="A description of my image."
143
-
/>
144
-
```
145
-
### Properties
146
-
147
-
- src (required)
148
-
- alt (required)
149
-
- width and height (required for `public/` and remote images)
150
-
- format
151
-
- quality
152
-
- densities
153
-
- widths
154
-
155
-
In addition to the properties above, the `<Image />` component accepts all properties accepted by the HTML `<img>` tag.
156
-
157
-
See more in the [Images Guide](/en/guides/images/#image--astroassets).
158
-
159
-
## `<Picture />`
160
-
161
-
<p><Sincev="3.3.0" /></p>
162
-
163
-
Use the built-in `<Picture />` Astro component to display a responsive image with multiple formats and/or sizes.
164
-
165
-
```astro title="src/pages/index.astro"
166
-
---
167
-
import { Picture } from 'astro:assets';
168
-
import myImage from "../assets/my_image.png"; // Image is 1600x900
169
-
---
170
-
171
-
<!-- `alt` is mandatory on the Picture component -->
172
-
<Picture src={myImage} formats={['avif', 'webp']} alt="A description of my image." />
See more in the [Images Guide](/en/guides/images/#picture-).
192
-
193
-
### Properties
194
-
195
-
`<Picture />` accepts all the properties of the `<Image />` component, plus the following:
196
-
197
-
#### `formats`
198
-
199
-
An array of image formats to use for the `<source>` tags. By default, this is set to `['webp']`.
200
-
201
-
#### `fallbackFormat`
202
-
203
-
Format to use as a fallback value for the `<img>` tag. Defaults to `.png` for static images, `.gif` for animated images, and `.svg` for SVG files.
204
-
205
-
#### `pictureAttributes`
206
-
207
-
An object of attributes to be added to the `<picture>` tag. Use this property to apply attributes to the outer `<picture>` element itself. Attributes applied to the `<Picture />` component directly will apply to the inner `<img>` element, except for those used for image transformation.
208
-
209
-
210
-
## `<Content />`
211
-
212
-
A generic component used to render the content of a [content collection entry](/en/guides/content-collections/#what-are-content-collections).
213
-
214
-
First, query one or more entries using `getCollection()` or `getEntry()`. Then, the `entry.render()` function can return the `<Content />` component for use in a `.astro` file template.
<p>Published on: {entry.data.published.toDateString()}</p>
223
-
<Content />
224
-
```
225
-
226
-
## `<ViewTransitions />`
227
-
228
-
<p><Sincev="2.9.0" /></p>
229
-
230
-
Opt in to using view transitions on individual pages by importing and adding the `<ViewTransitions />` routing component to `<head>` on every desired page.
231
-
232
-
```astro title="src/pages/index.astro" ins={2,7}
233
-
---
234
-
import { ViewTransitions } from 'astro:transitions';
235
-
---
236
-
<html lang="en">
237
-
<head>
238
-
<title>My Homepage</title>
239
-
<ViewTransitions />
240
-
</head>
241
-
<body>
242
-
<h1>Welcome to my website!</h1>
243
-
</body>
244
-
</html>
245
-
```
246
-
247
-
See more about how to [control the router](/en/guides/view-transitions/#router-control) and [add transition directives](/en/guides/view-transitions/#transition-directives) to page elements and components.
118
+
See the [list of languages supported by Prism](https://prismjs.com/#supported-languages) where you can find a language’s corresponding alias. And, you can also display your Astro code blocks with `lang="astro"`.
Copy file name to clipboardExpand all lines: src/content/docs/en/reference/errors/missing-image-dimension.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,12 +16,12 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
16
16
> Missing width and height attributes for `IMAGE_URL`. When using remote images, both dimensions are required in order to avoid cumulative layout shift (CLS).
17
17
18
18
## What went wrong?
19
-
For remote images, `width` and `height` cannot automatically be inferred from the original file. To avoid cumulative layout shift (CLS), either specify these two properties, or set [`inferSize`](/en/guides/images/#infersize) to `true` to fetch a remote image's original dimensions.
19
+
For remote images, `width` and `height` cannot automatically be inferred from the original file. To avoid cumulative layout shift (CLS), either specify these two properties, or set [`inferSize`](/en/reference/modules/astro-assets/#infersize) to `true` to fetch a remote image's original dimensions.
20
20
21
21
If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](/en/guides/imports/#other-assets).
0 commit comments