UsageLimit shows the usage of a license property (e.g. "Usage: 1/2") with an upgrade
button next to it. Clicking the button opens UpgradeModal, which loads the billing
component of HYVOR Core (plans and add-ons) focused on the given license property. Both must be
used inside CloudContext.
import { UsageLimit } from '@hyvor/design/cloud';
<UsageLimit
used={languages.length}
limit={license.languages}
focus="languages"
label="Languages"
/>Nothing is rendered when the limit is -1, null, or undefined (unlimited), or when the deployment is not cloud (unless showOnPrem is set). The count turns red when the limit is reached.
usedlimit-1, null, or undefined = unlimited.focuslanguages). Plans and add-ons for
this property are highlighted in the modal.labelUsagebuttonTextUpgrademodalTitlecomponentblogs).buttonSizesmallmodalSizelargeshowOnPremfalsecloud.formatStringUse UpgradeModal directly to open the upgrade flow from anywhere (e.g. a "limit reached"
message).
import { UpgradeModal } from '@hyvor/design/cloud';
let show = $state(false);
{#if show}
<UpgradeModal bind:show focus="blogs" title="Blogs" />
{/if}showfocustitleUpgradecomponentsizelargeparams{}scriptPath/js/billing-component-iframe.jsonclose