All Projects → atlassian → Extract React Types

atlassian / Extract React Types

Licence: mit
One stop shop to document your react components.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Extract React Types

babel-plugin-transform-react-qa-classes
Add component's name in `data-qa` attributes to React Components
Stars: ✭ 41 (-70.92%)
Mutual labels:  babel-plugin, react-components
Fd Zh
🇨🇳翻译: <fd> 一种简单,快速和用户友好的 >find< 替代方案 ❤️ 校对 ✅
Stars: ✭ 140 (-0.71%)
Mutual labels:  docs
React Trumbowyg
React wrapper for lightweight WYSIWYG editor Trumbowyg
Stars: ✭ 130 (-7.8%)
Mutual labels:  react-components
Github Template Guidelines
Guidelines for building GitHub templates.
Stars: ✭ 137 (-2.84%)
Mutual labels:  docs
Prism Documentation
Stars: ✭ 131 (-7.09%)
Mutual labels:  docs
Styleguide
The VTEX Design System and React component library.
Stars: ✭ 138 (-2.13%)
Mutual labels:  react-components
Devextreme Reactive
Business React components for Bootstrap and Material-UI
Stars: ✭ 1,800 (+1176.6%)
Mutual labels:  react-components
Icopy Site.github.io
icopy.site github mirror
Stars: ✭ 142 (+0.71%)
Mutual labels:  docs
Style Guide
🎨 Brainly Front-End Style Guide
Stars: ✭ 139 (-1.42%)
Mutual labels:  react-components
Tabler React
React components and demo for the Tabler UI theme.
Stars: ✭ 1,830 (+1197.87%)
Mutual labels:  react-components
Docs
📚 Prisma Documentation
Stars: ✭ 136 (-3.55%)
Mutual labels:  docs
React Json Schema
Configure and build views using JSON schemas mapped to React components
Stars: ✭ 131 (-7.09%)
Mutual labels:  react-components
React Code Blocks
React code blocks and code snippet components
Stars: ✭ 135 (-4.26%)
Mutual labels:  react-components
Utools Manuals
uTools插件,内置了十多个实用的离线中文手册,包括:Linux、PHP、Python、JS等,以及提供了搜索devdocs、dash/zeal上的文档的功能
Stars: ✭ 130 (-7.8%)
Mutual labels:  docs
React Step Progress Bar
A library to create stunning progress bars and steps in React 🌡
Stars: ✭ 140 (-0.71%)
Mutual labels:  react-components
Gojs React
A set of React components to manage GoJS Diagrams, Palettes, and Overviews
Stars: ✭ 130 (-7.8%)
Mutual labels:  react-components
React Free Style
Make React components easier and more maintainable by using inline style objects
Stars: ✭ 135 (-4.26%)
Mutual labels:  react-components
Docs.hackerone.com
HackerOne Platform Documentation
Stars: ✭ 137 (-2.84%)
Mutual labels:  docs
Vuecommunity
Vue.js community and ecosystem guide, written and maintained by the community itself
Stars: ✭ 143 (+1.42%)
Mutual labels:  docs
Babel Plugin Transform Typescript Metadata
Babel plugin to emit decorator metadata like typescript compiler
Stars: ✭ 142 (+0.71%)
Mutual labels:  babel-plugin

Extract React Types

One stop shop to document your react components.

Getting started 🏁

Step 1: Install

npm install --save-dev babel-plugin-extract-react-types pretty-proptypes

Step 2: Annotate your prop types

export interface AvatarPropTypes {
  /** Provides a url for avatars being used as a link. */
  href?: string;
  /** Defines the size of the avatar */
  size?: 'small' | 'medium' | 'large';
  /** Name will be displayed in a tooltip */
  name?: string;
  /** A url to load an image from (this can also be a base64 encoded image). */
  src?: string;
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
  testId?: string;
}

Step 3: Output prop types

pretty-proptypes can display props from two sources.

Option 1. Using babel-plugin-extract-react-types and passing the component to Props

.babelrc

{
  "plugins": ["babel-plugin-extract-react-types"]
}
import { Props } from 'pretty-proptypes';
import MyCoolComponent from '../MyCoolComponent';

<Props heading="My Cool Component" component={MyCoolComponent} />;

Option 2. Directly passing a component's props to Props with extract-react-types-loader or getting types from extract-react-types and writing it to a file

import { Props } from 'pretty-proptypes';

<Props
  heading="My Cool Component"
  props={require('!!extract-react-types-loader!../MyCoolComponent')}
/>;

This analyses prop type definitions, and default props. It creates descriptions from comments before the type definitions, and will render markdown syntax using react-markings.

Packages

  1. extract-react-types Extract Flow & TypeScript types from React Components
  2. extract-react-types-loader Webpack loader for extract-react-types
  3. babel-plugin-extract-react-types A Babel plugin to store the types of React components as a property on the component for documentation
  4. kind2string kind2string is designed to take the data structures output by extract-react-types and convert it down to a (useful) string.
  5. pretty-proptypes PrettyPropTypes is designed to display the output of extract-react-types and display rich prop information for consumers.

Contribute

Pull requests, issues and comments welcome - please read our contributing guidelines and our code of conduct.

Atlassian

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].