Skip to main content
On a user page (<username>.cskn.my/<slug>), the platform can draw the visitor’s own menu over your app. It belongs to the platform, not to your app:
  • signed in: an avatar button that opens the visitor’s apps as a grid, Marketplace, Studio, their own page, their followers and following, and Log out
  • signed out: a “Sign in” button
The menu is drawn in its own shadow DOM, so your CSS can’t break it and its CSS can’t leak into your app. Its code loads only when a page first shows it.
The menu is hidden by default. Nothing appears until your app asks for it.

Show it

With @cskn/ui, render <PlatformMenu />. It shows the menu while it is mounted and dresses it in your app’s theme. Without the UI kit, use the SDK:

Outside a user page

On your app page (<slug>.cskn.app), inside a shell, or on a dev server there is no menu. platformMenu.isAvailable() returns false and every call is a no-op, so you can call it unconditionally. On a user page opened inside a shell, a signed-out visitor sees nothing: signing in is the shell’s job.

Methods

boolean
Whether this page has the menu at all.
void
Merge options into the menu’s. items, sections, style and labels replace what you set before.
void
Same as configure({ visible: true | false }).
void
Open or close the panel. Opening needs the menu to be visible and the visitor to be signed in.
() => void
One of your items was chosen: fn({ id, item }). Returns the unsubscribe function.
() => void
The panel opened or closed. Returns the unsubscribe function.
PlatformMenuState
{ visible, open, placement, signedIn }.

Options

boolean
default:"false"
Show the menu.
'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'slot'
default:"'top-right'"
A corner of the viewport, or slot: inside an element of yours.
Element | string | null
For placement: 'slot', the element (or a selector for it) the button goes into, such as a spot in your header.
number
default:"16"
Distance from the viewport edges for a corner placement, in px.
number
Stacking order. The default is very high, so the menu sits above your app.
'auto' | 'light' | 'dark'
default:"'auto'"
auto follows the system.
number
default:"40"
The avatar button’s size, and the Sign in button’s height, in px.
'floating' | 'flat'
default:"'floating'"
floating has a shadow and an outlined Sign in button. flat has no shadow and a Sign in button filled with accent, for a menu that sits in a toolbar.
PlatformMenuStyle
Colors and shape. See below.
PlatformMenuSections
Which built-in parts show. All are on unless set to false: apps (the visitor’s identity and apps grid), marketplace, studio, profile (“My page”), follows, logout.
PlatformMenuItem[]
Your app’s own entries. See below.
Record<string, string>
Override any built-in string by key, such as signIn, myApps or logout. The menu is in English or Turkish, following <html lang>.

Style

Every key takes any CSS value. Unset keys keep the menu’s own light or dark palette.

Items

string
required
Passed to onSelect.
string
required
The text shown.
string
An emoji or other glyph, an image URL, or one of store, grid, user, users, logout, lock, search, link.
string / '_blank' | '_self'
Makes the item a link. Without href the item only fires onSelect and closes the menu.
'start' | 'end'
default:"'end'"
start puts the item above everything else. end puts it just before Log out.
boolean
Draw it in the danger color.

Behavior

  • Below 640 px the panel opens as a bottom sheet.
  • Escape closes the panel and returns focus to the avatar button. Arrow keys move between items.
  • Log out asks for confirmation first, with an option to end every session on the device.