Gathering detailed insights and metrics for pretty-proptypes
Gathering detailed insights and metrics for pretty-proptypes
Gathering detailed insights and metrics for pretty-proptypes
Gathering detailed insights and metrics for pretty-proptypes
@types/pretty-proptypes
TypeScript definitions for pretty-proptypes
api-check
Validate the api to your functions to help people use them correctly. This is pretty much React's propTypes without React.
babel-plugin-extract-react-types
Plugin to allow pretty-proptypes to more easily pull in component data
One stop shop for documenting your react components.
npm install pretty-proptypes
Typescript
Module System
Node Version
NPM Version
pretty-proptypes@1.3.0
Updated on Jul 04, 2021
extract-react-types-loader@1.0.0
Updated on Jun 09, 2021
extract-react-types@0.30.2
Updated on May 25, 2021
extract-react-types@0.30.1
Updated on Apr 20, 2021
pretty-proptypes@1.2.0
Updated on Mar 08, 2021
extract-react-types@0.30.0
Updated on Mar 05, 2021
JavaScript (99.71%)
TypeScript (0.29%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
184 Stars
288 Commits
29 Forks
5 Watchers
52 Branches
79 Contributors
Updated on Jul 10, 2025
Latest Version
1.7.0
Package Id
pretty-proptypes@1.7.0
Unpacked Size
422.47 kB
Size
67.61 kB
File Count
7
NPM Version
6.14.15
Node Version
14.18.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
1
PrettyPropTypes is designed to display the output of
extract-react-types. It is
designed to read the output from extract-react-types
, and display rich prop
information for consumers.
pretty-proptypes can display props from two sources.
babel-plugin-extract-react-types
and passing the component to Props
.babelrc
1{ 2 "plugins": ["babel-plugin-extract-react-types"] 3}
1import MyCoolComponent from '../MyCoolComponent'; 2 3<Props heading="My Cool Component" component={MyCoolComponent} />;
Props
with extract-react-types-loader
or getting types from extract-react-types
and writing it to a file1<Props 2 heading="My Cool Component" 3 props={require('!!extract-react-types-loader!../MyCoolComponent')} 4/>
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.
extract-react-types-loader
or prebuild this data with extract-react-types
and read it from a file if
you prefer.extract-react-types
directly or extract-react-types-loader
, they will currently only look at the default export
of a file. babel-plugin-extract-types
will look at the default export as well as named exports.Display a heading for the collection of props. Pass in an empty string if you want no heading, otherwise it defaults to "Props".
Set whether the prop shapes should be shown by default, or whether they should be hidden, and require being expanded.
Accepts an object that allows you to override particular style components within our prop definition. The currently modifiable components are:
Any that are not passed in will use the default component.
The override
prop allows you to override a specific prop's definition. If you
want to keep the appearance aligned, we recommend using the Prop
export from
PrettyPropType.
An override is invoked with all the props passed to the Prop component internally,
and renders the result. In the example below, we are changing the type
field,
and stopping the shape component from appearing, while leaving other parts of the
component the same.
1import Props, { Prop } from 'pretty-proptypes' 2 3${<Props 4 heading="" 5 props={require('!!extract-react-types-loader!../../PropTypes/Select')} 6 overrides={{ 7 isACoolComponent: (props) => <Prop {...props} shapeComponent={() => null} type="All Components Object" /> }} 8/>}
While you can pass style components
directly to Prop
, we recommend passing
style components in the top level Props, and letting them flow down.
In cases where a completely bespoke layout is required, use the LayoutRenderer
. This component allows you to define a completely custom layout and substitute in your own UI.
The renderTypes
prop is called for every prop found on a given component and allows you to specify how that type should be rendered.
If you don't want to override the default components, you can use the components
property. Or import them directly from pretty-proptypes
.
1import { LayoutRenderer } from 'pretty-proptypes'; 2 3<LayoutRenderer 4 props={require('!!extract-react-types-loader!../MyCoolComponent')} 5 renderTypes={({ typeValue, defaultValue, description, required, name, type, components }) => { 6 <div> 7 <h2>{name}</h2> 8 <components.Description>{description}</components.Description> 9 {required && <components.Required>Required</components.Required>} 10 <components.Type>{type}</components.Type> 11 <components.PropType typeValue={typeValue} /> 12 </div>; 13 }} 14/>;
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9
Reason
SAST tool detected but not run on all commits
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
Found 9/20 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
17 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More