Repository navigation
v0.7.0 — Compact account control: <power-strip variant="compact">
A compact variant of <power-strip>: one account control for your app's own header, instead of the corner strip.
<power-strip variant="compact"></power-strip>- Signed out: a "Log in" pill (person icon and words). With one provider it links straight to it; with several it opens the provider dialog. Hide its label with
::part(login-label)and it's a circle the size of the avatar, for narrow headers. - Signed in: a round avatar (picture or initials) opening an account menu with everything the full strip does: name and email, account switching, Account settings, Profile, Admin, Stop impersonating, Log out. Keyboard navigable, with focus returned to the avatar.
- Right on the first paint: the worker now writes
auth-state="signed-in|signed-out"onto the page's<power-strip>from the session, and the component remembers the last profile it showed, so the control appears in its final shape before/api/meanswers. - Themable: new
--ps-*tokens (control, menu, font, focus ring) and::partnames; your page's declarations win over the component's defaults. - JavaScript API for both variants:
state,account,ready, and apower-strip:changeevent.
Good to know
- Pages that carry
auth-stateare now sent withCache-Control: private(they differ per visitor):publicands-maxageare dropped;privateandno-storeare kept. - A compact control that's hidden doesn't call
/api/meuntil it's shown. - The full strip renders as before.
See the README's "Compact account control for your own header" and #115 for full detail.