Collection of reusable components.
This project was created to share the UI, agnostic logics and theme throughout the core apps.
-
Install your dependencies
cd path/to/shared-ui-elements npm install -
Start Storybook
npm run storybook # Runs storybook
This project utilizes alias only for the storybook implementation, the modules to be exposed in the package are not aliased since the package will be consumed by the core apps and they may not have the same alias configuration nor the same folder structure.
Ensure that new dependencies are added to both devDependencies and peerDependencies if required in the client's project.
While most dependencies should be peer dependencies to avoid version conflicts and duplicate packages, there are specific cases where a dependency should be a direct dependency instead:
- When a third-party library encounters rendering errors due to its unique distribution method or packaging structure, making it incompatible with peer dependency resolution.
This exception helps prevent runtime errors and ensures consistent behavior across different client implementations.
When installing the @verifiedinc/shared-ui-elements package, you have access to different export paths optimized for specific use cases.
The package’s default export path './' uses ECMAScript modules (ESM), providing an optimized build for modern JavaScript environments. This approach is recommended for most applications:
npm install @verifiedinc/shared-ui-elementsimport { SomeComponent } from '@verifiedinc/shared-ui-elements';This setup is efficient and works seamlessly with frameworks like Next.js, Vite, and other ESM-compatible environments.