Components Components
Rating
Components rating
A star rating display.
Markup
Drops in as data-pb-block="rating".
html
<div data-pb-block="rating" class="pb-rating" role="img" aria-label="Rated 4 out of 5" style="font-size:1.25rem;letter-spacing:2px;color:var(--pb-accent,#f59e0b);">★★★★<span style="color:#cbd5e1;">★</span></div>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="rating"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.