MDX Deck is a great library for building slides using Markdown and JSX. Creating a custom Providercomponent allows you to change the markup of the entire deck. This lets you put things like logos and social media handles in each slide easily.

In this lesson, you'll learn how to create a basic custom Provider that adds a Twitter handle to the bottom right corner of every slide.

1. Create a Provider.js:

import React from 'react'
import ThemeProvider from 'mdx-deck/dist/Provider' const Provider = ({ children, ...rest }) => (
<ThemeProvider {...rest}>
{children} <div
style={{
position: 'absolute',
bottom: '1em',
right: '1em'
}}
>
<a href="https://twitter.com/Zhentiw">
@Zhentiw
</a>
</div>
</ThemeProvider>
) export default Provider

2. Create a theme.js:

import theme from 'mdx-deck/themes'
import Provider from './Provider' export default {
...theme,
Provider
}

3. Use it:

export { default as theme } from './theme.js'

# Step 1: Create a Custom Theme

---

# Step 2: Create a Custom Provider

---

# Step 3: Export Our Theme in the mdx-deck

[MDX] Build a Custom Provider Component for MDX Deck的更多相关文章

  1. UE4 Tutorial - Custom Mesh Component 用于绘制自定义网格的插件CustomMeshComponent

    UE4 中用于绘制自定义网格的插件CustomMeshComponent. 转载: UE4 Tutorial - Custom Mesh Component   Over the last few w ...

  2. [Recompose] Merge RxJS Button Event Streams to Build a React Counter Component

    Combining input streams then using scan to track the results is a common scenario when coding with s ...

  3. [React] Validate Custom React Component Props with PropTypes

    In this lesson we'll learn about how you can use the prop-types module to validate a custom React co ...

  4. [AngularFire2] Build a Custom Node Backend Using Firebase Queue

    In this lesson we are going to learn how to build a custom Node process for batch processing of Fire ...

  5. [Angular] Implement a custom form component by using control value accessor

    We have a form component: <label> <h3>Type</h3> <workout-type formControlName=& ...

  6. [原]how to view custom provider's events(collected without provider registered) by wpa

    最近想使用etw作为高效的日志机制,也不想暴露机密信息(关键信息在msnifest文件中).也就是不能在客户机器上注册自己的provider,那需要manifest文件.这样采集回来的.etl文件如果 ...

  7. [React Native] Build a Github Repositories component

    Nav to Repos component from Dashboard.js: goToRepos(){ api.getRepos(this.props.userInfo.login) .then ...

  8. [React Native] Build a Separator UI component

    In this lesson we'll create a reusable React Native separator component which manages it's own style ...

  9. [Angular2 Form] Create custom form component using Control Value Accessor

    //switch-control component import { Component } from '@angular/core'; import { ControlValueAccessor, ...

随机推荐

  1. Spring中使用注解 @Scheduled 执行定时任务

    来自:http://blog.51cto.com/dwf07223/1557145 注解@Scheduled 可以作为一个触发源添加到一个方法中,例如,以下的方法将以一个固定延迟时间5秒钟调用一次执行 ...

  2. 如何把握好 transition 和 animation 的时序,创作描边按钮特效

    效果预览 在线演示 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/mKdzZM 可交互视频教 ...

  3. day21-python模块

    1.时间 import time #时间戳 #计算 # print(time.time()) #1481321748.481654秒 #结构化时间---当地时间 # print(time.localt ...

  4. Python9-day11-作业

    # 1.编写装饰器,为多个函数加上认证的功能(用户的账号密码来源于文件),# 要求登录成功一次,后续的函数都无需再输入用户名和密码 FLAG = False def login(func): def ...

  5. LeetCode(113) Path Sum II

    题目 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given ...

  6. grunt---grunt_test 测试用例

    说明: http://www.gruntjs.net/getting-started --grunt快速入门(创建package.json和Gruntfile.js准备一份新的 Grunt 项目一般需 ...

  7. Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combine

    最近只想喊666,因为我是真得菜,大晚上到网吧打代码还是很不错的嘛 A. Bark to Unlock time limit per test 2 seconds memory limit per t ...

  8. js对文字进行编码

    js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent 1 ...

  9. 九度oj 题目1026:又一版 A+B

    题目描述: 输入两个不超过整型定义的非负10进制整数A和B(<=231-1),输出A+B的m (1 < m <10)进制数. 输入: 输入格式:测试输入包含若干测试用例.每个测试用例 ...

  10. nodemailer发送邮件遇到的一些问题

    使用nodemailer发送邮件一直困惑了我好几天,百度谷歌都没有找到的几个问题,方便大家排查. 我使用的是0.7.1版本,其他的版本好像报错,就没用. 错误信息:Mail from command ...