Primitives / API
foldkit-primitives/media
Functions
breakpointFor | The breakpoint a width falls in: the name with the largest threshold at or below it, or null below every threshold. Breakpoints uses it; a view that has a… |
isBrowser | Whether a window exists: the client side of an SSR split. |
isServer | Whether no window exists: the server side of an SSR split. |
platformFromUA | The platform a user-agent string names, preferring Client Hints when given (navigator.userAgentData.platform), with touch points telling a desktop-mode iPad… |
Values
Breakpoints | Named breakpoints over the viewport width: one resize listener, derived names in update. Thresholds are mobile-first min-widths: the breakpoint is the… |
BreakpointsMessage | |
BreakpointsModel | |
MediaQuery | A media query as a bundle: matches in the Model, kept current by a matchMedia change stream. State stays in the parent Model, so it replays and time-travels… |
MediaQueryMessage | |
MediaQueryModel | |
Platform | Platform detection as pure functions. platformFromUA reads a user-agent string (passed in, so tests pin it without stubbing globals); order matters —… |
PrefersDark | (prefers-color-scheme: dark), bound so placements give no args. |
PrefersReducedMotion | (prefers-reduced-motion: reduce), bound so placements give no args. |
Interfaces
PlatformHints | Client Hints (navigator.userAgentData) plus touch points (navigator.maxTouchPoints), passed in so detection stays pure and pinned. Only platform and… |