Usage
No projects found
It looks like you haven't added any projects. Create one to get started.
Title
Use the title prop to set the title of the empty state.
No projects found
<template>
<B24Empty title="No projects found" />
</template>
Description
Use the description prop to set the description of the empty state.
No projects found
It looks like you haven't added any projects. Create one to get started.
<template>
<B24Empty
title="No projects found"
description="It looks like you haven't added any projects. Create one to get started."
/>
</template>
Icon
Use the icon prop to set the icon of the empty state.
No projects found
It looks like you haven't added any projects. Create one to get started.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Empty
:icon="RocketIcon"
title="No projects found"
description="It looks like you haven't added any projects. Create one to get started."
/>
</template>
Actions
Use the actions prop to add some Button actions to the empty state.
No projects found
It looks like you haven't added any projects. Create one to get started.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Empty
:icon="RocketIcon"
title="No projects found"
description="It looks like you haven't added any projects. Create one to get started."
:actions="{
'0': {
label: 'Create new',
color: 'air-primary'
},
'1': {
label: 'Refresh'
}
}"
/>
</template>
Color
Use the color prop to change the color of the empty state.
No notifications
You're all caught up. New notifications will appear here.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Empty
color="air-secondary-accent-2"
:icon="RocketIcon"
title="No notifications"
description="You're all caught up. New notifications will appear here."
:actions="{
'0': {
label: 'Refresh'
}
}"
/>
</template>
Inverted
Use the inverted prop to invert the color of the empty state.
Only available for
air-primary* colorsNo notifications
You're all caught up. New notifications will appear here.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Empty
inverted
color="air-primary"
:icon="RocketIcon"
title="No notifications"
description="You're all caught up. New notifications will appear here."
:actions="{
'0': {
label: 'Refresh'
}
}"
/>
</template>
Size
Use the size prop to change the size of the empty state.
No notifications
You're all caught up. New notifications will appear here.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Empty
size="xl"
:icon="RocketIcon"
title="No notifications"
description="You're all caught up. New notifications will appear here."
:actions="{
'0': {
label: 'Refresh'
}
}"
/>
</template>
Examples
With slots
Use the available slots to create a more complex empty state.
API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
empty: {
slots: {
root: 'relative flex flex-col items-center justify-center gap-4 rounded-lg p-4 sm:p-6 lg:p-8 min-w-0 bg-(--b24ui-background) ring ring-(--b24ui-border-color) ring-(length:--b24ui-border-width)',
header: 'flex flex-col items-center gap-2 max-w-[384px] text-center',
indicator: 'rounded-full text-(--b24ui-color) bg-(--b24ui-background-active) flex items-center justify-center mb-2',
icon: 'shrink-0',
title: 'text-(--b24ui-color) text-pretty font-(--ui-font-weight-medium)',
description: 'text-balance text-center text-(--b24ui-color)',
body: 'flex flex-col items-center gap-4 max-w-[384px]',
actions: 'flex flex-wrap justify-center gap-2 shrink-0',
footer: 'flex flex-col items-center gap-2 max-w-[384px]'
},
variants: {
size: {
xs: {
icon: 'size-[26px]',
title: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)',
description: 'text-(length:--ui-font-size-xs)'
},
sm: {
icon: 'size-[28px]',
title: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)',
description: 'text-(length:--ui-font-size-xs)'
},
md: {
icon: 'size-[38px]',
title: 'text-base',
description: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)'
},
lg: {
icon: 'size-[44px]',
title: 'text-base',
description: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)'
},
xl: {
icon: 'size-[56px]',
title: 'text-(length:--ui-font-size-xl)/(--ui-font-line-height-3xs)',
description: 'text-(length:--ui-font-size-lg)/(--ui-font-line-height-3xs)'
}
},
color: {
'air-primary': {
root: 'style-filled'
},
'air-primary-success': {
root: 'style-filled-success'
},
'air-primary-alert': {
root: 'style-filled-alert'
},
'air-primary-copilot': {
root: 'style-filled-copilot'
},
'air-primary-warning': {
root: 'style-filled-warning'
},
'air-secondary': {
root: 'style-tinted'
},
'air-secondary-alert': {
root: 'style-tinted-alert'
},
'air-secondary-accent': {
root: 'style-outline'
},
'air-secondary-accent-1': {
root: 'style-outline-accent-1'
},
'air-secondary-accent-2': {
root: 'style-outline-accent-2'
},
'air-tertiary': {
root: 'style-outline-no-accent'
}
},
inverted: {
true: '',
false: ''
}
},
compoundVariants: [
{
inverted: true,
color: 'air-primary',
class: {
root: 'style-filled-inverted'
}
}
],
defaultVariants: {
color: 'air-secondary-accent',
size: 'md',
inverted: false
}
}
}
})
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: {
empty: {
slots: {
root: 'relative flex flex-col items-center justify-center gap-4 rounded-lg p-4 sm:p-6 lg:p-8 min-w-0 bg-(--b24ui-background) ring ring-(--b24ui-border-color) ring-(length:--b24ui-border-width)',
header: 'flex flex-col items-center gap-2 max-w-[384px] text-center',
indicator: 'rounded-full text-(--b24ui-color) bg-(--b24ui-background-active) flex items-center justify-center mb-2',
icon: 'shrink-0',
title: 'text-(--b24ui-color) text-pretty font-(--ui-font-weight-medium)',
description: 'text-balance text-center text-(--b24ui-color)',
body: 'flex flex-col items-center gap-4 max-w-[384px]',
actions: 'flex flex-wrap justify-center gap-2 shrink-0',
footer: 'flex flex-col items-center gap-2 max-w-[384px]'
},
variants: {
size: {
xs: {
icon: 'size-[26px]',
title: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)',
description: 'text-(length:--ui-font-size-xs)'
},
sm: {
icon: 'size-[28px]',
title: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)',
description: 'text-(length:--ui-font-size-xs)'
},
md: {
icon: 'size-[38px]',
title: 'text-base',
description: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)'
},
lg: {
icon: 'size-[44px]',
title: 'text-base',
description: 'text-(length:--ui-font-size-sm)/(--ui-font-line-height-lg)'
},
xl: {
icon: 'size-[56px]',
title: 'text-(length:--ui-font-size-xl)/(--ui-font-line-height-3xs)',
description: 'text-(length:--ui-font-size-lg)/(--ui-font-line-height-3xs)'
}
},
color: {
'air-primary': {
root: 'style-filled'
},
'air-primary-success': {
root: 'style-filled-success'
},
'air-primary-alert': {
root: 'style-filled-alert'
},
'air-primary-copilot': {
root: 'style-filled-copilot'
},
'air-primary-warning': {
root: 'style-filled-warning'
},
'air-secondary': {
root: 'style-tinted'
},
'air-secondary-alert': {
root: 'style-tinted-alert'
},
'air-secondary-accent': {
root: 'style-outline'
},
'air-secondary-accent-1': {
root: 'style-outline-accent-1'
},
'air-secondary-accent-2': {
root: 'style-outline-accent-2'
},
'air-tertiary': {
root: 'style-outline-no-accent'
}
},
inverted: {
true: '',
false: ''
}
},
compoundVariants: [
{
inverted: true,
color: 'air-primary',
class: {
root: 'style-filled-inverted'
}
}
],
defaultVariants: {
color: 'air-secondary-accent',
size: 'md',
inverted: false
}
}
}
})
]
})