Skip to main content

Journal components

The journal module provides UI primitives for a daily prompt, an answer flow, and previous entries. Use it when the app owns the prompt and persistence model. For a FHIR Questionnaire that needs answer rules, conditional items, or response creation, use the questionnaire form guide instead.

Build the journal screen​

Use TodayQuestionCard to introduce the current prompt, Answer for the response screen, and PastJournalCard for saved entries. Their compound children let the app control presentation while the screen keeps the actual prompt and answer data.

import { Answer } from "@ovok/native/journal";
import { Button } from "react-native-paper";

<Answer>
<Answer.Header>Today's check-in</Answer.Header>
<Answer.Question>{question.text}</Answer.Question>
<Answer.Input value={value} onChangeText={setValue} />
<Answer.Actions>
<Button onPress={() => saveAnswer(value)}>Save</Button>
</Answer.Actions>
</Answer>

Keep draft state, validation rules, retry behavior, and persistence in the screen or your form layer. Show a clear success or failure state after saving; rendering an answer form does not submit it automatically.

References​