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. CVS update常用技巧

    常用的命令有 cvs update 全部更新 cvs update path/to/file 来更新某一个文件 cvs update -dP 意为删除空目录创建新目录 cvs -f -n update ...

  2. 关于JPA的理解

    JPA全称 Java Persistence API.JPA通过JDK5.0注解或者XML描述对象和关系表的映射关系,并将运行期的实体对象持久化到数据库中.持久化:即把数据(如内存中的对象)保存到可永 ...

  3. js 秒杀

    秒杀活动页面 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" ...

  4. Jmeter下载安装配置

    一,进入官网:http://jmeter.apache.org/ 1.第一步进入官网如下图 2.选择进行下载,下载下来为一个压缩包,解压即可. 3.我下载的是jmeter4.0版本,对应jdk1.8. ...

  5. Linux rm删除

    将 test1子目录及子目录中所有档案删除 命令: rm -r test1 rm -rf test2命令会将 test2 子目录及子目录中所有档案删除,并且不用一一确认 命令: rm -rf  tes ...

  6. 【转】SQL索引一步到位

    原文:http://www.cnblogs.com/AK2012/archive/2013/01/04/2844283.html SQL索引一步到位(此文章为“数据库性能优化二:数据库表优化”附属文章 ...

  7. CF Educational Codeforces Round 21

    A. Lucky Year time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  8. 关于JS正则表达式

    去除所有P标签 content=content.replace(/<([\/]?)(p)((:?\s*)(:?[^>]*)(:?\s*))>/g, ''); 将所有的  1.     ...

  9. BZOJ 4753 [Jsoi2016]最佳团体 ——01分数规划 树形DP

    要求比值最大,当然用分数规划. 二分答案,转化为选取一个最大的联通块使得它们的和大于0 然后我们直接DP. 复杂度$O(n^2\log {n})$ #include <map> #incl ...

  10. [BZOJ4506] [Usaco2016 Jan]Fort Moo(DP?)

    传送门 总之可以先预处理出来每个位置最多往上延伸多少 枚举两行,看看夹在这两行中间的列最大能构成多大的矩形 可以看出,必须得在一个两行都没有X的区间才有可能构成最大的答案 那么可以把这些区间处理出来, ...