MatchProps
Props of Match: the condition, and what it shows while it holds.
Usage
Select one of several states
This type is used by Match
import { Match, Switch, Text, signal } from 'kuito';
export function Status() {
const state = signal<'loading' | 'offline' | 'ready'>('loading');
return (
<Switch fallback={<Text>Ready</Text>}>
<Match when={state.value === 'loading'}>
<Text>Loading…</Text>
</Match>
<Match when={state.value === 'offline'}>
<Text>Check your connection</Text>
</Match>
</Switch>
);
}Type declaration
export interface MatchProps<T> extends ElementAttributes {
when: When<T>;
children?: BranchChildren<T>;
}Members 3
| Name | Type | Required | Description |
|---|---|---|---|
when | When<T> | Yes | — |
children | BranchChildren<T> | No | — |
key | string | number | No | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.