Skip to main content
On this pageWhat is Foldkit UI?

Foldkit UI

What is Foldkit UI?

Foldkit UI is a set of headless, accessible UI components built for Foldkit. Each component manages its own state through The Elm Architecture — with a Model, Message, update, and view — and integrates into your app via the Submodels pattern.

Components are renderless. You provide the markup and styling through a toView callback, and Foldkit UI provides the accessibility attributes, keyboard navigation, and state management. This means full control over how your UI looks while getting correct ARIA roles, focus management, and keyboard interaction for free.

Components

ComponentDescription
ButtonAccessible button with consistent ARIA attributes and data-attribute hooks for styling.
InputText input with ARIA label/description linking and data-attribute hooks.
TextareaMulti-line text input with ARIA label/description linking and data-attribute hooks.
CheckboxToggle with accessible labeling, keyboard support, indeterminate state, and optional form integration.
FieldsetGroups related form controls with a legend and description. Disabled state propagates to all children.
Radio GroupRadio options with roving tabindex, keyboard navigation, and per-option label/description linking.
SwitchOn/off toggle with accessible labeling, keyboard support, and optional form integration.
SelectNative select wrapper with ARIA label/description linking and data-attribute hooks.
ListboxCustom select dropdown with persistent selection, keyboard navigation, and typeahead search.
ComboboxAutocomplete input with filtering, keyboard navigation, and custom rendering.
DialogModal dialog using native <dialog> with focus trapping, backdrop, and scroll locking.
MenuDropdown menu with keyboard navigation, typeahead search, and aria-activedescendant focus.
PopoverFloating panel with arbitrary content and natural Tab navigation.
DisclosureShow/hide toggle for building collapsible sections like FAQs and accordions.
TabsTabbed interface with keyboard navigation, Home/End support, and wrapping.

Showcase

The UI Showcase example demonstrates every component with styled, interactive examples. It’s a good reference for how to wire up component state, handle Messages, and compose views.