Skip to main content

Content

The content module contains small, composable presentation primitives. ContentCard and ContentList can render any app-owned content model. ContentDetail optionally reads selected fields from a FHIR Composition; it does not fetch or persist content.

Public exports​

  • ContentCard and its Cover, CoverBadge, Content, and Title children.
  • ContentList and its Section, Header, Title, HorizontalList, and ViewAll children.
  • The bare Section, Title, HorizontalList, and ViewAll child components are also named exports; Header is available through ContentList.Header but is not a separate named export. The compound properties remain available on ContentList.
  • ContentDetail and its header, metadata, body, rich-content, footer, tags, and resource children.
  • CompositionContext, CompositionContextType, and useComposition for custom composition-aware layouts.

Choose a primitive​

NeedUse
A preview with an image and titleContentCard
Grouped sections or horizontal previewsContentList
A scrollable Composition-backed detail viewContentDetail
A custom composition consumerCompositionContext/useComposition below ContentDetail or an app-owned provider

FHIR mapping used by ContentDetail​

The detail primitives read only the fields they need:

  • title: composition.title;
  • body: the first section with text.div;
  • author: composition.meta.author.display;
  • date: top-level composition.date, formatted as dd MMM yyyy;
  • reading time: a section coded reading-time, with HTML stripped from text.div;
  • tags: composition.meta.tag unless ContentDetail.Tags receives tags explicitly;
  • resource link: a section coded resource-link, with the URL extracted from its anchor HTML.

ContentDetail.Title and ContentDetail.RichContent throw clear errors when their required content cannot be obtained. ContentDetail.Resource and metadata helpers return null when their optional source data is absent.

Integration boundaries​

The module does not assume Expo Router, a CMS, a content endpoint, a patient/session model, or a specific localization catalog. Supply navigation, loading/error states, labels, and persistence from the host app. This supports using one card/detail primitive for a single device or feature as well as a complete content catalog.

See the focused pages for cards, lists, and details.