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 NameTypeDefaultRequiredDescription
backgroundImageStringundefinedNoURL of the background image with a gradient overlay.
imageBottomStringundefinedNoURL of the image to display at the bottom of the highlight section.
topicStringundefinedNoTopic for query parameters used in the button's link.
buttonTextStringundefinedNoText 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 valid imageBottom prop is provided.
  • showButton: Returns true if a valid buttonText 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 and imageBottom are accessible.
  • The buttonText and topic props dynamically update the button's link URL.

Example

Welcome to Our Products

Discover a range of solutions tailored for you.

Learn More

Welcome to Our Products

Discover a range of solutions tailored for you.

Learn More
Help Ukraine to stop russian aggression