feat(Badge): handle icon and avatar props (#2497)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Malik-Jouda
2024-11-05 20:34:40 +02:00
committed by GitHub
parent a97c511279
commit 2d52834529
9 changed files with 338 additions and 50 deletions

View File

@@ -68,6 +68,54 @@ slots:
---
::
### Icon
Use the `icon` prop to show an [Icon](/components/icon) inside the Badge.
::component-code
---
props:
icon: i-heroicons-rocket-launch
size: md
color: primary
variant: solid
slots:
default: Badge
---
::
Use the `leading` and `trailing` props to set the icon position or the `leading-icon` and `trailing-icon` props to set a different icon for each position.
::component-code
---
props:
trailingIcon: i-heroicons-arrow-right
size: md
slots:
default: Badge
---
::
### Avatar
Use the `avatar` prop to show an [Avatar](/components/avatar) inside the Badge.
::component-code
---
prettier: true
props:
avatar:
src: 'https://github.com/nuxt.png'
size: md
color: neutral
variant: outline
slots:
default: |
Badge
---
::
## Examples
### `class` prop