Thorium Web provides a collection of React components, hooks, and helpers that can be used to build a web reading application.
The Thorium Web package is organized into several sub-packages:
- Core: Low-level hooks, components, and utilities for building custom readers
- Audio: Audio player with plugins system for UI customization, Redux state management, and built-in preferences
- Epub: EPUB reader with plugins system for UI customization, Redux state management, and built-in preferences
- Reader: Universal reader wrapper that automatically routes to appropriate format-specific readers (EPUB/WebPub/Audio) based on publication profile
To use the Thorium Web package, you will need to add it as a dependency in your project. You can do this by running the following command:
npm install @edrlab/thorium-web @readium/css @readium/navigator @readium/navigator-html-injectables @readium/shared react-redux @reduxjs/toolkit i18next i18next-browser-languagedetector i18next-http-backend motion react-aria react-aria-components react-stately react-modal-sheet react-resizable-panels Components are relying on peer dependencies to work. You must install them manually.
Note that these components do not require Next.js, you should be able to use them in any React application or React framework of your choice.
Styles are exported as CSS stylesheets with thorium_web_ scoped classnames. You can find detailed documentation about available classes in the Styling docs.
If you want to contribute to the Thorium Web package, here are the steps to bundle them and test locally.
- Add your exports to their relevant
index.tsfiles, following the existing format (per folder) - Run
pnpm bundleto bundle the package - Run
pnpm linkto link the package - In your local project, run
pnpm link @edrlab/thorium-webto link the package - Add the package as a dependency in your
package.jsonfile using thelink:protocol - Run
pnpm installto install the package in your local project
Important
Make sure to add dependencies in both dependencies and peerDependencies in the package.json file, and exclude them from tsup.config.ts by listing them in external. If you are unsure whether a smaller dependency should be included or not, please ask the maintainers of this project.