Responsive & Container Queries
Adapt desktop and embedded Iced UIs to both window width and enclosing container width using standard Tailwind CSS v4 viewport prefixes and layout-time @container queries.
ISS preview

Viewport Breakpoints & Ranges
Section titled “Viewport Breakpoints & Ranges”| Prefix | Condition | Typed Equivalent |
|---|---|---|
sm: / md: / lg: / xl: / 2xl: |
width >= 640 / 768 / 1024 / 1280 / 1536 px |
.sm(...) .. .xxl(...) |
max-sm: .. max-2xl: |
width < 640 .. 1536 px |
.max_sm(...) .. .max_2xl(...) |
md:max-xl: |
768 px <= width < 1280 px |
`.md( |
min-[520px]: / max-[900px]: |
Arbitrary pixel or rem threshold | .min_w_bp(520.0, ...) / .max_w_bp(900.0, ...) |
Container Queries (@container)
Section titled “Container Queries (@container)”Mark any parent with @container (or a named container like @container/panel). During layout, ISS measures that container’s actual width so descendants respond to their allotted space regardless of window size.
| Container Variant | Threshold | Named Form |
|---|---|---|
@3xs: / @2xs: / @xs: |
256 / 288 / 320 px |
@xs/card: |
@sm: / @md: / @lg: / @xl: |
384 / 448 / 512 / 576 px |
@sm/card: |
@2xl: .. @7xl: |
672 .. 1280 px |
@2xl/main: |
@max-sm:, @min-[300px]:, @max-[500px]: |
Max-width and arbitrary bounds | @max-[420px]/card: |
use iced::widget::{container, text};use iss::{col_tw, flex_tw, tw, IssViewport, TwExt};
let vp = IssViewport::with_theme(window_width, true);
let panel = col_tw( [flex_tw( [ text("Workspace").tw(tw!("text-sm @sm/panel:text-lg font-semibold text-white")), container(text("Online").tw(tw!("text-xs text-emerald-300"))) .tw(tw!("px-2 py-0.5 rounded-md bg-emerald-500/15")), ], tw!("w-full flex-col @sm/panel:flex-row items-start @sm/panel:items-center justify-between gap-2"), )], vp.tw(tw!("@container/panel w-full p-3 md:max-xl:p-5 bg-zinc-900 rounded-xl")),);use iced::widget::{container, text};use iss::typed::*;
let vp = IssViewport::with_theme(window_width, true);
let header_row = IssStyle::new() .w_full() .flex_col() .cq_named(ContainerBreakpoint::Sm, "panel", |s| s.flex_row().items_center()) .items_start() .justify_between() .gap(2);
let panel_style = IssStyle::new() .container_named("panel") .w_full() .p(3) .md(|s| s.max_xl(|s| s.p(5))) .bg(palette::ZINC_900) .rounded_xl();
let panel = col_tw( [flex_tw([text("Workspace").into(), container(text("Online")).into()], header_row)], vp.tw(panel_style),);