API Reference Flicker v#0.1.0

Copy Markdown View Source

Modules

Flicker is an Ash-native searchable select / combobox / faceted-search library for Phoenix LiveView.

An optional AshPhoenix.Form adapter for form-field mode (ADR-005).

Turning an invalid facet value into an offer to fix it (Spec 023).

The cursor-context state machine (Spec 003) — a pure function that, given typed input, a cursor position, and the active facet registry, says what the user is typing right now: a facet key, a facet value, or free text. The dropdown reads this to pick its result source (key suggestions, a facet's value picklist / nested search, or plain free-text handling) and its keyboard behaviour, without needing a browser to test any of it.

Dispatch-policy decisions (Spec 020) — when a component should actually run a query, and what to render while it isn't.

A facet definition for faceted search (Spec 003).

Value casting and validation for facets (Spec 018).

Display formatting for facet values (Spec 018) — the one module allowed to call Localize.*.

A semantic date preset — last-30-days, this-quarter, all-time (Spec 018).

The cast value of every range-typed facet (Spec 018) — created:2026-06-01..2026-06-30, price:10..50, created:last-30-days.

The contract every rich facet editor implements (Spec 019).

The date and date-range editor (Spec 019): a presets rail beside one or two month grids, with a footer carrying the draft state.

The numeric and duration editor (Spec 019): a dual-thumb slider when the facet is bounded, paired numeric inputs either way.

The editor for a facet whose values come from a set — an :enum's closed picklist, or a relationship's related records (Spec 019).

The boolean editor (Spec 019) — and the one editor with no pop-out.

Shared facet-suggestion machinery (Spec 003) — the pure functions both Flicker.search/1 and the facets attr on Flicker.select/1 call to turn a Flicker.CursorContext classification into a suggestion list, and to splice a chosen suggestion back into the typed text.

The optional Level 2 adapter from Spec 009: removes the Flicker.search/1 + Cinder.collection/1 boilerplate Level 1 leaves to the host, and coordinates URL state between the two libraries.

Server-side chord parsing/validation for activate_with_keyboard (Spec 006).

The behaviour every user-facing Flicker string routes through (ADR-009).

The complete default Flicker.Messages implementation, and the canonical list of every message key the select component uses.

The behaviour every Flicker data source implements.

The built-in Flicker.Provider that Tier 1 declarative component config compiles to (ADR-001) — searching and fetching directly off an Ash resource, with no provider module of your own to write.

A Flicker.Provider that derives navigable destinations from a host's own Phoenix.Router (Spec 011).

A small in-memory Flicker.Provider backed by a fixed list of results.

A search request passed to Flicker.Provider.search/2, and the result of parsing faceted-search input (Spec 003).

A facet token whose key and operator were both recognised but whose value would not cast (ADR-012).

Recently-used facet values, ranked by frecency (Spec 022).

A dev/test-only in-memory Flicker.RecentValues store (Spec 022).

A single searchable/selectable option, as returned by a Flicker.Provider.

A PhoenixTest helper for driving Flicker.select/1 the way a user would: open the picker, type to filter, pick a result.

A class-per-part theme map for the select component (ADR-002).

The facet-entry trigger character (Spec 024) — parsing and validating the facet_trigger attr, and answering "does this token open the facet menu, and for which facets".

Mix Tasks

Installs Flicker into a Phoenix app.