Field
Document API parameters, props, and configuration options clearly.
Usage
A field, prop or parameter to display in your content.
name
string required
The
description can be set as prop or in the default slot with full markdown support.::field{name="name" type="string" required}
The `description` can be set as prop or in the default slot with full **markdown** support.
::
API
Props
| Prop | Default | Type |
|---|---|---|
as | 'div' | anyThe element or component this component should render as. |
name | stringThe name of the field. | |
type | stringExpected type of the field’s value | |
description | stringDescription of the field | |
required | boolean Indicate whether the field is required | |
pohon | { root?: ClassValue; container?: ClassValue; name?: ClassValue; wrapper?: ClassValue; required?: ClassValue; type?: ClassValue; description?: ClassValue; } |
Slots
| Slot | Type |
|---|---|
default | object |
Theme
We use unocss-variants to customize the theme. Read more about it in the theming guide.
Below is the theme configuration skeleton for the ProseField. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
app.config.ts
export default defineAppConfig({
pohon: {
prose: {
field: {
slots: {
root: '',
container: '',
name: '',
wrapper: '',
required: '',
type: '',
description: ''
}
}
}
}
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
prose: {
field: {
slots: {
root: '',
container: '',
name: '',
wrapper: '',
required: '',
type: '',
description: ''
}
}
}
}
};
Changelog
No recent changes