Skip to content

object-fit

Utilities for controlling how an image or replaced media widget scales to fit its box.

ISS preview
Iced + ISS preview demonstrating object-fit
ISS preview for object-fit
use iss::{image_tw, tw};
let thumb = image_tw(handle, tw!("w-48 h-32 object-cover object-center rounded-xl"));
Tailwind Class CSS Property / Effect iss::typed Builder
object-contain object-fit: contain; .object_contain()
object-cover object-fit: cover; .object_cover()
object-fill object-fit: fill; .object_fill()
object-none object-fit: none; .object_none()
object-scale-down object-fit: scale-down; .object_scale_down()
  • Use image_tw(handle, style) for CSS object-fit and object-position cropping with rounded corners.

object-position · aspect-ratio · overflow