Usage
Name
Use the name prop to display a name for the user.
John Doe
{
"wait": "Loading client-side content..."
}Description
Use the description prop to display a description for the user.
John Doe
Software Engineer
{
"wait": "Loading client-side content..."
}Avatar
Use the avatar prop to display an Avatar component.
John Doe
Software Engineer
{
"wait": "Loading client-side content..."
}Chip
Use the chip prop to display a Chip component.
John Doe
Software Engineer
{
"wait": "Loading client-side content..."
}Size
Use the size prop to change the size of the user avatar and text.
John Doe
Software Engineer
{
"wait": "Loading client-side content..."
}Orientation
Use the orientation prop to change the orientation. Defaults to horizontal.
John Doe
Software Engineer
{
"wait": "Loading client-side content..."
}Link
You can pass any property from the <NuxtLink> component such as to, target, rel, etc.
The
NuxtLink component will inherit all other attributes you pass to the User component.API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
user: {
slots: {
root: 'relative group/user',
wrapper: '',
name: 'font-(--ui-font-weight-medium)',
description: 'text-(--b24ui-typography-description-color)',
avatar: 'shrink-0'
},
variants: {
orientation: {
horizontal: {
root: 'flex items-center'
},
vertical: {
root: 'flex flex-col'
}
},
to: {
true: {
name: 'text-(--b24ui-typography-label-color) peer-hover:text-(--ui-color-design-selection-content) transition-colors',
description: 'peer-hover:text-(--ui-color-design-selection-content) transition-colors',
avatar: 'transform transition-transform duration-200 group-hover/user:scale-115'
},
false: {
name: 'text-(--b24ui-typography-label-color)',
description: ''
}
},
size: {
'3xs': {
root: 'gap-1',
wrapper: 'flex items-center gap-1',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
'2xs': {
root: 'gap-1.5',
wrapper: 'flex items-center gap-1.5',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
xs: {
root: 'gap-1.5',
wrapper: 'flex items-center gap-1.5',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
sm: {
root: 'gap-2',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
md: {
root: 'gap-2',
name: 'text-(length:--ui-font-size-sm)',
description: 'text-(length:--ui-font-size-xs)'
},
lg: {
root: 'gap-2.5',
name: 'text-(length:--ui-font-size-sm)',
description: 'text-(length:--ui-font-size-sm)'
},
xl: {
root: 'gap-2.5',
name: 'text-(length:--ui-font-size-md)',
description: 'text-(length:--ui-font-size-sm)'
},
'2xl': {
root: 'gap-3',
name: 'text-(length:--ui-font-size-md)',
description: 'text-(length:--ui-font-size-md)'
},
'3xl': {
root: 'gap-3',
name: 'text-(length:--ui-font-size-lg)',
description: 'text-(length:--ui-font-size-md)'
}
}
},
defaultVariants: {
size: 'md'
}
}
}
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
user: {
slots: {
root: 'relative group/user',
wrapper: '',
name: 'font-(--ui-font-weight-medium)',
description: 'text-(--b24ui-typography-description-color)',
avatar: 'shrink-0'
},
variants: {
orientation: {
horizontal: {
root: 'flex items-center'
},
vertical: {
root: 'flex flex-col'
}
},
to: {
true: {
name: 'text-(--b24ui-typography-label-color) peer-hover:text-(--ui-color-design-selection-content) transition-colors',
description: 'peer-hover:text-(--ui-color-design-selection-content) transition-colors',
avatar: 'transform transition-transform duration-200 group-hover/user:scale-115'
},
false: {
name: 'text-(--b24ui-typography-label-color)',
description: ''
}
},
size: {
'3xs': {
root: 'gap-1',
wrapper: 'flex items-center gap-1',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
'2xs': {
root: 'gap-1.5',
wrapper: 'flex items-center gap-1.5',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
xs: {
root: 'gap-1.5',
wrapper: 'flex items-center gap-1.5',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
sm: {
root: 'gap-2',
name: 'text-(length:--ui-font-size-xs)',
description: 'text-(length:--ui-font-size-xs)'
},
md: {
root: 'gap-2',
name: 'text-(length:--ui-font-size-sm)',
description: 'text-(length:--ui-font-size-xs)'
},
lg: {
root: 'gap-2.5',
name: 'text-(length:--ui-font-size-sm)',
description: 'text-(length:--ui-font-size-sm)'
},
xl: {
root: 'gap-2.5',
name: 'text-(length:--ui-font-size-md)',
description: 'text-(length:--ui-font-size-sm)'
},
'2xl': {
root: 'gap-3',
name: 'text-(length:--ui-font-size-md)',
description: 'text-(length:--ui-font-size-md)'
},
'3xl': {
root: 'gap-3',
name: 'text-(length:--ui-font-size-lg)',
description: 'text-(length:--ui-font-size-md)'
}
}
},
defaultVariants: {
size: 'md'
}
}
}
})
]
})