Building packages
How to build packages with StrataKit
This guide is for package developers. It supplements the general development guide with additional instructions to build a package on top of StrataKit.
Define dependencies
Section titled âDefine dependenciesâList packages that are expected to be installed at most once in the host application as peerDependencies. The installed instances of peer dependencies are shared across the whole application and its packages.
@stratakit/mui
Section titled â@stratakit/muiâTo use StrataKit, add @stratakit/mui to your peerDependencies. Additionally, list other non-StrataKit peer dependencies, such as @mui/material, react, and react-dom.
{ "peerDependencies": { "@mui/material": "^9.4.0", "@stratakit/mui": "^1.0.0", "react": "^19.0.0", "react-dom": "^19.0.0" }}@stratakit/icons
Section titled â@stratakit/iconsâTo use StrataKit icons in your package, add @stratakit/icons to your peerDependencies, then display them as described in the development guide.
@stratakit/foundations
Section titled â@stratakit/foundationsâIf you are using StrataKit CSS variables or other foundations in your package, add @stratakit/foundations to your peerDependencies to explicitly control the package version.
@stratakit/structures
Section titled â@stratakit/structuresâTo use StrataKit structures in your package, add @stratakit/structures to your dependencies.
Set up TypeScript types
Section titled âSet up TypeScript typesâAdd @stratakit/mui/types.d.ts to your tsconfig file as described in the development guide.
Package versioning
Section titled âPackage versioningâFollow semantic versioning when releasing new versions of your package.
Transitive peer dependencies
Section titled âTransitive peer dependenciesâPeer dependencies introduce additional challenges when managing dependency versions, especially when dealing with transitive peer dependencies. Package developers should consider the full dependency graph.
For example, since @stratakit/foundations is a peer dependency of @stratakit/structures, a version bump of @stratakit/structures can transitively require a newer @stratakit/foundations in the host application - even when the change looks internal from your packageâs perspective.
Updating peer dependencies
Section titled âUpdating peer dependenciesâTo use a newer feature non-conditionally in your package, you may need to update the version of a peer dependency.
StrataKit packages consider version bumps of peer dependencies as a non-breaking change if the host application can upgrade to a newer version without disruption.
Non-breaking changes
These widen the accepted range or bump the minimum version of a range to a newer minor or patch version:
{ "peerDependencies": { "@stratakit/foundations": "^1.0.0" "@stratakit/foundations": "^1.0.0 || ^2.0.0" }}{ "peerDependencies": { "@stratakit/foundations": "^1.0.0" "@stratakit/foundations": "^1.1.0" }}Breaking changes
These block upgrades to newer minor or patch versions, or require a new major version:
{ "peerDependencies": { "@stratakit/foundations": "^1.0.0" "@stratakit/foundations": "1.1.0" }}{ "peerDependencies": { "@stratakit/foundations": "^1.0.0" "@stratakit/foundations": "^2.0.0" }}Migrating from iTwinUI
Section titled âMigrating from iTwinUIâConsider releasing a new major version of your package when adding support for StrataKit. Otherwise, you may introduce breaking changes for users who are still using iTwinUI without setting up StrataKit.
See Migrating from iTwinUI for more information.