@careevolution/mydatahelps-ui

中文文档
4.5.0发布于 2026/11/04MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2929

MyDataHelps UI Library

原始使用文档
文档目录6 节
  1. Example of how to use MyDataHelpsUI in your Participant View
  2. Storybook
  3. Components
  4. Presentational Components
  5. Container Components
  6. Views

MyDataHelpsUI

MyDataHelpsUI is a set of reusable React-based components based on the MyDataHelps.js SDK. Explore the component library at ui.mydatahelps.org.

Utilize this component library to accelerate the development of custom participant views for your digital clinical trial and digital therapeutic application powered by MyDataHelps platform. Integrating MyDataHelpsUI will help you follow best practices for implementing return of results and eCOA within your participant views.

You may also find MyDataHelpsStarterKit to be helpful. The starter kit is a react web app template designed for you to be able to fork/clone as a starting point for developing your custom view.

Install via:

npm install @careevolution/mydatahelps-ui

Example of how to use MyDataHelpsUI in your Participant View

import { Action, Card, Layout, SurveyTaskList } from "@careevolution/mydatahelps-ui"

export default function () {
  return (
    <Layout>
        <Card className='primary-card'>
            <Action
            title="Do you think you have COVID-19?"
            subtitle="It's important to tell us immediately if might have COVID-19.  Click or tap here to report a new infection, symptoms, or close contact."
            onClick={() => MyDataHelps.startSurvey('New COVID Infection')} />
        </Card>
        <Card>
            <SurveyTaskList status="incomplete" title="Tasks" limit={3} />
        </Card>
    </Layout>
    );

© CareEvolution, LLC

Storybook

This library uses Storybook. To look at examples, visit ui.mydatahelps.org.

To run Storybook previews with data from one of your test MyDataHelps participants:

  1. Clone this repo
  2. Get a participant access token - either using browser dev tools while logged in as a test participant at mydatahelps.org, or by using the REST API.
  3. Create a .env file in your root directory with the token details.
.env
-----
STORYBOOK_PARTICIPANT_ACCESS_TOKEN=05e211e4df46ca7537e064bde44148a7 
STORYBOOK_PARTICIPANT_ENVIRONMENT_API=https://mydatahelps.org/
  1. Run npm ci to install dependencies.
  2. Run npm run storybook to view the storybook.

If you have issues getting storybook to run, particularly around the NODE_OPTIONS being used, try upgrading Node to the latest version.

Components

The components fall into 3 categories:

Presentational Components

Presentational components do NOT fetch data to populate themselves. They are the underlying UI building blocks of the views and connected components. These are things such as buttons, cards, and a display for a single survey task.

Container Components

Container components fetch data via the MyDataHelps.js SDK. These components will only function if used in a view inside MyDataHelps or via manually passing an access token to the SDK.

Views

Views pull the sets of Container and Presentational Components together into fully pre-built experiences. For instance, the "Home View" contains multiple connected components in one:

  • ProjectHeader
  • MostRecentNotification
  • SurveyTaskList
  • ProjectSupport

版本与发布记录

@careevolution/mydatahelps-ui 共发布 1,131 个版本,首次发布于 2022/09/03;过去 12 个月发布了 167 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.5.0latest2026/11/044 天前
4.3.2-HKSync.1next2026/10/319 天前
4.4.02026/10/309 天前
4.2.1-auto-closing-tasks-32026/10/031 个月前
4.3.12026/09/301 个月前
4.3.1-SecondaryViews.12026/09/231 个月前

其他发布通道:old → 3.11.3,next → 4.3.2-HKSync.1。

关于 @careevolution/mydatahelps-ui 的常见问题

@careevolution/mydatahelps-ui 是什么?

MyDataHelps UI Library

如何安装 @careevolution/mydatahelps-ui?

在项目目录运行 npm install @careevolution/mydatahelps-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)、react-dom(^18.2.0)、@careevolution/mydatahelps-js(^5.9.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@careevolution/mydatahelps-ui 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@careevolution/mydatahelps-ui 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@careevolution/mydatahelps-ui 可以商用吗?

@careevolution/mydatahelps-ui 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@careevolution/mydatahelps-ui 的下载量有多少?

根据 npm 官方下载统计,@careevolution/mydatahelps-ui 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,929 次,日均约 98 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@careevolution/mydatahelps-ui 还在维护吗?

最新版本 4.5.0 发布于 2026/11/04(4 天前);至今共发布 1131 个版本,其中过去 12 个月发布了 167 个;首次发布于 2022/09/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。