Verwendung

Switch layout at a window width class.

tsx
// 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>;

Typdeklaration

ts
export type WidthClass = 'compact' | 'medium' | 'expanded';

Typ

ts
"medium" | "compact" | "expanded"
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.