@platform-ui/highrise
Getting started with the HighRise UI library
Authentication
Append the below snippet to the app's .npmrc / .yarnrc.yml file
@gohighlevel:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken='<GITHUB_PKG_AUTH_TOKEN>'
@platform-ui:registry=https://us-central1-npm.pkg.dev/highlevel-staging/frontend-core/
//us-central1-npm.pkg.dev/highlevel-staging/frontend-core/:always-auth=true
//us-central1-npm.pkg.dev/highlevel-staging/frontend-core/:_authToken='<GOOGLE_PKG_AUTH_TOKEN>'
@ghl-plugins:registry=https://us-central1-npm.pkg.dev/highlevel-staging/ghl-plugins/
//us-central1-npm.pkg.dev/highlevel-staging/ghl-plugins/:always-auth=true
//us-central1-npm.pkg.dev/highlevel-staging/ghl-plugins/:_authToken='<GOOGLE_PKG_AUTH_TOKEN>'nodeLinker: node-modules
npmScopes:
gohighlevel:
npmAlwaysAuth: true
npmRegistryServer: 'https://npm.pkg.github.com/'
npmAuthToken: '<GITHUB_PKG_AUTH_TOKEN>'
platform-ui:
npmAlwaysAuth: true
npmRegistryServer: 'https://us-central1-npm.pkg.dev/highlevel-staging/frontend-core/'
npmAuthToken: '<GOOGLE_PKG_AUTH_TOKEN>'
ghl-plugins:
npmAlwaysAuth: true
npmRegistryServer: 'https://us-central1-npm.pkg.dev/highlevel-staging/ghl-plugins/'
npmAuthToken: '<GOOGLE_PKG_AUTH_TOKEN>'GitHub Package Token
For accessing private GitHub packages, obtain the token from this thread.
Google Artifact Registry Authentication
Run the following command to authenticate with Google Artifact Registry:
npx google-artifactregistry-authIf your npmrc file is present at a different path, run the following command:
npx google-artifactregistry-auth --repo-config <PATH_TO_READ_ONLY_NPMRC> --credential-config <PATH_TO_WRITE_NPMRC>Note: For Yarn 2+ users, after running the above command, we need to manually copy the generated token from .npmrc to your .yarnrc.yml file as gcloud-cli doesn't support authenticating from .yarnrc.yml files yet.
Prerequisites
Package Manager
node.js>= 20 (20.10.0recommended)yarn>= 1 (4.6.0recommended)npm>= 7 (9.0.0recommended)
TailwindCSS
autoprefixer>= 10 (10.4.20recommended)postcss>= 8 (8.4.47recommended)tailwindcss>= 3 (3.4.14recommended)
Note
Follow the compatibility guide if you wish to use both @gohighlevel/ghl-ui & @platform-ui/highrise simulataneously. If you’re still facing issues, please feel free to reach out to the team here.
Install TailwindCSS
yarn add [email protected] [email protected] [email protected] -DRequired Packages Installation
Please keep the version set to latest in your dependencies while under development of your app. We'll keep pushing minor patches to the components in parallel. Before productionalization of the app, we can fix the version in package.json
yarn add @platform-ui/highrise @gohighlevel/ghl-icons @ghl-plugins/tailwind-prefix-wrapperNote: This command will install the HighRise library along with the GHL icons, which is a dependency.
Setting up fonts
Add Inter stylesheet to your project
Note
This is needed only for iframe and standalone apps. For module-federated apps, fonts are initialized in spm-ts
<html>
<head>
<link rel="preconnect" href="https://rsms.me/" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
</head>
</html>Setting up tailwind config
The HLTailwindConfig export provides our pre-configured TailwindCSS settings optimized for the HighRise component system. While using the configuration as-is works for most applications, you can extend it for custom needs:
- Spread
...HLTailwindConfigto inherit our base configuration - Preserve our plugins by spreading
[...HLTailwindConfig.plugins, /* <other plugins> */]into your plugins array - For deep customization, use
lodash.merge()to ensure proper config inheritance
const { HLTailwindConfig } = require('@platform-ui/highrise')
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
...HLTailwindConfig,
theme: {
extend: {
...HLTailwindConfig.theme.extend,
fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},
},
},
}import { HLTailwindConfig } from '@platform-ui/highrise'
import defaultTheme from 'tailwindcss/defaultTheme'
export default {
...HLTailwindConfig,
theme: {
extend: {
...HLTailwindConfig.theme.extend,
fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},
},
},
}Add required TailwindCSS directives in your main CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Your custom styles below */Setting up PostCSS config
Create a file named postcss.config.js in the root of your app and add the below content. Replace <appNamePlaceholder> with the name of your app. The same name has to be included in the namespace prop in the next step.
const ghlTailwindPrefixWrapper = require('@ghl-plugins/tailwind-prefix-wrapper')
module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer'), ghlTailwindPrefixWrapper({ prefix: '.<appNamePlaceholder>' })],
}import autoprefixer from 'autoprefixer'
import ghlTailwindPrefixWrapper from '@ghl-plugins/tailwind-prefix-wrapper'
import tailwindcss from 'tailwindcss'
export default {
plugins: [tailwindcss(), autoprefixer(), ghlTailwindPrefixWrapper({ prefix: '.<appNamePlaceholder>' })],
}Working on your first screen
- Setup your new module-federated application using the boilerplate provided here.
WARNING
Use
HLContentWraponly for the root page component. NestingHLContentWrapwill cause unexpected behaviour. - Add
HLContentWrapand stylesheet imports toApp.vueandmain.tsrespectively for standalone / iframe apps. - Make sure to import your main css file in every page of your module-federated application.
<script lang="ts" setup>
import { HLContentWrap } from '@platform-ui/highrise'
import '@platform-ui/highrise/style.css'
import '@/index.css' // Add your main css file here
</script>
<template>
<HLContentWrap namespace="<appNamePlaceholder>">
hello world!
<!-- other SFCs -->
</HLContentWrap>
</template>