Wrap multiple Button within a FieldGroup to group them together.
<template>
<PFieldGroup>
<PButton color="neutral" variant="subtle" label="Button" />
<PButton color="neutral" variant="outline" icon="i-lucide:chevron-down" />
</PFieldGroup>
</template>
Use the size prop to change the size of all the buttons.
<template>
<PFieldGroup size="xl">
<PButton color="neutral" variant="subtle" label="Button" />
<PButton color="neutral" variant="outline" icon="i-lucide:chevron-down" />
</PFieldGroup>
</template>
Use the orientation prop to change the orientation of the buttons. Defaults to horizontal.
<template>
<PFieldGroup orientation="vertical">
<PButton color="neutral" variant="subtle" label="Submit" />
<PButton color="neutral" variant="outline" label="Cancel" />
</PFieldGroup>
</template>
You can use components like Input, InputMenu, Select SelectMenu, etc. within a field group.
<template>
<PFieldGroup>
<PInput color="neutral" variant="outline" placeholder="Enter token" />
<PButton color="neutral" variant="subtle" icon="i-lucide:clipboard" />
</PFieldGroup>
</template>
You can use a Tooltip within a field group.
<template>
<PFieldGroup>
<PInput
color="neutral"
variant="outline"
placeholder="Enter token"
/>
<PTooltip text="Copy to clipboard">
<PButton
color="neutral"
variant="subtle"
icon="i-lucide:clipboard"
/>
</PTooltip>
</PFieldGroup>
</template>
You can use a DropdownMenu within a field group.
<script setup lang="ts">
import type { PPDropdownMenuItem } from 'pohon-ui';
const items: Array<PPDropdownMenuItem> = [
{
label: 'Team',
icon: 'i-lucide:users',
},
{
label: 'Invite users',
icon: 'i-lucide:user-plus',
children: [
{
label: 'Invite by email',
icon: 'i-lucide:send-horizontal',
},
{
label: 'Invite by link',
icon: 'i-lucide:link',
},
],
},
{
label: 'New team',
icon: 'i-lucide:plus',
},
];
</script>
<template>
<PFieldGroup>
<PButton
color="neutral"
variant="subtle"
label="Settings"
/>
<PDropdownMenu :items="items">
<PButton
color="neutral"
variant="outline"
icon="i-lucide:chevron-down"
/>
</PDropdownMenu>
</PFieldGroup>
</template>
You can use a Badge within a field group.
<template>
<PFieldGroup>
<PBadge
color="neutral"
variant="outline"
size="lg"
label="https://"
/>
<PInput
color="neutral"
variant="outline"
placeholder="www.example.com"
/>
</PFieldGroup>
</template>
| Prop | Default | Type |
|---|
| Slot | Type |
|---|
Below is the theme configuration skeleton for the PFieldGroup. 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.
export default defineAppConfig({
pohon: {
fieldGroup: {
base: '',
variants: {
size: {
xs: '',
sm: '',
md: '',
lg: '',
xl: ''
},
orientation: {
horizontal: '',
vertical: ''
}
}
}
}
};
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
fieldGroup: {
base: '',
variants: {
size: {
xs: '',
sm: '',
md: '',
lg: '',
xl: ''
},
orientation: {
horizontal: '',
vertical: ''
}
}
}
}
};