x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<div class="max-w-sm"> <div class="midwest-image is-zoomable" data-controller="midwest-image"> <img class="midwest-image-main" src="https://fastly.picsum.photos/id/685/800/600.jpg?hmac=sWb0xR86JlxAieZShPwfbn0gAT0FFv55TkLcfQTw0Hk" alt="Click to enlarge" loading="lazy" data-action="click->midwest-image#zoom"> <dialog id="image-dialog-f040" class="midwest-dialog midwest-image-dialog" data-controller="midwest-dialog" data-midwest-dialog-reset-frame-value="false" data-midwest-image-target="dialog"> <div class="dialog-content dialog-animate dialog-width-full dialog-height-auto dialog-position-center" data-action="turbo:submit-end->midwest-dialog#hide"> <button aria-label="Close lightbox" data-action="click->midwest-dialog#dismiss" class="midwest-button variant-fab size-small theme-primary midwest-image-dialog-close theme-gray" name="button"> <span class="midwest-button-content"> <div class="midwest-icon " aria-hidden="true"> <div class="midwest-icon-inner"> <svg xmlns="http://www.w3.org/2000/svg" class="Midwest-Icon__Svg" viewbox="0 0 512 512" focusable="false" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"></path></svg> </div> </div> </span> <div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none"> <div class="midwest-loading-icon-inner"> <!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL --> <svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true"> <circle cx="15" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="60" cy="15" r="9" fill-opacity="0.3"> <animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="105" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> </svg> </div> </div> </button> <figure class="midwest-image-dialog-figure" style="--image-dialog-src: url('https://fastly.picsum.photos/id/227/1600/1200.jpg?hmac=JJl4PFj0T5-07HDVOFfLf09st-AEnOHhI2DNHlmtR9s')"> <img src="https://fastly.picsum.photos/id/227/1600/1200.jpg?hmac=JJl4PFj0T5-07HDVOFfLf09st-AEnOHhI2DNHlmtR9s" alt="Click to enlarge" class="midwest-image-dialog-img"> </figure> </div> </dialog></div></div>1
2
3
4
5
6
7
<div class="max-w-sm"> <%= render Midwest::ImageComponent.new( src: 'https://fastly.picsum.photos/id/685/800/600.jpg?hmac=sWb0xR86JlxAieZShPwfbn0gAT0FFv55TkLcfQTw0Hk', large: 'https://fastly.picsum.photos/id/227/1600/1200.jpg?hmac=JJl4PFj0T5-07HDVOFfLf09st-AEnOHhI2DNHlmtR9s', alt: 'Click to enlarge' ) %></div>With lightbox
Pass large: to enable click-to-zoom. A full-size version opens in a
native <dialog> overlay. Dismiss by clicking outside the image or
pressing Escape.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Image/with_lightbox
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."