SwitchProps
Props of Switch: its Match branches, and what it shows when none matches.
Utilisation
Select one of several states
Ce type est utilisé par Switch
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>
);
}Déclaration du type
export interface SwitchProps extends ElementAttributes {
fallback?: KuitoNode;
/** `Match` elements only. */
children?: KuitoNode;
}Membres 3
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.