Components Components
Avatar
Components avatar
A circular avatar image.
Markup
Drops in as data-pb-block="avatar".
html
<img data-pb-block="avatar" class="pb-avatar" src="https://placehold.co/96x96/6366f1/ffffff?text=A" alt="Avatar" width="64" height="64" style="width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid var(--pb-border,#e2e8f0);">Settings
Interactive behaviour is built in; on top of that every block supports:
- Bind to State
- Drive content reactively from a State with declarative Alpine —
x-text,x-showorx-modelover$store.app.<stateKey>. - On event → run a Flow
- Wire an interaction to a Flow: set
data-pb-flow="<slug>"anddata-pb-flow-event="click|submit|hover|change|…". The flow's returned actions update the page. - Link to a page
- Navigate to another published page on click with
data-pb-page="<slug>". - Styles & classes
- Edit spacing, colour and layout visually in the GrapesJS editor. The wrapper carries
data-pb-block="avatar"so it imports as a labelled, editable component. - Interactive out of the box
- Ships with Alpine state baked in (
x-data,@click,x-show,x-transition) — open/close, tabs and toggles work with no wiring. These owner-authored blocks are trusted and keep their executable directives.