Skip to content

Getting Started

Style native Rust Iced widgets with compile-time validated Tailwind CSS v4 utility classes (tw!()) or strongly typed Rust builders (iss::typed::*).

iss 0.2 targets Iced 0.14. Add iced and iss to your Cargo.toml, or run cargo add iced iss.

[dependencies]
iced = "0.14"
iss = "0.2"

Default features enable both wgpu and tiny-skia so gradients, frosted glass (backdrop-blur-*), masks, and filters work out of the box.

Feature Included by Default What It Enables
default (wgpu + tiny-skia) Yes GPU rendering plus frosted glass (backdrop-blur-*), blur filters, blend modes, CSS masks, and rounded child clipping
wgpu Yes Minimal GPU-only build (default-features = false, features = ["wgpu"]) if your app does not need blur or masks
tiny-skia Yes Software renderer (default-features = false, features = ["tiny-skia"]) for CPU-only, headless, or WebAssembly builds

Import TwExt and call .tw(...) directly on built-in Iced widgets (container, text, button, text_input, checkbox, scrollable). Hover and click Unlock below to test the live Iced widget in your browser.

Interactive Iced
Rust · WASM
Interactive Vault card widget with Unlock button rendered live by Rust Iced and ISS
Hover and click Unlock to toggle locked and unlocked state
use iced::widget::{button, container, text};
use iss::{col_tw, row_tw, tw, TwExt};
#[derive(Clone)]
enum Message {
ToggleLock,
}
fn view<'a>(unlocked: bool) -> iced::Element<'a, Message> {
let status = if unlocked {
text("Unlocked · 48 items").tw(tw!("text-xs font-medium text-[#f5d0fe]"))
} else {
text("Locked · 48 items").tw(tw!("text-xs text-[#a5a0b8]"))
};
let action = if unlocked {
button(text("Lock").tw(tw!("text-sm font-semibold text-[#f2f0f7]")))
.on_press(Message::ToggleLock)
.tw(tw!("px-4 py-2 bg-[#2a2442] hover:bg-[#362e54] active:bg-[#221d36] border border-violet-400/35 rounded-xl cursor-pointer"))
} else {
button(text("Unlock").tw(tw!("text-sm font-semibold text-white")))
.on_press(Message::ToggleLock)
.tw(tw!("px-4 py-2 bg-violet-600 hover:bg-violet-500 active:bg-violet-700 rounded-xl shadow-lg shadow-violet-600/35 cursor-pointer"))
};
container(row_tw(
[
col_tw([text("Vault").tw(tw!("text-base font-bold text-[#f2f0f7]")), status], tw!("gap-0.5")),
action,
],
tw!("w-full items-center justify-between gap-3.5"),
))
.tw(if unlocked {
tw!("w-[412px] p-5 bg-[#1a1826] border border-violet-400/40 rounded-2xl shadow-2xl")
} else {
tw!("w-[412px] p-5 bg-[#1a1826] border border-white/10 rounded-2xl shadow-2xl")
})
}

tw!() parses and validates every class name at compile time, so typos fail during cargo check with closest-match suggestions instead of failing silently at runtime.

use iss::{tw, TwStyle};
const CARD: TwStyle = tw!("p-4 bg-zinc-900 border border-zinc-800 rounded-xl shadow-md");
// Compile-time error: unknown Tailwind class 'bg-banana-500'
// let bad = tw!("p-4 bg-banana-500");