Usage

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

Type declaration

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

Type

ts
"medium" | "compact" | "expanded"
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.