ParallaxBackground
A full-width picture behind a centered title and an optional call-to-action link, with an optional dark overlay.
import { ParallaxBackground } from '@salla.sa/twilight-theme-engine/components/home';In plain words
A wide band with a picture in the background, a title in the middle and a button such as "Shop now". Turn on is_opacity to darken the picture so white text stays readable.
Signature
const ParallaxBackground: React.MemoExoticComponent<(props: {
data: {
image: { url?: string };
title?: string;
url?: string;
link_text?: string;
is_opacity?: boolean; // false
[key: string]: unknown;
};
}) => JSX.Element | null>Try it live
Loading an image…
import { ParallaxBackground } from '@salla.sa/twilight-theme-engine/components/home';
export function SummerHero() {
return (
<ParallaxBackground
data={{
image: { url: 'https://cdn.example.com/summer.jpg' },
title: 'The summer collection',
url: '/offers',
link_text: 'Shop now',
is_opacity: true,
}}
/>
);
}
Example
import { ParallaxBackground } from '@salla.sa/twilight-theme-engine/components/home';
export function SummerHero() {
return (
<ParallaxBackground
data={{
image: { url: 'https://cdn.example.com/summer.webp' },
title: 'The summer collection',
url: '/offers',
link_text: 'Shop now',
is_opacity: true,
}}
/>
);
}
How it behaves
Markup:
.full-banner-entrywith the picture as an inlinebackground-image, an overlay (bg-blackonly withis_opacity), and an<h2>title. The link is the engineLink.The parallax effect itself comes from the theme's CSS for
.full-banner-entry, not from the component.
Gotchas
The link renders only when both
urlandlink_textare set.Without
image.urlthe block renders nothing, title included. The picture is a CSS background, so it has no alt text and is not lazy-loaded.