Layout Components
This page contains the documentation for all Layout Components that the @mdxp/components
package has to offer.
BlankLayout
This is the default layout for MDXP, which is exposed here if you need to explicitely use it.
This layout is setup as a div with the following default sx
style:
sx = {width: '100%',height: '100%',boxSizing: 'border-box',position: 'relative',overflow: 'hidden',display: 'flex',flexDirection: 'column',alignItems: 'center',justifyContent: 'center',color: 'text',bg: 'background','& p': {textAlign: 'center'},}
Properties
Examples
Show# SLIDE 1This slide will use whathever the default layout is as its layout---<BlankLayout># SLIDE 2This slide wil have a blank layout.</BlankLayout>---<BlankLayout sx={{color: 'tomato'}}># SLIDE 3This slide will have a blank layout with a tomato colored text.</BlankLayout>---<BlankLayout sx={{bg: 'primary'}}># SLIDE 4This slide will have a blank layout with your theme's "primary" color as background.</BlankLayout>
HeaderLayout
This layout looks at its first child and if that is an H1-H6 element, places it at the top.
You can also pass an optional Footer
element as a property, which will be set at the bottom.
The rest of the page will be filled with a div that contains the rest of the slide and which is styled like a BlankLayout by default.
Properties
Examples
Show# SLIDE 1This slide will use whathever the default layout is as its layout---<HeaderLayout># SLIDE 2This slide will have its title (SLIDE 2) at the top of the page</HeaderLayout>---<HeaderLayout sxHeader={{width: '100%', bg: 'text', color: 'background', textAlign: 'center'}}>### SLIDE 3This slide will have its title at the top of the page,in a full-width box with inverted background and foreground color.Note that the title is smaller, because we used an H3 tag.</HeaderLayout>---<HeaderLayout>This slide 4 will look like a BlankLayout, because it does not have a title as first element.</HeaderLayout>
NumberLayout
This layout renders a BlankLayout, but places an extra, absolutely posistioned, element which contains the current slide number. The extra element is rendered with a Place component.
Properties
Examples
Show# SLIDE 1This slide will use whathever the default layout is as its layout---<NumberLayout># SLIDE 2This slide will have the number 1 written in the bottom right corner.</NumberLayout>---<NumberLayout offset={1} numberOptions={{bottom: '25px', left: '25px', sx: {color: 'red', fontSize: '50px'}}}># SLIDE 3This slide will have the number 3 written in the bottom left corner.The number will also be red and have a 50px font-size.</NumberLayout>