Show
A tradução desta página não existe ou está desatualizada, por isso é mostrada em inglês. Ler em inglês
Mount content while a condition is truthy. Use it for expanded details, signed-in content and optional panels.
Toggle a details panel
import { Button, Show, Text, VStack, signal } from 'kuito';
export default function Details() {
const open = signal(false);
return (
<VStack padding={16} gap={8}>
<Button onPress={() => (open.value = !open.value)}>Details</Button>
<Show when={open.value}>
<Text>Recorded live in 2019.</Text>
</Show>
</VStack>
);
}Behavior
fallback displays when the condition is false. A callback child receives the truthy value. Changing branches disposes the previous branch, including its state and lifecycle work.
Continue
Read Control flow for a complete workflow. See the complete prop reference for types and documented defaults.
Referência
Assinaturas
<T>(props: ShowProps<T>): KuitoElementParâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
T | — | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
props | ShowProps<T> | Sim | — |
Devolve
Props: ShowProps<T>
Props (incluindo props herdadas) 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
when | When<T> | Sim | — |
fallback | KuitoNode | Não | — |
children | BranchChildren<T> | Não | — |
key | string | number | Não | — |
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.