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
ContentCardand itsCover,CoverBadge,Content, andTitlechildren.ContentListand itsSection,Header,Title,HorizontalList, andViewAllchildren.- The bare
Section,Title,HorizontalList, andViewAllchild components are also named exports;Headeris available throughContentList.Headerbut is not a separate named export. The compound properties remain available onContentList. ContentDetailand its header, metadata, body, rich-content, footer, tags, and resource children.CompositionContext,CompositionContextType, anduseCompositionfor custom composition-aware layouts.
Choose a primitive
| Need | Use |
|---|---|
| A preview with an image and title | ContentCard |
| Grouped sections or horizontal previews | ContentList |
| A scrollable Composition-backed detail view | ContentDetail |
| A custom composition consumer | CompositionContext/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 asdd MMM yyyy; - reading time: a section coded
reading-time, with HTML stripped fromtext.div; - tags:
composition.meta.tagunlessContentDetail.Tagsreceivestagsexplicitly; - 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.