-
Notifications
You must be signed in to change notification settings - Fork 4
Wrap
Bryce Russell edited this page Mar 22, 2023
·
2 revisions
Conditionally wrap elements
Example:
---
import { Wrap } from 'astro-headless-ui';
---
<Wrap wrap={true} as="div" class="test">
<a href="#">Link</a>
</Wrap>
<Wrap wrap={false} as="div">
<a href="#">Link</a>
</Wrap>
<div class="test">
<a href="#">Link</a>
</div>
<a href="#">Link</a>
Toggles the wrapping element on/off
The tag name of the element
All other props are spread onto the wrapping element as attributes