Skip to content

useBoosterFont

Types

ts

declare default function useBoosterFonts(options?: {
    critical?: boolean;
}): {
    isCritical: Ref<boolean, boolean>;
    $getFont: (family: FontFamily | DirectiveGetFontArguments, weight?: FontWeight, style?: FontStyle, options?: DirectiveGetFontOptions) => DirectiveGetFontResult;
};

Options

PropertyDescriptionDefault Value
criticalOverride critical from component.inherit from component
js
const { $getFont } = useBoosterFonts({critical: true});

Return

PropertyDescription
isCriticalIndicates whether critical is active.
$getFontLearn more about $getFont

Example

html
<template>
  <span v-font="$getFont(…)"></span>
</template>

<script setup>
  const { $getFont } = useBoosterFonts();
</script>