Blue Highlight
Overview
The VHighlight
component is a versatile UI component designed for highlighting specific topics, products, or services. It is highly customizable and provides options for a background image, bottom image, and a call-to-action button.
Features
- Customizable Background: Add a gradient overlay with an image.
- Dynamic Button: Include a customizable button with dynamic URL parameters.
- Optional Bottom Image: Display a decorative image below the content.
Importing the Component
To use the VHighlight
component, import it as follows:
vue
import VHighlight from 'UiKit/components/VHighlight/VHighlight.vue';
Component Props
The component accepts the following props:
Prop Name | Type | Default | Required | Description |
---|---|---|---|---|
backgroundImage | String | undefined | No | URL of the background image with a gradient overlay. |
imageBottom | String | undefined | No | URL of the image to display at the bottom of the highlight section. |
topic | String | undefined | No | Topic for query parameters used in the button's link. |
buttonText | String | undefined | No | Text displayed on the call-to-action button. If not provided, the button is hidden. |
Default Slot
The VHighlight component supports a default slot for custom content. This slot is rendered within the highlight container.
Computed Properties
The following computed properties are used internally:
- backgroundImageLocal: Generates a linear gradient overlay over the background image.
- showImageBottom: Returns
true
if a validimageBottom
prop is provided. - showButton: Returns
true
if a validbuttonText
prop is provided.
Full Example with All Features
vue
<script setup lang="ts">
import VHighlight from 'UiKit/components/Ads/VHighlight.vue';
const backgroundImage = '/images/highlight-bg.jpg';
const imageBottom = '/images/bottom-img.png';
const topic = 'products';
const buttonText = 'Learn More';
</script>
<template>
<VHighlight
:backgroundImage="backgroundImage"
:imageBottom="imageBottom"
:topic="topic"
:buttonText="buttonText"
>
<h1>Welcome to Our Products</h1>
<p>Discover a range of solutions tailored for you.</p>
</VHighlight>
</template>
Notes
- Ensure the URLs provided for
backgroundImage
andimageBottom
are accessible. - The
buttonText
andtopic
props dynamically update the button's link URL.