Primitives / API
foldkit-primitives/interaction
Interaction primitives: a Bundle (or a Mount) for the state, a matching
foldkit-mixins Behavior to wire it to a view's slots. Importing this
subpath needs foldkit-mixins; the others do not.
Namespaces
DismissLayer | Dismissable layers: Escape closes the topmost open layer, a pointer press outside closes the layers it is outside of. One Bundle, placed once, owns the… |
EditableText | EditableText as a Behavior: attaches the foldkit-primitives/dom Mount to a container slot and maps what it reports into the view's Messages. No Bundle: the… |
FocusScope | FocusScope as a Behavior: attaches the foldkit-primitives/dom Mount to a container slot. No Bundle, because which element has focus is a DOM fact. |
FocusVisible | FocusVisible as a Behavior over a placed InputModality: the target gets data-focus-visible while the page is being driven by keyboard, so a stylesheet can… |
GridNavigation | Two-dimensional arrow keys over a set of items laid out in rows of columns (a calendar grid, a color swatch picker, an emoji palette). The Model slice is… |
Layers | ScrollLock and HideOutside as Behaviors: each attaches its foldkit-primitives/dom Mount to a container slot. No Bundle, because the lock and the inert set… |
ListNavigation | Keyboard navigation of a list in one placement: a roving tab stop, type to find, and PageUp and PageDown. One Bundle holds the current item's id and the… |
LiveAnnounce | Announcements for assistive technology: one Bundle, placed once, holds the text of a polite and an assertive live region. An announcement waits debounceMs… |
LongPress | LongPress: holding an element down for thresholdMs is one fact. It reads the same facts Press.events reports; the threshold is a Command on Effect's clock… |
Move | Move as a Behavior: attaches the foldkit-primitives/dom Mount to a draggable slot and maps its facts into the view's Messages. No Bundle: a drag's meaning… |
Overlay | One overlay policy value instead of nine subtly different overlay implementations. modal and nonModal cover the two shapes; anything else is an explicit… |
Placing | Keeps a floating panel inside the viewport: on insert it shifts left past the right edge and flips above its trigger when the bottom overflows and the room… |
PointerDrag | PointerDrag as a Behavior: attaches the foldkit-primitives/dom Mount to a container slot and maps what it reports into the view's Messages. No Bundle: what… |
Press | Press: pointer and keyboard activation of one element as one fact. A Mount reports what the element saw (pointer down, up, cancel, key down, up, click) with… |
RovingTabindex | One tab stop for a set of items (a toolbar, a tab list, a listbox): arrows move focus between them, the rest stay out of the tab order. The current item's… |
Selection | Selection over a set of items: which ids are selected, and the anchor a range extends from. mode is 'single' (a click replaces), 'multiple' (a click… |
Targets | Targets as a Behavior: attaches the foldkit-primitives/dom Mount to a container slot and maps what it reports into the view's Messages. No Bundle: which… |
TreeNavigation | Keyboard navigation of a tree (a file explorer, a page's layers, a nested menu), after the WAI-ARIA tree pattern: one tab stop, Up and Down through the rows… |
Typeahead | Typeahead over a set of items: printable keys build a query that a timer clears, and the query picks the item to move to. The query lives in the Model so a… |