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
BundleBehavior | The mixin half of a Bundle: a Behavior whose slots are wired to the Bundle's Messages through its Declared placement. |
DismissLayer | Dismissable layers: Escape closes the topmost open layer unless a handler below it already took the key (defaultPrevented), a pointer press outside closes… |
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… |
FocusRecovery | FocusRecovery as a Behavior: marks an owner slot and the part slots whose focus it recovers, and attaches the foldkit-primitives/dom Mount to the owner. No… |
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… |
InlineEdit | Editing a value where it is shown, in an <input>: a title becomes a text field on Enter, F2 or a double click, Enter saves, Escape puts it back. The Model… |
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… |
Marquee | Marquee as a Behavior: a lasso over the container's marked descendants. No Bundle: the rectangle is for the view to draw in a Slot of its own, and the ids… |
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… |
Presence | Presence as a Behavior: draws a phase the Model already holds. A row that is leaving is inert for the whole exit, so it takes no click, Tab or focus and… |
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… |
Reorder | Moving an item to another place in a list or a tree, by keyboard and by pointer, as one Bundle. Space or Enter (or the grab chords) on an item picks it up,… |
Repeat | Repeat: a held stepper. Pressing steps once, and holding on steps again every intervalMs after delayMs, until the press ends or the parent says the bound is… |
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… |
SpatialNavigation | Arrow keys over freely placed items (a board, a canvas, a dashboard of cards), where there are no rows or columns: each arrow moves to the nearest item… |
SwipeActions | Swipe-to-reveal actions behind a row, with a way in that needs no pointer: which row side is open, what a release of a Swipe means (open, close, or run the… |
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… |