Skip to content

Instantly share code, notes, and snippets.

@a-h
Last active November 22, 2023 10:57
Show Gist options
  • Save a-h/e7450ea6adad91394431ea87cf9f83db to your computer and use it in GitHub Desktop.
Save a-h/e7450ea6adad91394431ea87cf9f83db to your computer and use it in GitHub Desktop.
slidev two columns with header layout
<!--
Usage:
```md
---
layout: two-cols-header
---
This shows up across both
::left::
# Left
This shows on the left
::right::
# Right
This shows on the right
```
-->
<script setup lang="ts">
const props = defineProps({
class: {
type: String,
},
})
</script>
<template>
<div class="slidev-layout two-columns w-full h-full">
<div class="col-span-2">
<slot />
</div>
<div class="grid grid-cols-2 grid-rows-2">
<div class="col-left" :class="props.class">
<slot name="left" />
</div>
<div class="col-right" :class="props.class">
<slot name="right" />
</div>
</div>
</div>
</template>
@a-h
Copy link
Author

a-h commented Sep 13, 2022

Add the file as layouts/two-cols-header.vue

See https://github.com/slidevjs/slidev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment