Gallery

v0.0.10

v0.0.10StableComponentStatelessJSApache-2.0
Installation mix mishka.ui.gen.component gallery
Source View Source

Rounded prop

The rounded attribute in the gallery_media component controls the border radius of the media element, allowing you to apply various levels of rounding to the corners. The available options include extra_small, which applies a slight rounding effect, small for standard rounded corners, and medium for moderate rounding. For more pronounced effects, you can use large or extra_large for larger, more noticeable rounded corners. The full option makes the media fully rounded, typically resulting in a circular shape. If no rounding is required, you can set the value to none to maintain sharp, square corners.

Rounded prop

heex
<.gallery>
  <.gallery_media rounded="extra_small" src="/path" />
  <.gallery_media rounded="small" src="/path" />
  <.gallery_media rounded="medium" src="/path" />
  <.gallery_media rounded="large" src="/path" />
  <.gallery_media rounded="extra_large" src="/path" />
</.gallery>

The default value of type prop

The default layout in the gallery component presents media items in a clean, structured grid format. Each image is evenly spaced and aligned, providing a uniform and balanced look. This layout is ideal for galleries where consistency is key, as it ensures that all items are displayed in equal sizes and aligned in a straightforward grid. It's perfect for showcasing images with the same dimensions or for creating a tidy, professional presentation.

The default value of type prop

heex
<.gallery>
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
  <.gallery_media src="/path" />
</.gallery>

Animation and animation size props

The animation and animation_size props allow you to add smooth animations to gallery images. You can choose from animations like blur, backdrop, scale-up, and scale-down. By default, both props are set to nil, so no animation is applied. When setting an animation, it is important to define the corresponding animation_size. Available sizes include extra_small, small, medium, large, and extra_large. This ensures your animations are visually appealing and appropriately scaled.

Animation backdrop

Animation backdrop

heex
<.gallery animation="backdrop" animation_size="extra_small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="backdrop" animation_size="small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="backdrop" animation_size="medium">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="backdrop" animation_size="large">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="backdrop" animation_size="extra_large">
  <.gallery_media src="/path" />
</.gallery>

Animation blur

Animation blur

heex
<.gallery animation="blur" animation_size="extra_small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="blur" animation_size="small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="blur" animation_size="medium">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="blur" animation_size="large">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="blur" animation_size="extra_large">
  <.gallery_media src="/path" />
</.gallery>

Animation scale up

Animation scale up

heex
<.gallery animation="scale-up" animation_size="extra_small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-up" animation_size="small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-up" animation_size="medium">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-up" animation_size="large">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-up" animation_size="extra_large">
  <.gallery_media src="/path" />
</.gallery>

Animation scale down

Animation scale down

heex
<.gallery animation="scale-down" animation_size="extra_small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-down" animation_size="small">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-down" animation_size="medium">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-down" animation_size="large">
  <.gallery_media src="/path" />
</.gallery>

<.gallery animation="scale-down" animation_size="extra_large">
  <.gallery_media src="/path" />
</.gallery>