Skip to content

Using Terra UI packages in other projects

Nick Watts edited this page Jul 3, 2024 · 1 revision

Terra UI is split into multiple packages that can be used in other projects. These packages are published to a public NPM Artifact Registry.

To install one of these packages in another project, follow the instructions for the project's package manager.

NPM

Associate the @terra-ui-packages scope with the Terra UI Packages registry. Add the following to .npmrc:

 @terra-ui-packages:registry=https://us-central1-npm.pkg.dev/dsp-artifact-registry/terra-ui-packages

Install a package.

npm install '@terra-ui-packages/components'

Yarn (v2+)

Associate the @terra-ui-packages scope with the Terra UI Packages registry. Add the following to .yarnrc.yml:

npmScopes:
  terra-ui-packages:
    npmRegistryServer: "https://us-central1-npm.pkg.dev/dsp-artifact-registry/terra-ui-packages"

Install a package.

yarn add '@terra-ui-packages/components'

Yarn Classic (v1)

Associate the @terra-ui-packages scope with the Terra UI Packages registry. Add the following to .npmrc:

 @terra-ui-packages:registry=https://us-central1-npm.pkg.dev/dsp-artifact-registry/terra-ui-packages

Install a package.

yarn add '@terra-ui-packages/components'
Clone this wiki locally