Skip to content

Commit 17043b3

Browse files
authored
Merge pull request #4641 from syncfusion-content/ES-896904-carousel
896904: Added topic for load images in webp format
2 parents 7ab95a7 + 1647010 commit 17043b3

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

blazor-toc.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,13 @@
10491049
<li><a href="/blazor/carousel/navigators-and-indicators">Navigators and Indicators</a></li>
10501050
<li><a href="/blazor/carousel/accessibility">Accessibility</a></li>
10511051
<li><a href="/blazor/carousel/styles-and-appearance">Styles and Appearances</a></li>
1052+
<li>How To
1053+
<ul>
1054+
<li>
1055+
<a href="/blazor/carousel/how-to/load-images-in-webp-format">Load images in webp format</a>
1056+
</li>
1057+
</ul>
1058+
</li>
10521059
<li><a href="/cr/blazor/Syncfusion.Blazor.Navigations.SfCarousel.html">API Reference</a></li>
10531060
</ul>
10541061
</li>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
layout: post
3+
title: Load webp format image with Blazor Carousel Component | Syncfusion
4+
description: Checkout and learn about how to load webp format image with Blazor Carousel component in Blazor Server App and Blazor WebAssembly App.
5+
platform: Blazor
6+
control: Carousel
7+
documentation: ug
8+
---
9+
10+
# Load webp format image with Blazor Carousel Component
11+
12+
You can load the carousel image in the webp format, which aims to create smaller, better-looking images. Choosing webp as your image format can significantly improve your website's performance without sacrificing visual quality. webp images are significantly smaller in file size compared to formats like JPEG and PNG. This results in faster load times and less data usage. To achieve this, you can convert your image format to webp and pass them to Carousel items. The following sample illustrates how to load a carousel image in the webp format component.
13+
14+
```cshtml
15+
@using Syncfusion.Blazor.Navigations
16+
17+
<div class="control-container">
18+
<SfCarousel SwipeMode="CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch">
19+
<CarouselItem>
20+
<figure class="img-container">
21+
<img src="https://www.gstatic.com/webp/gallery/1.webp" alt="Majestic Valley View" style="height:100%;width:100%;" />
22+
<figcaption class="img-caption">Majestic Valley View</figcaption>
23+
</figure>
24+
</CarouselItem>
25+
<CarouselItem>
26+
<figure class="img-container">
27+
<img src="https://www.gstatic.com/webp/gallery/2.webp" alt="Thrilling Rapids Adventure" style="height:100%;width:100%;" />
28+
<figcaption class="img-caption">Thrilling Rapids Adventure</figcaption>
29+
</figure>
30+
</CarouselItem>
31+
<CarouselItem>
32+
<figure class="img-container">
33+
<img src="https://www.gstatic.com/webp/gallery/3.webp" alt="Snowy Stroll" style="height:100%;width:100%;" />
34+
<figcaption class="img-caption">Snowy Stroll</figcaption>
35+
</figure>
36+
</CarouselItem>
37+
</SfCarousel>
38+
</div>
39+
40+
<style>
41+
.control-container {
42+
height: 300px;
43+
margin: 0 auto;
44+
width: 500px;
45+
}
46+
47+
.img-container {
48+
height: 100%;
49+
margin: 0;
50+
}
51+
52+
.img-caption {
53+
color: #fff;
54+
font-size: 1rem;
55+
position: absolute;
56+
bottom: 3rem;
57+
width: 100%;
58+
text-align: center;
59+
}
60+
61+
</style>
62+
```

0 commit comments

Comments
 (0)