Learn how to create a home page for your app.
2025.2
).
Add an app home component to your project
pages/
directory will be created in the project’s src/app/
directory. The pages/
directory will contain:*-hsmeta.json
).tsx
)package.json
fileUpload to HubSpot
hs project install-deps
from within your local project directory to install necessary dependencies. This will create a package-lock.json
file, which will speed up the project build time and ensure that any dependencies in your local development environment and production match.hs project upload
.hs project open
. Alternatively, in HubSpot you can navigate to Development > Projects, then click the name of your project.hubspot.fetch
to leverage your backend to save and retrieve settings. Learn more about using this approach in the legacy documentation.hs project dev
command to iteratively build out your settings page and preview your changes locally.*-hsmeta.json
or package.json
files, you’ll need to stop the server, upload your changes, then start the server again.<HeaderActions>
<PrimaryHeaderActionButton>
<SecondaryHeaderActionButton>
0.10.0
or later of the ui-extensions
NPM package. You can check your current version by running npm list
or npm list -g
, and install the latest version by running npm i @hubspot/ui-extensions
.@hubspot/ui-extensions/pages/home
.
HeaderActions
component is the main wrapper component for the primary and secondary header action button components. It’s recommended to only include one instance of HeaderActions
in your app, and to avoid adding/removing it dynamically which can result in unexpected behavior.
Only PrimaryHeaderActionButton
and SecondaryHeaderActionButton
are supported as children.
PrimaryHeaderActionButton
component renders an orange button, and should be used for the primary action on the home page. HeaderActions
can contain only one instance of PrimaryHeaderActionButton
. For additional buttons, use SecondaryHeaderActionButton
.
Prop | Type | Description |
---|---|---|
children (required) | ReactNode | The button text or content. |
onClick | () => void | A function that will be invoked when the button is clicked. It receives no arguments and it’s return value is ignored. |
href | String | Object | Include this prop to open a URL on click. Contains the following fields:
href and an onClick action, both will be executed on button click. |
disabled | Boolean | When set to true , the button will render in a greyed-out state and cannot be clicked. |
overlay | Object | Include a Modal or Panel component in this object to open it as an overlay on click. Learn more about using overlays. |
SecondaryHeaderActionButton
component renders additional buttons that appear in an Actions dropdown menu next to the primary button. You can include multiple secondary buttons, and each will appear as another item in the Actions dropdown menu.