β
οΈ Migration Guide
This documentation is for Docz v2. Follow our migration guide if you haven't upgraded your project yet.
π v1 docs
If you're still using v1, you can find the docs here.
π© Features
π© Powered by Gatsby. Bundling and ecosystem powered by Gatsby.π§ Zero config and easy. Don't worry about complex configurations steps.β‘οΈ Blazing Fast. Full hot reload support with webpack 4 and automatic code splitting.π Easy to customize. Create and use real customizable themes.π MDX Based. Write markdown enhanced by the power of components.π Pluggable. Use plugins to manipulate and customize Docz to suit your needs.π Typescript Support. Full support for TypeScript. Write your type definitions with no extra setup required.
π€ Why?
Libraries that make development easier are appearing every day. Style guides and design systems are growing in popularity. Today, tools that allow us to get our best work done and be efficient are necessary. We shouldn't be spending too much time on tasks that should be trivial. This is why we created Docz.
Documenting code is one of the most important and time-heavy processes when you're creating something new. A lot of time is wasted on unnecessarily attempting to build a documentation site that will match the style we want.
our website
ππ» More info onπ Plugins
- gatsby-theme-docz - Use Docz as a theme for Gatsby.
- netlify - Deploy your Docz site to Netlify.
- svg sprite loader - Docz plugin for SVG sprite loader.
- snapshots - A plugin for Docz that creates jest snapshots for all documented component usages.
π Examples
- basic - Barebones example.
- gatsby - Example using Docz in a Gastby project.
- react native - Using Docz in a React Native project.
- styled-components - Using Docz with
styled-components
. - with typescript - Using Docz with Typescript.
- with flow - Using Docz with Flow.
- with sass - Using Docz parsing CSS with SASS.
- with less - Using Docz parsing CSS with LESS.
- with postcss - Using Docz parsing CSS with PostCSS.
- with stylus - Using Docz parsing CSS with Stylus.
π Around the world
- Smooth UI - Modern React UI library.
- Set Protocol Docs - Documentation site of Set Protocol.
- RBX - The Comprehensive Bulma UI Framework for React.
- Circuit UI - React component library for SumUp web apps.
- Fannypack - A friendly & accessible React UI Kit built with Reakit.
- React Pixi - React Fiber renderer for Pixi.
- React Hotkey Tooltip - A global Hotkey provider with built in tooltip for React.
- Sajari React SDK - Library of React Components for the Sajari.
β οΈ Warning
Since the release of v1 you need react
and react-dom
v16.8.0
or later installed.
π Install and Usage
Getting started with Docz is really quick and easy.
If you're starting from scratch use create-docz-app to create your project.
npx create-docz-app my-docz-app
# or
yarn create docz-app my-docz-app --example typescript
If you want to add docz
to a codebase, then add docz using your favourite package manager:
$ yarn add --dev docz@next react react-dom
# or
$ npm install --save-dev docz@next react react-dom
Note:
react
andreact-dom
will not be installed automatically. You'll have to install them yourself.
Next, add some .mdx
files anywhere in your project:
---
name: Button
route: /
---
import { Playground, Props } from "docz";
import Button from "./Button";
# Button
<Props of={Button} />
## Basic usage
<Playground>
<Button type="submit">Click me</Button>
<Button>No, click me</Button>
</Playground>
And a Button component Button.jsx
:
import React from "react";
import t from "prop-types";
const Button = ({ children, type }) => <button type={type}>{children}</button>;
Button.propTypes = {
/**
* This is a pretty good description for this prop
* Button type. Learn more about `type` attribute [at MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
*/
type: t.oneOf(["button", "submit", "reset"])
};
Button.defaultProps = {
type: "button"
};
export default Button;
Finally, run the Docz development server:
$ yarn docz dev
That's it! Now you have some real badass documentation
Any doubt? Check our docs to see more about Docz!
π€ Contributions
Contributions, issues and feature requests are very welcome. Please make sure to read the Contributing Guide before making a pull request.
πͺπ» Contributors
This project exists thanks to all the people who contribute. [Contribute].
π Needing Help?
If you need some help you can chat with us on our Spectrum Community, we have a great team who would be more than happy to help you:
Pedro Nauck |
---|