This is a cool hero with image that you can use in your projects to make them cool as well
The HeroWithImage
component is designed to showcase key features or highlights of your project, product, or service in a visually appealing and informative layout. This component is perfect for landing pages, product pages, or any section where you want to combine text and imagery to convey important information effectively. It supports responsive design, ensuring your content looks great on devices of all sizes.
The component accepts the following props for customization:
<HeroWithImageComponent
title="Innovative Design"
description="Our product features an innovative design that simplifies workflows and enhances productivity. Explore how our solutions can benefit your business today."
image="/path/to/image.jpg"
>
<Button label="Cool Button" />
<Button
label="Secondary Button"
secondary
/>
</HeroWithImageComponent>
The component utilizes Tailwind CSS for styling, which makes it easy to integrate into projects that already use Tailwind for their design system. The layout is divided into two main sections: text content and image display, providing a balanced visual appeal. The text and image sections are displayed side by side on larger screens and stacked on smaller devices for better responsiveness.
HeroWithImage
component in your application as required, providing the necessary props for customization.dark:text-primary
class is configured appropriately in your Tailwind setup to reflect your design preferences.<script setup lang="ts">
interface PropsInterface {
title: string;
description: string;
image: string;
}
defineProps<PropsInterface>();
</script>
<template>
<div>
<div
class="mx-auto w-full max-w-7xl text-black dark:text-primary lg:flex lg:flex-row"
>
<div class="mx-10 my-lg flex flex-col text-center lg:w-1/2 lg:text-left">
<h2
v-if="title"
class="text-2xl font-bold md:text-4xl lg:text-6xl"
>
{{ title }}
</h2>
<div>
<p class="mt-2 text-xl lg:text-xl">
{{ description }}
</p>
</div>
<div class="mt-4 flex gap-2">
<slot />
</div>
</div>
<div class="mt-4 flex overflow-hidden md:mt-10 lg:mt-0 lg:w-1/2">
<img
class="object-cover"
:src="image"
alt="cool-image"
/>
</div>
</div>
</div>
</template>