0.7.2

WidgetWrapper

Source code

A component for fixing an element’s width to the current breakpoint.

Default

Content before

Content inside WidgetWrapper

Content after

---
import { WidgetWrapper } from '@yatoday/astro-ui/astro';
---

<WidgetWrapper>
  <div>Content inside `WidgetWrapper`</div>
</WidgetWrapper>
With background

Content before

Content inside WidgetWrapper

Content after

---
import { WidgetWrapper } from '@yatoday/astro-ui/astro';
---

<WidgetWrapper>
  <div>Content inside `WidgetWrapper`</div>
  <Fragment slot="bg">
    <div className="absolute inset-0 bg-zinc-500"></div>
  </Fragment>
</WidgetWrapper>
With CSS classes

Content before

Content inside WidgetWrapper

Content after

---
import { WidgetWrapper } from '@yatoday/astro-ui/astro';
---

<WidgetWrapper containerClass="text-center py-6 md:py-6 lg:py-6">
  <div>Content inside `WidgetWrapper`</div>
</WidgetWrapper>

Props

PropTypeDefaultDescription
idstring-Set to specify a unique id for an HTML element
asstringsectionHTML tag name for the wrapper
containerClassstring-Additional CSS classes to apply to the wrapper
isDarkbooleanfalseAdds the dark CSS class to the wrapper
bgstring-Set background element