项目作者: nebrelbug

项目描述 :
An admonitions React component, ported from remarkable-admonitions. Perfect for Docusaurus v2 and other React-based doc generators
高级语言: JavaScript
项目地址: git://github.com/nebrelbug/react-admonitions.git
创建时间: 2019-08-29T03:38:52Z
项目社区:https://github.com/nebrelbug/react-admonitions

开源协议:

下载


react-admonitions

An admonitions React component, ported from remarkable-admonitions. Perfect for Docusaurus v2 and other React-based doc generators.

NPM JavaScript Style Guide Build Status

TL;DR
Nice-looking hints, warnings, etc. specifically targeted toward Docusaurus docs websites.

Test the component out on Stackblitz, or view the demo

Install

  1. npm install --save react-admonitions

Screenshots

Example Pictures

Usage

  1. import React, { Component } from 'react'
  2. import Admonition from 'react-admonitions'
  3. class Example extends Component {
  4. render() {
  5. return (
  6. <Admonition type="warning" title="Do not do this">
  7. Admonition Content
  8. </Admonition>
  9. )
  10. }
  11. }

Props

Name Default Description
type none What type of admonition you want to display. Valid options: "warning", "tip", "caution", "note", "important", "question"
iconType "svg" The type of admonition icon. Valid options: "svg", "emoji"
title none The, well, title of the admonition

Credits

HTML, styles, and concept all come from the amazing Markdown plugin by @favoloso, remarkable-admonitions.

License

MIT © nebrelbug