Skip to content

ExAvatar

SK
SK
html
<ExAvatar :size="48" :radius="48">
    <img src="image-url">
</ExAvatar>

<script setup lang="ts">
import { ref } from 'vue'

const size = ref(48) // string | number
const radius = ref(48) // string | number
</script>
html
<ExAvatar
    class="text-body bg-primary border-border hover:scale-105 hover:transition-all place-items-center grid shadow-lg"
    :size="48"
    :radius="48"
>
    <img
        :src="https://picsum.photos/id/135/48/48"
        class="rounded-inherit object-cover w-full h-full"
    >
</ExAvatar>
html
<ExAvatar
    class="text-body bg-primary border-border hover:scale-105 hover:transition-all place-items-center grid shadow-lg"
    :size="48"
    :radius="48"
>
    SK
</ExAvatar>
html
<div class="flex items-center">
    <ExAvatar
        class="text-body bg-primary border-border hover:scale-105 hover:transition-all place-items-center grid shadow-lg"
        :size="48"
        :radius="48"
    >
        <img
            :src="https://picsum.photos/id/157/48/48"
            class="rounded-inherit object-cover w-full h-full"
        >
    </ExAvatar>

    <ExAvatar
        class="text-primary bg-body border-border hover:scale-105 hover:transition-all place-items-center grid -ml-6 shadow-lg"
        :size="48"
        :radius="48"
    >
        SK
    </ExAvatar>

    <ExAvatar
        class="text-body bg-primary border-border hover:scale-105 hover:transition-all place-items-center grid -ml-6 shadow-lg"
        :size="48"
        :radius="48"
    >
        <img
            :src="https://picsum.photos/id/257/48/48"
            class="rounded-inherit object-cover w-full h-full"
        >
    </ExAvatar>
</div>

Interact

Props

as

TypeDefaultRequired
string componenttemplatefalse

Description: Sets the element type of ex-avatar. Any custom vue component can also be passed.


size

TypeDefaultRequired
string number48false

Description: Sets the width and height of ex-avatar. It also takes both width and height parameters.

Passing size="100 50" as a value will result in width: 100px and height: 50px. Values can also be percentages.


radius

TypeDefaultRequired
string number48false

Description: Sets the border radius for ex-avatar. It can also take 4 values mentioning individual corner radius of an element.

Passing size="20 30 40 50" as a value will result in border-radius: 20px 30px 40px 50px. Values can also be percentages.


tile

TypeDefaultRequired
booleanfalsefalse

Description: Removes border radius to the ex-avatar element, if set using radius prop.


width

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the width of ex-avatar. width takes precedence over size. Values can also be percentages.


height

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the height of ex-avatar. height takes precedence over size. Values can also be percentages.


minWidth

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the min-width of ex-avatar. Values can also be percentages.


minHeight

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the min-height of ex-avatar. Values can also be percentages.


maxWidth

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the max-width of ex-avatar. Values can also be percentages.


maxHeight

TypeDefaultRequired
string numberundefinedfalse

Description: Sets the max-height of ex-avatar. Values can also be percentages.

Slots

NameDescription
defaultThe default Vue slot

Released under the MIT License.