Field Container New
About 371 wordsAbout 1 min
2025-10-08
Overview
In Markdown, use the ::: field
container to describe field information, including field name, field type, whether it's required, default value, description, and other details.
It's suitable for describing fields in configurations, component Props, and similar scenarios.
You can also use the additional :::: field-group
container to group multiple ::: field
containers.
Enable
This feature is disabled by default. You need to enable it in the theme
configuration.
export default defineUserConfig({
theme: plumeTheme({
markdown: {
field: true,
},
})
})
Syntax
<!-- Single Field -->
::: field name="Field Name" type="Type" required default="Default Value"
Field description information
:::
<!-- Field Group -->
:::: field-group
::: field name="Field Name" type="Type" required default="Default Value"
Field description information
:::
::: field name="Field Name" type="Type" required default="Default Value"
Field description information
:::
::::
Properties
nameRequiredstring
Field name
typeOptionalstring
Field type
requiredOptionalboolean
Whether the field is required
optionalOptionalboolean
Whether the field is optional
deprecatedOptionalboolean
Whether the field is deprecated
defaultOptionalstring
Default value. If it's an empty string, use default="''"
Examples
Input:
::: field name="theme" type="ThemeConfig" required default="{}"
Theme configuration
:::
::: field name="enabled" type="boolean" optional default="true"
Whether enabled
:::
Output:
themeRequiredThemeConfig
{}
Theme configuration
enabledOptionalboolean
true
Whether enabled
Input:
:::: field-group
::: field name="theme" type="ThemeConfig" required default="{ base: '/' }"
Theme configuration
:::
::: field name="enabled" type="boolean" optional default="true"
Whether enabled
:::
::: field name="callback" type="(...args: any[]) => void" optional default="() => {}"
<Badge type="tip" text="v1.0.0 New" />
Callback function
:::
::: field name="other" type="string" deprecated
<Badge type="danger" text="v0.9.0 Deprecated" />
Deprecated property
:::
::::
Output:
themeRequiredThemeConfig
{ base: '/' }
Theme configuration
enabledOptionalboolean
true
Whether enabled
callbackOptional(...args: any[]) => void
() => {}
Callback function
otherDeprecatedstring
Deprecated property