docs/builtin/layouts.md
This page lists all the built-in layouts provided by Slidev. These layouts can be used via the layout option in the frontmatters of your slides.
Note that <LinkInline link="guide/theme-addon" /> may provide additional layouts or override the existing ones. To add your own layouts, see <LinkInline link="guide/write-layout" />.
centerDisplays the content in the middle of the screen.
coverUsed to display the cover page for the presentation, may contain the presentation title, contextualization, etc.
defaultThe most basic layout, to display any kind of content.
endThe final page for the presentation.
factTo show some fact or data with a lot of prominence on the screen.
fullUse all the space of the screen to display the content.
image-leftShows an image on the left side of the screen, the content will be placed on the right side.
---
layout: image-left
# the image source
image: /path/to/the/image
# a custom class name to the content
class: my-cool-content-on-the-right
---
image-rightShows an image on the right side of the screen, the content will be placed on the left side.
---
layout: image-right
# the image source
image: /path/to/the/image
# a custom class name to the content
class: my-cool-content-on-the-left
---
imageShows an image as the main content of the page.
---
layout: image
# the image source
image: /path/to/the/image
---
You can change the default background size (cover) by adding the backgroundSize attribute:
---
layout: image
image: /path/to/the/image
backgroundSize: contain
---
---
layout: image-left
image: /path/to/the/image
backgroundSize: 20em 70%
---
iframe-leftShows a web page on the left side of the screen, the content will be placed on the right side.
---
layout: iframe-left
# the web page source
url: https://github.com/slidevjs/slidev
# a custom class name to the content
class: my-cool-content-on-the-right
---
iframe-rightShows a web page on the right side of the screen, the content will be placed on the left side.
---
layout: iframe-right
# the web page source
url: https://github.com/slidevjs/slidev
# a custom class name to the content
class: my-cool-content-on-the-left
---
iframeShows a web page as the main content of the page.
---
layout: iframe
# the web page source
url: https://github.com/slidevjs/slidev
---
introTo introduce the presentation, usually with the presentation title, a short description, the author, etc.
noneA layout without any existing styling.
quoteTo display a quotation with prominence.
sectionUsed to mark the beginning of a new presentation section.
statementMake an affirmation/statement as the main page content.
two-colsSeparates the page content in two columns.
---
layout: two-cols
---
# Left
This shows on the left
::right::
# Right
This shows on the right
two-cols-headerSeparates the upper and lower lines of the page content, and the second line separates the left and right columns.
---
layout: two-cols-header
---
This spans both
::left::
# Left
This shows on the left
::right::
# Right
This shows on the right
<style>
.two-cols-header {
column-gap: 20px; /* Adjust the gap size as needed */
}
</style>