Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
ImageRow.svelte
<script>
import ImageRow from './ImageRow.svelte'
const images = [
"https://source.unsplash.com/640x480/?cyberpunk",
"https://source.unsplash.com/400x400/?cyberpunk",
"https://source.unsplash.com/100x250/?cyberpunk",
"https://source.unsplash.com/200x300/?cyberpunk",
// "https://source.unsplash.com/480x640/?cyberpunk",
// "https://source.unsplash.com/300x300/?cyberpunk",
// "https://source.unsplash.com/250x100/?cyberpunk",
// "https://source.unsplash.com/300x200/?cyberpunk"
]
</script>

<h1>
&lt;ImageRow /&gt;
</h1>
<p>
Where you want all images to be the same height, but to have their width adjusted so they fit the width of the page without stretching or cropping images.
</p>

<ImageRow {images} />

<p>
And another one here.
</p>
<ImageRow images={[
"https://dummyimage.com/400x400",
"https://dummyimage.com/100x250",
"https://dummyimage.com/200x300",
"https://dummyimage.com/200x300"
]} />
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */