Getting Started
import { Avatar } from '@ark-ui/react'
const Basic = () => (
<Avatar.Root>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/300" alt="avatar" />
</Avatar.Root>
)
import { Avatar } from '@ark-ui/solid'
const Basic = () => (
<Avatar.Root>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/300" alt="avatar" />
</Avatar.Root>
)
<script setup lang="ts">
import { Avatar } from '@ark-ui/vue'
</script>
<template>
<Avatar.Root>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/3000" alt="avatar" />
</Avatar.Root>
</template>
Handling Events
Avatar
allows you to listen for loading state changes.
import { Avatar } from '@ark-ui/react'
const Events = () => (
<Avatar.Root onLoadingStatusChange={(status) => console.log(status)}>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/3000" alt="avatar" />
</Avatar.Root>
)
import { Avatar } from '@ark-ui/solid'
const Events = () => (
<Avatar.Root onLoadingStatusChange={(status) => console.log(status)}>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/3000" alt="avatar" />
</Avatar.Root>
)
<script setup lang="ts">
import { Avatar } from '@ark-ui/vue'
</script>
<template>
<Avatar @loading-status-change="(status) => console.log(status)">
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/3000" alt="avatar" />
</Avatar>
</template>