Learn about the link component for use in UI extensions.
Link
component renders a clickable hyperlink. Use links to direct users to a web page, another part of the HubSpot app, or use them as buttons.
external
to true
. and indicates that the link will open in a new tab. Automatically included when the link leads to a page outside of the HubSpot app.Prop | Type | Description |
---|---|---|
href | Object | Sets the link’s URL and open behavior. Contains the following fields:
|
variant | 'primary' (default) | 'light' | 'dark' | 'destructive' | The color of the link. See the variants section for more information. |
onClick | () => void | A function that is invoked when the link is clicked. The function receives no arguments and its return value is ignored. |
preventDefault | Boolean | When set to true , event.preventDefault() will be invoked before the onClick function is called, preventing automatic navigation to the href URL. |
overlay | Object | Include a Modal or Panel component in this object to open it as an overlay on click. Learn more about using overlays. |
variant
prop, you can set the following styling:
'primary'
: the default blue (#0091ae
).'light'
: a white link that turns to a lighter shade of blue on hover (#7fd1de
).'dark'
: a darker shade of blue (#33475b
).'destructive'
: a red link (#f2545b
).'primary'
variant when you want to link to another page or contact record in HubSpot.'light'
variant when you want to include a link on a dark background.'dark'
variant to include a link in an alert.'destructive'
variant when the link results in an action that can’t be undone by the user, such as deleting contact property information.'destructive'
variant sparingly and only when the action can’t be undone.external: true
).'dark'
variant outside of alerts.