Skip to content

Statistic

Statistic component is used to display a statistic with a title, a trend, a graph, and a footer.

Default

Views 24 hours

1,234,123

Trend title

Vue
html
<script setup lang="ts">
  import { HLStatistic } from '@platform-ui/highrise'
</script>
<template>
  <HLStatistic title="Views 24 hours" id="statistic" trendTitle="Trend title"> 1,234,123 </HLStatistic>
</template>

With Tooltip

Views 24 hours

1,234,123

Trend title

Vue
html
<template>
  <HLStatistic
    title="Views 24 hours"
    id="statistic"
    trendTitle="Trend title"
    titleTooltipContent="This is a tooltip content"
    :titleTooltipConfig="{
      placement: 'top',
    }"
  >
    1,234,123
  </HLStatistic>
</template>

Graph Slot

Views 24 hours

1,234,123

100%

trend title

Vue
html
<template>
  <HLStatistic title="Views 24 hours" id="statistic" trendTitle="trend title" showGraph>
    1,234,123
    <template #trend>
      <HLTag id="example-tag" size="lg" color="green" round>
        <template #icon>
          <TriangleIcon />
        </template>
        100%
      </HLTag>
    </template>
    <template #graph>
      <PositiveTrend />
    </template>
  </HLStatistic>
</template>

With Options

Views 24 hours

1,234,123

Trend Slot

Views 24 hours

1,234,123

100%

trend title

Vue
html
<script setup lang="ts">
  import { HLStatistic } from '@platform-ui/highrise'
  import { TriangleIcon, TrendUp01Icon } from '@gohighlevel/ghl-icons/24/outline'
  const options = [
    {
      label: 'Marina Bay Sands',
      key: 'Marina Bay Sands',
      disabled: true,
    },
    {
      label: "Brown's Hotel, London",
      key: "Brown's Hotel, London",
    },
    {
      label: 'Atlantis Bahamas, Nassau',
      key: 'Atlantis Bahamas, Nassau',
    },
    {
      label: 'The Beverly Hills Hotel, Los Angeles',
      key: 'The Beverly Hills Hotel, Los Angeles',
    },
  ]
</script>
<template>
  <HLStatistic title="Views 24 hours" id="statistic" trendTitle="trend title" showGraph> 1,234,123 </HLStatistic>
</template>

Views 24 hours

1,234,123

Trend title

100%

Vue
html
<HLStatistic title="Views 24 hours" id="statistic" trendTitle="Trend title" type="success">
  1,234,123
  <template #icon>
    <TrendUp01Icon />
  </template>
  <template #trend>
    <HLTag id="example-tag" size="lg" color="green" round>
      <template #icon>
        <TriangleIcon />
      </template>
      100%
    </HLTag>
  </template>
  <template #footer>
    <HLSectionFooter :horizontalPadding="false" id="footer-5" :divider="true" :bottomPadding="false">
      <HLSectionFooterItem justify="end">
        <HLButton size="xs" id="btn-5" variant="text" color="blue" link>Learn more</HLButton>
      </HLSectionFooterItem>
    </HLSectionFooter>
  </template>
</HLStatistic>

Props

NameTypeDefaultDescription
id *string-The id of the statistic
titlestring''The title of the statistic
type'primary' | 'success' | 'warning' | 'error' | 'neutral'primaryThe type of the statistic
trendTitlestring''The title of the trend
showGraphbooleanfalseWhether to show the graph
optionsarray-The options of the statistic
icon() => VNode-The icon of the statistic
titleTooltipContentstring''The content of the tooltip
titleTooltipConfigtooltipProps-The config of the tooltip
iconStrokestring-The color of the icon, this will override the type color
iconBgColorstring-The background color of the icon, this will override the type color

Emits

NameParamsDescription
@select(key: string, option: any) => voidThe event emitted when the option is selected, from the dropdown component

Slots

NameParamsDescription
default()The default content slot
icon()The icon slot for button
trend()The trend slot
graph()The graph slot
footer()The footer slot
titleAddon()The title addon slot