Getting started
UI
W.Feature
Widget
This component uses Swiper Element (WebComponent)
---
import { WidgetHeroSlider } from '@yatoday/astro-ui/astro';
---
<WidgetHeroSlider
items={[
{
title: 'Default Slide',
description: 'Lorem ipsum dolor sit amet, consectetur...',
image: {
src: '~/assets/images/800x800.svg',
alt: 'Lorem Ipsum',
},
callToAction: {
variant: 'primary',
text: 'Read Detail',
href: '#',
},
},
{
title: 'Custom CSS classes',
description: 'Lorem ipsum dolor sit amet, consectetur ...',
image: 'https://placehold.co/800x600?text=Slide+2',
classes: {
container: 'rounded-3xl h-72 bg-linear-to-r/srgb from-gray-900 to-gray-600',
image: '',
title: 'font-bold uppercase bg-gradient-to-r from-pink-500 to-violet-500 bg-clip-text text-transparent',
description: 'text-zinc-300',
},
callToAction: {
variant: 'primary',
text: 'Next',
href: '#',
},
class: 'bg-purple-800',
},
{
title: 'Without Action Button',
description: 'Lorem ipsum dolor sit amet, consectetur...',
image: {
src: 'https://placehold.co/800x600?text=Slide+3',
alt: 'Lorem Ipsum',
},
},
]}
/>
Content before
Content After
<!-- With background -->
<WidgetHeroSlider items={[]}>
<!-- Background container -->
<Fragment slot="bg">
<div class="absolute inset-0 bg-primary/10 dark:bg-card"></div>
</Fragment>
</WidgetHeroSlider>
Prop | Type | Default | Description |
---|---|---|---|
height | string | h-[28rem] | Set the height of the slider and its layers |
id | string | js random | By default, the id is generated automatically. If you decide to specify this parameter yourself, make sure that it is unique on the page |
isDark | boolean | false | Adds the dark CSS class to the WidgetWrapper |
bg | string | - | Set background element |
classes.swiper | string | - | CSS classes for the swiper-container container |
classes.container | string | - | CSS classes for the WidgetWrapper container |
classes.loading | string | - | CSS classes for loading layout |
withPagination | boolean | true | Pagination visibility |
withNavigation | boolean | true | Navigation visibility |
items | Array | [] | Array of HeroSlide components |
autoplay | boolean | false | Object with autoplay parameters or boolean true to enable with default settings |
...rest | any | - | …rest params from Swiper js parameters |