Property component is used to document API properties, parameters, and fields. It displays the property name, type, and description along with optional metadata like default values, requirement status, and deprecation notices.
Usage
Props
The name of the property or parameter.
The data type of the property (e.g.,
string, number, boolean, object, array, integer, enum).The description or content explaining the property. Supports markdown formatting.
Whether the property is required. Displays a “required” badge when
true.The default value for the property. Automatically stringified and displayed as a badge. Complex nested objects are not displayed.
Whether the property is deprecated. Displays a “deprecated” badge when
true.Where the parameter is located (e.g.,
"path", "query", "header", "body", "cookie"). Displayed as a badge.If
true, the property will not be rendered at all.Custom HTML id for the property. Used for anchor links.
Array of custom labels to display before the type (e.g.,
["v2"] for version badges).Array of custom labels to display after other badges (e.g.,
["read-only"]).Additional CSS classes to apply to the property container.
Callback function executed when the component mounts.
ARIA label for the header anchor link (for accessibility).
Custom label text for the default value badge. Useful for internationalization.
Custom label text for the required badge. Useful for internationalization.
Custom label text for the deprecated badge. Useful for internationalization.
Examples
Basic Property
Simple property with name, type, and description:Required Property
Mark a property as required:Property with Default Value
Show a default value:Property with Location
Specify where the parameter is located:Deprecated Property
Mark a property as deprecated:Property with All Metadata
Multiple Properties
Document multiple related properties:Custom Pre/Post Labels
Add custom badges before and after the type:Different Locations
Internationalized Labels
Customize badge labels for different languages:Custom Styling
Apply custom CSS classes:Behavior
- Hidden Properties: When
hidden={true}, the property is not rendered at all - Default Values: Complex objects with nested objects are automatically hidden to prevent display issues
- Default Value Length: Default values longer than the maximum length are not displayed
- Type Display: The type is always displayed prominently alongside the property name
- Badge Order: Badges are displayed in this order: pre → type → location → required → default → deprecated → post
Accessibility
- Each property can have an
idfor anchor linking - The
navigateToHeaderAriaLabelprop allows customization of the anchor link’s ARIA label - All badges and metadata are properly labeled for screen readers
Source
View the source code:packages/components/src/components/property/property.tsx:7