Author
A reusable component for listing authors or contributors, showing their avatar, name, and role with support for flexible layout variations.
Component
Props
| Props | Default | Type |
|---|---|---|
name | 'John Doe' | string |
role | — | string |
imgUrl | — | string |
layoutOrientation | Orientation.HORIZONTAL | Orientation |
detailsOrientation | Orientation.VERTICAL | Orientation |
shape | AvatarShape.CIRCLE | AvatarShape |
size | AvatarSize.SM | AvatarSizeAllowed sizes: XS, SM, MD |
name
Sets the name (or full name) for the author. Additionally, it is used by the author's avatar to set the initials, in case the are required if no imgUrl is set.
<template>
<Author name="John Doe" />
</template>
role
Sets the role for the author. It is used to display the role in the author's details.
<template>
<Author role="Frontend Developer" />
</template>
imgUrl
The imgUrl prop sets the image source for the author's avatar. If the URL is not provided, invalid or the image fails to load, a fallback (initials) is shown.
<template>
<Author imgUrl="https://exampleweb.com/image/20" />
</template>
layoutOrientation
The layoutOrientation prop defines the main layout orientation of the author's information and avatar. It uses the Orientation enum.
<template>
<Author :layoutOrientation="Orientation.HORIZONTAL" />
</template>
Options
| Value | Description |
|---|---|
Orientation.HORIZONTAL | horizontal |
Orientation.VERTICAL | vertical |
detailsOrientation
Defines the author details layout orientation. It uses the Orientation enum.
<template>
<Author :detailsOrientation="Orientation.VERTICAL" />
</template>
Options
| Value | Description |
|---|---|
Orientation.HORIZONTAL | horizontal |
Orientation.VERTICAL | vertical |
shape
The shape prop defines the author's avatar container shape. It uses the AvatarShape enum.
<template>
<Author :shape="AvatarShape.CIRCLE" />
</template>
Options
| Value | Description |
|---|---|
CIRCLE | Circular shape |
SQUARE | Square shape |
size
The size prop determines the overall dimensions of the user's avatar. It uses the AvatarSize enum.
Allowed sizes: XS, SM, MD
<template>
<Author :size="AvatarSize.SM" />
</template>
Options
| Value | Description |
|---|---|
XS | X-small size |
SM | Small size |
MD | Medium size |