This document describes the CSS classes used in the generated schema markup. The output is designed to be easily styled according to your needs.
The root container element that wraps all schema documentation.
Contains the schema's top-level description and metadata.
A paragraph element containing the schema's description text.
Container for the properties list in object schemas.
Direct wrapper for all property elements.
Individual property container. Includes depth modifiers:
.property.depth-0- Root level property.property.depth-1- First level nested property.property.depth-2- Second level nested property- And so on for deeper nesting
Container for the property name and badges.
The property's name/key.
Description text for a property.
Container for nested object properties.
Badge displaying the property's type (string, number, object, etc.).
Badge indicating a property is required.
Container for constraint badges.
Individual constraint badge (e.g., "minLength: 3", "maximum: 100").
Container for detailed schema information. Includes depth modifiers like .property.
Container for enumerated values.
Label text "Possible values:".
Individual enum value badge.
Container for default value display.
Container for example values.
Label text "Examples:".
Container for array schema documentation.
Container for array item schema.
Label text "Items:".
Container for oneOf/anyOf/allOf schemas.
Container for the list of schema options.
Individual schema option in a compound schema.
Container for schema definitions/$defs.
Individual definition container. Has an id attribute formatted as def-{name}.
The typical structure of the generated markup:
<div class="schema-container">
<div class="schema-header">
<p class="schema-description">...</p>
</div>
<div class="properties-section">
<h2>Properties</h2>
<div class="properties-list">
<div class="property depth-0" data-property="propertyName">
<div class="property-header">
<span class="property-name">propertyName</span>
<span class="type-badge">string</span>
<span class="required-badge">required</span>
</div>
<div class="property-description">...</div>
<div class="schema-details depth-1">
<div class="constraints">
<span class="constraint">minLength: 1</span>
</div>
<div class="enum-values">
<span class="enum-label">Possible values:</span>
<span class="enum-value">value1</span>
</div>
<div class="default-value">Default: <code>defaultValue</code></div>
</div>
</div>
</div>
</div>
</div>-
Depth modifiers - Use the
.depth-Nclasses to create visual hierarchy through indentation or other styling. -
Data attributes - Properties include
data-propertyattributes with the property name for additional styling hooks. -
Semantic HTML - The markup uses semantic elements like
<h2>,<h3>,<h4>,<p>,<span>, and<code>that can be styled directly or in combination with classes. -
Badge styling - The
.type-badge,.required-badge,.constraint, and.enum-valueclasses are designed to be styled as badges or chips. -
Code elements - Default values and examples are wrapped in
<code>tags for monospace font styling.
For a complete working example of how to style and use the generated markup, see example-template.html. This template includes:
- Complete CSS styling for all classes
- JavaScript for collapsible nested properties
- Click-to-copy functionality for code blocks
- Responsive design considerations