2018-08-05 18:27:17 +03:00
# Layouts
Each slide can include a custom layout around its content.
This can be used as a substitute for slide templates found in other presentation apps and libraries.
```js
// example Layout.js
import React from 'react'
2019-04-11 00:09:17 +03:00
export default ({ children }) => (
2018-08-05 18:27:17 +03:00
< div
style={{
width: '100vw',
height: '100vw',
2019-04-11 00:09:17 +03:00
backgroundColor: 'tomato',
}}
>
2018-08-05 18:27:17 +03:00
{children}
< / div >
2019-04-11 00:09:17 +03:00
)
2018-08-05 18:27:17 +03:00
```
```mdx
import Layout from './Layout'
# No Layout
---
2019-04-11 00:09:17 +03:00
< Layout >
2018-08-05 18:27:17 +03:00
# Custom Layout
2019-04-11 00:09:17 +03:00
< / Layout >
2018-08-05 18:27:17 +03:00
```
The layout component will wrap the MDX elements within that slide,
which means you can use a nested ThemeProvider or target elements with CSS-in-JS.
2019-04-11 00:09:17 +03:00
**NOTE:** The newlines around child content in the layout component is **required** to use markdown syntax in a layout. Otherwise the content will be parsed as raw text.
2018-08-05 18:27:17 +03:00
## Built-in Layouts
mdx-deck includes a few built-in layouts for common slide variations.
See the [Components docs ](components.md#layouts ) for more.