Skip to content

Commit

Permalink
feat: add chapter avatar field ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
agoalofalife committed Aug 20, 2023
1 parent 0808a84 commit 7a7f306
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
]],
'List Fields' => [
'children' => [
'Avatar' => '/docs/fields/avatar',
'Audio' => "/docs/fields/audio",
'Image Zoom' => "/docs/fields/image_zoom",
'Range' => "/docs/fields/range",
Expand Down
Binary file added source/assets/fields/avatar/single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/fields/avatar/table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions source/docs/fields/avatar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Avatar
description: Avatar Orchid Extra Fields
extends: _layouts.documentation
section: content
locale: en
---

# Avatar {#Avatar}
A very simple Field to render a image and title under a picture.

For example, you can use it like this.

<img class="block m-auto" src="/assets/fields/avatar/single.png" alt="sinlge avatar" />

Even, You may use it in the table

<img class="block m-auto" src="/assets/fields/avatar/table.png" alt="avatar in table" />
## Example code

```php

use agoalofalife\Orchid\Fields\Range;

// value - url to source
// heightByPercent - size avatar by percents
// nameAvatar - text under a avatar like a "title"
// sizeTitle - size a title
// left or right or center - position avatar on layout

Avatar::make('test')
->value("https://avatars.githubusercontent.com/u/15719824?v=4")
->heightByPercent(6)
->nameAvatar('Ilia Chubarov')
->sizeTitle(5)
->left(),
```



0 comments on commit 7a7f306

Please sign in to comment.