npm i webui.dev
not published yet
Point atTouch a button in the toolbar
Launch the new beta on Friday, with the team in the loop.
Cursor
interest invokers
A hint for whatever you point at or focus. One attribute ties the button to it.
<div focusgroup="toolbar"><button interestfor="bold">…</button></div><hint-popover id="bold">Bold</hint-popover>
<hint-popover> 8.8 kB gzip
Press New reminder
Cursor
commands, morph
The button grows into its panel. No script calls it: the button names what it opens.
<button commandfor="new"command="toggle-popover">New reminder</button><pop-over id="new" popover morph>…</pop-over>
<pop-over> 4.0 kB gzip
Press and hold a message, or right-click it
Touch
context menu, long press
Hold a message for its menu, with the message lifted above the page. Right-click and Shift+F10 open it too.
<ol id="thread">…</ol><context-menu for="thread" popover><div data-part="preview"></div><button value="like">Like</button></context-menu>
<context-menu> 13 kB gzip
Drag a card by its handle
Touch
reorder, form value
Drag by the handle, or focus it and use Space and the arrow keys. The order goes with the form.
<sortable-list name="priority"><ol><li data-value="search">…</li></ol></sortable-list>
<sortable-list> 43 kB gzip
Swipe a row. With a mouse, drag it sideways
Swipe
row actions, scroll snap
Swipe a row to its actions, or all the way to run one. It is the browser's own scrolling, so trackpads and mice work too.
<swipe-actions><div slot="leading">…</div><a href="…">Maya Chen</a><div slot="trailing">…</div></swipe-actions>
<swipe-actions> 6.0 kB gzip
Open an album
Swipe
view transitions, swipe back
An album zooms open into its photos. Swipe from the left edge, or press Albums, to go back.
<view-stack id="albums"><button commandfor="albums" command="--push"data-view="coast" data-transition="zoom"></view-stack>
<view-stack> 6.7 kB gzip
Slide and scroll
scroll snap, commands
Photos snap to the middle and shrink as they leave it. The arrows are plain buttons that name the carousel.
<scroll-carousel id="shots" loopdata-effect="scale">…</scroll-carousel><button commandfor="shots" command="--next">
<scroll-carousel> 6.7 kB gzip
Scroll the feed
Slide and scroll
scroll-driven animations
Each post rises or grows in as it scrolls into view, on the browser's scroll timeline.
<scroll-scene range="entry 0% cover 35%"><article data-scene="rise">…</article></scroll-scene>
<scroll-scene> 4.0 kB gzip