Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@medplum/react

medplum11.7kApache-2.04.3.3TypeScript support: included

Medplum React Component Library

medplum, fhir, healthcare, interoperability, json, serialization, hl7, standards, clinical, dstu2, stu3, r4, normative, ui, input, react, react-component

readme

Medplum React Component Library

The Medplum React Component Library provides many helpful components to quickly build your healthcare web app.

The Medplum SDK can be used with any compliant FHIR server. However, some advanced features are only available when paired with a Medplum server.

Check out a live demo: https://storybook.medplum.com/

Installation

Add as a dependency:

npm install @medplum/react

Note the following peer dependencies:

Note the following optional peer dependencies:

Basic Usage

import { MedplumClient } from '@medplum/core';
import { MedplumProvider } from '@medplum/react';

const medplum = new MedplumClient();

export function App() {
  return (
    <MedplumProvider medplum={medplum}>
      <MyPage1 />
      <MyPage2 />
      <Etc />
    </MedplumProvider>
  );
}

For more details on how to setup MedplumClient, refer to the docs for medplum.

Sign In

export function SignInPage() {
  const auth = useMedplumContext();
  return (
    <Document>
      {auth.user ? (
        <div>
          <pre>User: {JSON.stringify(auth.user)}</pre>
          <Button onClick={() => auth.medplum.signOut().then(() => alert('Signed out!'))}>Sign out</Button>
        </div>
      ) : (
        <SignInForm onSuccess={() => alert('Signed in!')} />
      )}
    </Document>
  );
}

Chat

export function ChatPage() {
  return (
    <Document>
      <ChatControl criteria="Communication?encounter=123" {...args} />
    </Document>
  );
}

About Medplum

Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications. Medplum includes a FHIR server, React component library, and developer app.

License

Apache 2.0. Copyright © Medplum 2025