Official Vue component for Font Awesome 7
87
A Vue component that stacks a base icon, an optional secondary icon, and an optional badge value using the dependency's layered container capability for composable icon layouts. The solution should rely on the dependency's layering utilities rather than custom absolute positioning.
badgeValue is provided, positioning the badge at badgePosition (defaulting to top-right) and applying badgeColor when set, while keeping the base icon centered. @testoverlayIcon is provided, places a secondary icon above the base icon within the same layered container while keeping both centered. @testfixedWidth is true, the layered output reserves consistent width using the dependency's fixed-width layering support so aligned icon columns do not jitter across list items. @testbadgeValue is missing or empty, renders only the base (and optional secondary) icon with no badge markup or spacing artifacts. @test@generates
<!-- Renders a layered icon badge with optional text overlay and secondary icon. -->
<template>
<!-- implementation renders layered icons -->
</template>
<script setup lang="ts">
defineProps<{
icon: string | [string, string] | { prefix: string; iconName: string };
badgeValue?: string | number;
overlayIcon?: string | [string, string] | { prefix: string; iconName: string };
badgeColor?: string;
badgePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
fixedWidth?: boolean;
}>();
</script>Provides layered icon container utilities for stacking icons and text overlays.
Vue runtime for rendering the component.
Install with Tessl CLI
npx tessl i tessl/npm-fortawesome--vue-fontawesomedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10