Third-party libraries require an Enterprise plan. Contact your account manager to turn them on for your site.
packages in docs.json fail on those sites, including their preview deployments.
On a site without authentication or personalization, preview deployments that require organization authentication or a password still deploy. Mintlify doesn’t build your packages for those previews, so components from your packages don’t render on them.
While your site uses third-party libraries, you can’t turn on authentication, personalization, or access restrictions for preview deployments.
Examples
The components in this section come from npm packages that this site installs.Interactive charts
Hover over either chart, and both tooltips follow the same date. Drag the handles under the latency chart to narrow the date range for both charts. Built withrecharts.
Chart code
Chart code
snippets/recharts-example.jsx
Visual effects
Change the palette, shape, and pixel size of an animated shader. Built with@paper-design/shaders-react.
Shader code
Shader code
snippets/dithering-example.jsx
More examples
These pages import other npm packages into a Mintlify site. Each one includes a live demo and the code that renders it.Editable diagrams
Arrange and connect the steps of a workflow with React Flow.
Rich text editing
Insert headings, lists, and code blocks from the keyboard with Tiptap.
Design system components
Filter a list and select several labels with a Base UI combobox.
Animation
Adjust the stiffness, damping, and mass of a spring with Motion.
Add a package
1
List your dependencies
Create a Mintlify installs only
package.json file in the same folder as your docs.json file. List every package you import under dependencies, including react and react-dom.package.json
dependencies. Packages listed only in devDependencies or peerDependencies aren’t available to your pages.2
Commit a lockfile
Install your dependencies and commit the lockfile next to Mintlify installs the exact versions in your lockfile. It supports
package.json.pnpm-lock.yaml version 9 from pnpm and package-lock.json from npm. Yarn and Bun lockfiles aren’t supported.3
Turn on packages
Add the
packages key to your docs.json. An empty object turns packages on with the default settings.docs.json
4
Import a component
Create a component in your Then import it into a page:
snippets folder that imports from the package.snippets/requests-chart.jsx
5
Deploy
Push your changes. If a package can’t be installed or built, the deployment fails with an error that names the package and the problem.
mint dev from the folder with your docs.json file.
Use package components
You can also import components directly from a package into an MDX page:- Place package components on their own lines. They don’t work inside a paragraph, a table cell, or inline text.
- Pass strings, numbers, and booleans as props directly. For functions, arrays, objects, or JSX props, write a wrapper component in your
snippetsfolder, like the chart in Add a package, and pass the values there. - Markdown inside a package component renders as plain HTML. Mintlify components, such as callouts and cards, don’t render inside a package component.
Load package styles
Components can import their own CSS. To load a stylesheet that a package ships separately, add its path inside the installed package topackages.css:
docs.json
Wrap components in a provider
If your components need a theme or context provider, export aProvider component from a snippet and set packages.provider to its path:
docs.json
snippets/provider.jsx
Install from another registry
Unscoped packages install from the public npm registry. To install a scope from a different registry, map the scope to the registry’s URL inpackages.registries:
docs.json
Limitations
- Dependency sources: Dependencies must be registry versions, version ranges, or tags. Git URLs, local paths,
file:,link:,workspace:, andnpm:aliases aren’t supported. - Install scripts: Packages install without running install scripts such as
postinstall. Packages that need them, or that need native binaries, don’t work. - Size: A deployment’s package output can include up to 1,000 files, 8 MB per file, 40 MB in total, and 5 MB gzipped. Packages that load large sets of modules at runtime, such as dynamic icon maps, can go over the file limit.
- Server rendering: Each component must render within three seconds on the server. A component that fails or times out renders only in the browser, so it’s missing from the page’s HTML.
- Search and AI: Search, the assistant, and Markdown exports use your MDX source, not the content a component renders. Keep important reference content in your MDX text.
- Web editor: The web editor preview doesn’t render package components.
packages from your docs.json file and redeploy.