window.WidthClass
The window's width class, by its width: under 600, under 840, and wider.
Utilização
Switch layout at a window width class.
// Switch layout at a window width class.
import { Show, Text, VStack, window, type WidthClass } from 'kuito';
const twoPanes = (width: WidthClass) => width !== 'compact';
<Show when={twoPanes(window.widthClass.value)} fallback={<Text>List</Text>}>
<VStack flexDirection="row">
<Text>List</Text>
<Text>Detail</Text>
</VStack>
</Show>;Declaração do tipo
export type WidthClass = 'compact' | 'medium' | 'expanded';Tipo
"medium" | "compact" | "expanded"Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.