Use the v-model directive to control the value of the InputMenu or the default-value prop to set the initial value when you do not need to control its state.
Input to take advantage of Akar's ACombobox component that offers autocomplete capabilities.SelectMenu but it's using an Input instead of a Select.Use the items prop as an array of strings, numbers or booleans:
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" :items="items" />
</template>
You can also pass an array of objects with the following properties:
label?: stringtype?: "label" | "separator" | "item"icon?: stringavatar?: AvatarPropschip?: ChipPropsdisabled?: booleanonSelect?: (e: Event) => voidclass?: anypohon?: { tagsItem?: ClassNameValue, tagsItemText?: ClassNameValue, tagsItemDelete?: ClassNameValue, tagsItemDeleteIcon?: ClassNameValue, label?: ClassNameValue, separator?: ClassNameValue, item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLabel?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue }<script setup lang="ts">
import type { InputMenuItem } from 'pohon-ui'
const items = ref<InputMenuItem[]>([
{
label: 'Backlog'
},
{
label: 'Todo'
},
{
label: 'In Progress'
},
{
label: 'Done'
}
])
const value = ref({
label: 'Todo'
})
</script>
<template>
<PInputMenu v-model="value" :items="items" />
</template>
You can also pass an array of arrays to the items prop to display separated groups of items.
<script setup lang="ts">
const items = ref([
['Apple', 'Banana', 'Blueberry', 'Grapes', 'Pineapple'],
['Aubergine', 'Broccoli', 'Carrot', 'Courgette', 'Leek']
])
const value = ref('Apple')
</script>
<template>
<PInputMenu v-model="value" :items="items" />
</template>
You can choose to bind a single property of the object rather than the whole object by using the value-key prop. Defaults to undefined.
<script setup lang="ts">
import type { InputMenuItem } from 'pohon-ui'
const items = ref<InputMenuItem[]>([
{
label: 'Backlog',
id: 'backlog'
},
{
label: 'Todo',
id: 'todo'
},
{
label: 'In Progress',
id: 'in_progress'
},
{
label: 'Done',
id: 'done'
}
])
const value = ref('todo')
</script>
<template>
<PInputMenu v-model="value" value-key="id" :items="items" />
</template>
Use the multiple prop to allow multiple selections, the selected items will be displayed as tags.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref(['Backlog', 'Todo'])
</script>
<template>
<PInputMenu v-model="value" multiple :items="items" />
</template>
default-value prop or the v-model directive.With multiple, use the delete-icon prop to customize the delete Icon in the tags. Defaults to i-lucide:x.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref(['Backlog', 'Todo'])
</script>
<template>
<PInputMenu v-model="value" multiple delete-icon="i-lucide:trash" :items="items" />
</template>
Use the placeholder prop to set a placeholder text.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
</script>
<template>
<PInputMenu placeholder="Select status" :items="items" />
</template>
Use the content prop to control how the InputMenu content is rendered, like its align or side for example.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu
v-model="value"
:content="{
align: 'center',
side: 'bottom',
sideOffset: 8
}"
:items="items"
/>
</template>
Use the arrow prop to display an arrow on the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" arrow :items="items" />
</template>
Use the color prop to change the ring color when the InputMenu is focused.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" color="neutral" highlight :items="items" />
</template>
highlight prop is used here to show the focus state. It's used internally when a validation error occurs.Use the variant prop to change the variant of the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" color="neutral" variant="subtle" :items="items" />
</template>
Use the size prop to change the size of the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" size="xl" :items="items" />
</template>
Use the icon prop to show an Icon inside the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" icon="i-lucide:search" size="md" :items="items" />
</template>
Use the trailing-icon prop to customize the trailing Icon. Defaults to i-lucide:chevron-down.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" trailing-icon="i-lucide:arrow-down" size="md" :items="items" />
</template>
Use the selected-icon prop to customize the icon when an item is selected. Defaults to i-lucide:check.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" selected-icon="i-lucide:flame" size="md" :items="items" />
</template>
Use the avatar prop to show an Avatar inside the InputMenu.
<script setup lang="ts">
const items = ref(['Nuxt', 'NuxtHub', 'NuxtLabs', 'Nuxt Modules', 'Nuxt Community'])
const value = ref('Nuxt')
</script>
<template>
<PInputMenu
v-model="value"
:avatar="{
src: 'https://github.com/nuxt.png'
}"
:items="items"
/>
</template>
Use the loading prop to show a loading icon on the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" loading :items="items" />
</template>
Use the loading-icon prop to customize the loading icon. Defaults to i-lucide:loader-circle.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
const value = ref('Backlog')
</script>
<template>
<PInputMenu v-model="value" loading loading-icon="i-lucide:loader" :items="items" />
</template>
Use the disabled prop to disable the InputMenu.
<script setup lang="ts">
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
</script>
<template>
<PInputMenu disabled placeholder="Select status" :items="items" />
</template>
You can use the type property with separator to display a separator between items or label to display a label.
<script setup lang="ts">
import type { InputMenuItem } from 'pohon-ui'
const items = ref<InputMenuItem[]>([
{
type: 'label',
label: 'Fruits'
},
'Apple',
'Banana',
'Blueberry',
'Grapes',
'Pineapple',
{
type: 'separator'
},
{
type: 'label',
label: 'Vegetables'
},
'Aubergine',
'Broccoli',
'Carrot',
'Courgette',
'Leek'
])
const value = ref('Apple')
</script>
<template>
<PInputMenu v-model="value" :items="items" />
</template>
You can use the icon property to display an Icon inside the items.
<script setup lang="ts">
import type { PInputMenuItem } from 'pohon-ui';
import { ref } from 'vue';
const items = ref([
{
label: 'Backlog',
value: 'backlog',
icon: 'i-lucide:circle-help',
},
{
label: 'Todo',
value: 'todo',
icon: 'i-lucide:circle-plus',
},
{
label: 'In Progress',
value: 'in_progress',
icon: 'i-lucide:circle-arrow-up',
},
{
label: 'Done',
value: 'done',
icon: 'i-lucide:circle-check',
},
] satisfies Array<PInputMenuItem>);
const value = ref(items.value[0]);
</script>
<template>
<PInputMenu
v-model="value"
:icon="value?.icon"
:items="items"
/>
</template>
#leading slot to display the selected icon.You can use the avatar property to display an Avatar inside the items.
<script setup lang="ts">
import type { PInputMenuItem } from 'pohon-ui';
import { ref } from 'vue';
const items = ref([
{
label: 'praburangki',
value: 'praburangki',
avatar: {
src: 'https://github.com/praburangki.png',
alt: 'praburangki',
},
},
{
label: 'wahyu-ivan',
value: 'wahyu-ivan',
avatar: {
src: 'https://github.com/wahyu-ivan.png',
alt: 'wahyu-ivan',
},
},
{
label: 'GunawanAhmad',
value: 'GunawanAhmad',
avatar: {
src: 'https://github.com/GunawanAhmad.png',
alt: 'GunawanAhmad',
},
},
{
label: 'sandros94',
value: 'sandros94',
avatar: {
src: 'https://github.com/sandros94.png',
alt: 'sandros94',
},
},
] satisfies Array<PInputMenuItem>);
const value = ref(items.value[0]);
</script>
<template>
<PInputMenu
v-model="value"
:avatar="value?.avatar"
:items="items"
/>
</template>
#leading slot to display the selected avatar.You can use the chip property to display a Chip inside the items.
<script setup lang="ts">
import type { PChipProps, PInputMenuItem } from 'pohon-ui';
import { ref } from 'vue';
const items = ref([
{
label: 'bug',
value: 'bug',
chip: {
color: 'error',
},
},
{
label: 'feature',
value: 'feature',
chip: {
color: 'success',
},
},
{
label: 'enhancement',
value: 'enhancement',
chip: {
color: 'info',
},
},
] satisfies Array<PInputMenuItem>);
const value = ref(items.value[0]);
</script>
<template>
<PInputMenu
v-model="value"
:items="items"
>
<template #leading="{ modelValue, pohon }">
<PChip
v-if="modelValue"
v-bind="modelValue.chip"
inset
standalone
:size="(pohon.itemLeadingChipSize() as PChipProps['size'])"
:class="pohon.itemLeadingChip()"
/>
</template>
</PInputMenu>
</template>
#leading slot is used to display the selected chip.You can control the open state by using the default-open prop or the v-model:open directive.
<script setup lang="ts">
import { defineShortcuts } from '#imports';
import { ref } from 'vue';
const open = ref(false);
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done']);
const value = ref('Backlog');
defineShortcuts({
o: () => {
open.value = !open.value;
},
});
</script>
<template>
<PInputMenu
v-model="value"
v-model:open="open"
:items="items"
/>
</template>
defineShortcuts, you can toggle the InputMenu by pressing O.You can use the open-on-focus or open-on-click props to open the menu when the input is focused or clicked.
<script setup lang="ts">
import { ref } from 'vue';
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done']);
const selected = ref('Backlog');
</script>
<template>
<PInputMenu
v-model="selected"
:items="items"
open-on-focus
/>
</template>
Use the v-model:search-term directive to control the search term.
<script setup lang="ts">
import { ref } from 'vue';
const searchTerm = ref('D');
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done']);
const value = ref('Backlog');
</script>
<template>
<PInputMenu
v-model="value"
v-model:search-term="searchTerm"
:items="items"
/>
</template>
Here is an example with a rotating icon that indicates the open state of the InputMenu.
<script setup lang="ts">
import { ref } from 'vue';
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done']);
const value = ref('Backlog');
</script>
<template>
<PInputMenu
v-model="value"
:items="items"
:pohon="{
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform-280',
}"
/>
</template>
Use the create-item prop to enable users to add custom values that aren't in the predefined options.
<script setup lang="ts">
import { ref } from 'vue';
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done']);
const value = ref('Backlog');
function onCreate(item: string) {
items.value.push(item);
value.value = item;
}
</script>
<template>
<PInputMenu
v-model="value"
create-item
:items="items"
class="w-48"
@create="onCreate"
/>
</template>
always to show it even when similar values exist.@create event to handle the creation of the item. You will receive the event and the item as arguments.You can fetch items from an API and use them in the InputMenu.
<script setup lang="ts">
import type { PAvatarProps } from 'pohon-ui';
import { useFetch } from '#app';
const { data: users, status } = await useFetch('https://jsonplaceholder.typicode.com/users', {
key: 'typicode-users',
transform: (data: Array<{ id: number; name: string }>) => {
return data?.map((user) => ({
label: user.name,
value: String(user.id),
avatar: { src: `https://i.pravatar.cc/120?img=${user.id}` },
}));
},
lazy: true,
});
</script>
<template>
<PInputMenu
:items="users"
:loading="status === 'pending'"
icon="i-lucide:user"
placeholder="Select user"
>
<template #leading="{ modelValue, pohon }">
<PAvatar
v-if="modelValue"
v-bind="modelValue.avatar"
:size="(pohon.leadingAvatarSize() as PAvatarProps['size'])"
:class="pohon.leadingAvatar()"
/>
</template>
</PInputMenu>
</template>
Set the ignore-filter prop to true to disable the internal search and use your own search logic.
<script setup lang="ts">
import type { PAvatarProps } from 'pohon-ui';
import { useFetch } from '#app';
import { refDebounced } from '@vueuse/core';
import { ref } from 'vue';
const searchTerm = ref('');
const searchTermDebounced = refDebounced(searchTerm, 200);
const { data: users, status } = await useFetch('https://jsonplaceholder.typicode.com/users', {
params: { q: searchTermDebounced },
transform: (data: Array<{ id: number; name: string }>) => {
return data?.map((user) => ({
label: user.name,
value: String(user.id),
avatar: { src: `https://i.pravatar.cc/120?img=${user.id}` },
}));
},
lazy: true,
});
</script>
<template>
<PInputMenu
v-model:search-term="searchTerm"
:items="users"
:loading="status === 'pending'"
ignore-filter
icon="i-lucide:user"
placeholder="Select user"
>
<template #leading="{ modelValue, pohon }">
<PAvatar
v-if="modelValue"
v-bind="modelValue.avatar"
:size="(pohon.leadingAvatarSize() as PAvatarProps['size'])"
:class="pohon.leadingAvatar()"
/>
</template>
</PInputMenu>
</template>
refDebounced to debounce the API calls.Use the filter-fields prop with an array of fields to filter on. Defaults to [labelKey].
<script setup lang="ts">
import type { PAvatarProps } from 'pohon-ui';
import { useFetch } from '#app';
const { data: users, status } = await useFetch('https://jsonplaceholder.typicode.com/users', {
key: 'typicode-users-email',
transform: (data: Array<{ id: number; name: string; email: string }>) => {
return data?.map((user) => ({
label: user.name,
email: user.email,
value: String(user.id),
avatar: { src: `https://i.pravatar.cc/120?img=${user.id}` },
}));
},
lazy: true,
});
</script>
<template>
<PInputMenu
:items="users"
:loading="status === 'pending'"
:filter-fields="['label', 'email']"
icon="i-lucide:user"
placeholder="Select user"
class="w-80"
>
<template #leading="{ modelValue, pohon }">
<PAvatar
v-if="modelValue"
v-bind="modelValue.avatar"
:size="(pohon.leadingAvatarSize() as PAvatarProps['size'])"
:class="pohon.leadingAvatar()"
/>
</template>
<template #item-label="{ item }">
{{ item.label }}
<span class="color-text-muted">
{{ item.email }}
</span>
</template>
</PInputMenu>
</template>
Use the virtualize prop to enable virtualization for large lists as a boolean or an object with options like { estimateSize: 32, overscan: 12 }.
When enabled, all groups are flattened into a single list due to a limitation of Akar.
<script setup lang="ts">
import type { PInputMenuItem } from 'pohon-ui'
const items: Array<PInputMenuItem> = Array(1000)
.fill(0)
.map((_, i) => ({
label: `item-${i}`,
value: i
}))
</script>
<template>
<PInputMenu virtualize :items="items" class="w-48" />
</template>
You can expand the content to the full width of its items by adding the min-w-fit class on the pohon.content slot.
<script setup lang="ts">
import { useFetch } from '#app';
const { data: users } = await useFetch('https://jsonplaceholder.typicode.com/users', {
key: 'typicode-users-email',
transform: (data: Array<{ id: number; name: string; email: string }>) => {
return data?.map((user) => ({
label: user.name,
email: user.email,
value: String(user.id),
avatar: { src: `https://i.pravatar.cc/120?img=${user.id}` },
}));
},
lazy: true,
});
</script>
<template>
<PInputMenu
:items="users"
icon="i-lucide:user"
placeholder="Select user"
:pohon="{ content: 'min-w-fit' }"
>
<template #item-label="{ item }">
{{ item.label }}
<span class="color-text-muted">
{{ item.email }}
</span>
</template>
</PInputMenu>
</template>
app.config.ts:export default defineAppConfig({
pohon: {
inputMenu: {
slots: {
content: 'min-w-fit'
}
}
}
})
This example demonstrates using the InputMenu as a country picker with lazy loading - countries are only fetched when the menu is opened.
<script setup lang="ts">
import { useLazyFetch } from '#app';
const { data: countries, status, execute } = await useLazyFetch<Array<{
name: string;
code: string;
emoji: string;
}>>('/api/countries.json', {
immediate: false,
});
function onOpen() {
if (!countries.value?.length) {
execute();
}
}
</script>
<template>
<PInputMenu
:items="countries"
:loading="status === 'pending'"
label-key="name"
:search-input="{ icon: 'i-lucide:search' }"
placeholder="Select country"
class="w-48"
@update:open="onOpen"
>
<template #leading="{ modelValue, pohon }">
<span
v-if="modelValue"
class="text-center size-5"
>
{{ modelValue?.emoji }}
</span>
<PIcon
v-else
name="i-lucide:earth"
:class="pohon.leadingIcon()"
/>
</template>
<template #item-leading="{ item }">
<span class="text-center size-5">
{{ item.emoji }}
</span>
</template>
</PInputMenu>
</template>
| Prop | Default | Type |
|---|
| Slot | Type |
|---|
| Event | Type |
|---|
When accessing the component via a template ref, you can use the following:
| Name | Type |
|---|---|
inputRef | Ref<HTMLInputElement | null> |
Below is the theme configuration skeleton for the PInputMenu. 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: {
inputMenu: {
slots: {
root: '',
base: '',
leading: '',
leadingIcon: '',
leadingAvatar: '',
leadingAvatarSize: '',
trailing: '',
trailingIcon: '',
arrow: '',
content: '',
viewport: '',
group: '',
empty: '',
label: '',
separator: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatar: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailing: '',
itemTrailingIcon: '',
itemWrapper: '',
itemLabel: '',
itemDescription: '',
tagsItem: '',
tagsItemText: '',
tagsItemDelete: '',
tagsItemDeleteIcon: '',
tagsInput: ''
},
variants: {
fieldGroup: {
horizontal: {
root: '',
base: ''
},
vertical: {
root: '',
base: ''
}
},
size: {
xs: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
sm: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
md: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
lg: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
xl: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
}
},
variant: {
outline: '',
soft: '',
subtle: '',
ghost: '',
none: ''
},
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
leading: {
true: ''
},
trailing: {
true: ''
},
loading: {
true: ''
},
highlight: {
true: ''
},
type: {
file: ''
},
virtualize: {
true: {
viewport: ''
},
false: {
viewport: ''
}
},
multiple: {
true: {
root: ''
},
false: {
base: ''
}
}
},
compoundVariants: [],
defaultVariants: {
size: 'md',
color: 'primary',
variant: 'outline'
}
}
}
};
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
inputMenu: {
slots: {
root: '',
base: '',
leading: '',
leadingIcon: '',
leadingAvatar: '',
leadingAvatarSize: '',
trailing: '',
trailingIcon: '',
arrow: '',
content: '',
viewport: '',
group: '',
empty: '',
label: '',
separator: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatar: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailing: '',
itemTrailingIcon: '',
itemWrapper: '',
itemLabel: '',
itemDescription: '',
tagsItem: '',
tagsItemText: '',
tagsItemDelete: '',
tagsItemDeleteIcon: '',
tagsInput: ''
},
variants: {
fieldGroup: {
horizontal: {
root: '',
base: ''
},
vertical: {
root: '',
base: ''
}
},
size: {
xs: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
sm: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
md: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
lg: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
},
xl: {
base: '',
leading: '',
trailing: '',
leadingIcon: '',
leadingAvatarSize: '',
trailingIcon: '',
label: '',
item: '',
itemLeadingIcon: '',
itemLeadingAvatarSize: '',
itemLeadingChip: '',
itemLeadingChipSize: '',
itemTrailingIcon: '',
tagsItem: '',
tagsItemDeleteIcon: '',
empty: ''
}
},
variant: {
outline: '',
soft: '',
subtle: '',
ghost: '',
none: ''
},
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
leading: {
true: ''
},
trailing: {
true: ''
},
loading: {
true: ''
},
highlight: {
true: ''
},
type: {
file: ''
},
virtualize: {
true: {
viewport: ''
},
false: {
viewport: ''
}
},
multiple: {
true: {
root: ''
},
false: {
base: ''
}
}
},
compoundVariants: [],
defaultVariants: {
size: 'md',
color: 'primary',
variant: 'outline'
}
}
}
};
With Pohon UI, you can achieve similar component functionality with less code and effort, as it comes with built-in styles mechanism and behaviors that are optimized for common use cases. Since it's using unocss-variants it adds a runtime cost, but it can be worth it if you prioritize development speed and ease of use over fine-grained control.
If this is a deal breaker for you, you can always stick to using Akar and build your own custom components on top of it.