Field & Field Group
Display component props or configuration options in a beautiful, readable format instead of traditional tables.
Introduction
The Field and Field Group components provide an elegant way to document component props, configuration options, or any structured data. Instead of cramped tables, these components offer a spacious, readable layout with support for markdown content, badges, and flexible styling options.
Field
The ProseField component displays a single property or configuration item with its name, type, description, and default value.
Basic Usage
stringrequireddefaultRequired Field
Mark important fields as required with the required prop.
() => voidrequiredComplex Type
Display complex types like unions or function signatures.
sm | md | lg | xlmdWith Markdown Description
Use the default slot to provide rich markdown content as the description.
object{}- primaryColor- Main theme color
- borderRadius- Corner radius (0-20px)
- fontFamily- Custom font stack
{
  primaryColor: '#3b82f6',
  borderRadius: 8,
  fontFamily: 'Inter, sans-serif'
}
Tooltip
Provide additional context with a tooltip using the tip prop.
You can display a custom icon in the tooltip using the tip-icon prop.
booleanfalseCustom Name Slot
Override the name display with custom content using the #name slot.
v-model:openbooleanfalseCustom Default Value Slot
Provide custom rendering for default values using the #default-value slot.
Field Group
The ProseFieldGroup component is a container for multiple ProseField components, providing consistent layout and optional styling variants.
Basic Field Group
Group related fields together in a clean column layout.
stringdefaultstringmdbooleanfalseBordered Fields
Add visual separators between fields using the bordered variant.
booleanfalsebooleantrue() => voidStriped Background
Use alternating backgrounds to improve readability with the striped variant.
stringstring(value: string) => voidbooleanfalseAll Variants Combined
Combine bordered, divided, and striped for maximum visual organization with the all variant.
Array<Item>requiredstring | nullnull(item: Item) => voidbooleanfalsestringNo items foundReal-World Example
Here's how you might document a complete component API:
Button Props
default | destructive | outline | ghost | linkdefault- default- Standard button appearance
- destructive- Red/danger styling for destructive actions
- outline- Outlined button with transparent background
- ghost- Minimal styling with hover effect
- link- Styled as a hyperlink
sm | md | lg | iconmdbooleanfalsetrue, the button cannot be interacted with and appears visually disabled.booleanfalse(event: MouseEvent) => voidUse Cases
The Field and Field Group components are perfect for:
- Component Props Documentation - Document Vue/React component props in a readable format
- API Configuration - Show configuration options for libraries or APIs
- Function Parameters - Document function signatures and parameters
- Type Definitions - Display TypeScript interface or type properties
- CLI Options - Document command-line interface options and flags
- Environment Variables - List and explain required environment variables
Best Practices
1. Use Descriptive Types
Be specific with type definitions to help users understand what values are valid:
<!-- ❌ Too vague -->
::prose-field{name="color" type="string"}
<!-- ✅ Better -->
::prose-field{name="color" type="'red' | 'blue' | 'green' | hex string"}
2. Provide Context in Descriptions
Use the default slot to add examples, lists, or additional context:
::prose-field{name="items" type="Array<Item>" required}
Array of items to display. Each item should have:
- `id` - Unique identifier
- `label` - Display text
- `icon` - Optional icon name
  ::
3. Group Related Fields
Use Field Groups to organize props by category:
### Style Props
::prose-field-group
<!-- Style-related fields -->
::
### Behavior Props
::prose-field-group
<!-- Behavior-related fields -->
::
4. Combine Variants Wisely
- Use dividedfor clear separation
- Use stripedfor long lists
- Use borderedto make sections distinct
- Combine allthree for maximum organization in complex documentation
5. Mark Required Fields Consistently
Always use the required prop for mandatory fields to help users identify what's necessary at a glance.