GuidesModules

Journal components

Build a daily question, answer form, and past-entry list

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

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

API reference

Every export of @ovok/native/journal, with signatures, props and types, is in the journal API reference.

Last updated on

On this page