Skip to content

rcx()

Compose class names reactively — returns a getter function for use with reactive class props.

function rcx(...args: (string | (() => string | false | null | undefined) | false | null | undefined)[]): () => string
import { signal, rcx, div } from "@whisq/core";
const variant = signal("primary");
const loading = signal(false);
div({
class: rcx(
"btn",
() => variant.value === "primary" && "btn-primary",
() => loading.value && "btn-loading",
),
})