KQ-1635 · PROSE/FILTER
Prose Filter
One search line that reads a sentence against a typed schema and turns it into field, operator and value chips docked above a results table. A phrase docks when you type the space after it: a ghost of its words rises a step and fades where they stood while the chip starts over them, scaled to their width, and flies to its slot on springs.snap with one crisp overshoot; results close up on springs.glide and arrive in a cascade. Words with more than one reading keep a dotted, dashed or wavy underline, Tab walks them and opens a listbox of meanings under the word, Enter docks the chosen one, and Backspace at the start of the line pulls the last chip back into editable text.
Invoices
Finished phrases become filters when you type a space. Tab walks words with more than one meaning, arrows choose a meaning and Enter sets it. Backspace at the start pulls the last filter back to edit. Enter applies.
0 invoices · 0 chips
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/prose-filter
Props
- schema
- ProseSchema
- default defaultProseSchema
- What the line can read: { noun: { one, other, words }, fields } with enum (options with words, optional lead words), money, date (lead words, primary) and code fields.
- rows
- ProseRow[]
- default defaultProseRows
- The records the chips filter: { id, ...fields }.
- defaultValue
- string
- default ""
- A sentence read on first render; its finished phrases dock straight away and doubtful words stay in the line.
- placeholder
- string
- default "Try: overdue invoices over 500 from Coldbrook"
- The empty line's hint.
- onQueryChange
- (query: ProseQuery) => void
- default —
- Fires with { noun, clauses, text, unsure } on first render and whenever a chip docks, leaves, is pulled back or the line changes.
- onApply
- (query: ProseQuery) => void
- default —
- Fires from Enter or the apply button, after finished phrases have docked.
- status
- "ready" | "loading" | "error"
- default "ready"
- Whether the results have arrived: loading shows skeleton rows, error a Try again.
- onRetry
- () => void
- default —
- Try again was pressed after the results failed to load.
- chipStyle
- "segment" | "soft" | "outline"
- default "segment"
- Chip look: field, operator and value in three tinted segments, one soft wash pill, or a hairline outline.
- underlineStyle
- "dotted" | "dashed" | "wavy"
- default "dotted"
- The underline under words with more than one reading.
- accent
- string
- default "var(--accent-bright)"
- Chips, underlines, read-phrase washes and the live count, any CSS colour.
- now
- number
- default defaultProseNow
- Today in ms, for last month, this week, the last N days and month names (always the most recent one).
- formatAmount
- (amount: number) => string
- default whole US dollars
- Formats amounts in chips and rows.
- maxRows
- number
- default 40
- The most rows the table lists; it scrolls inside its box.
- title
- string
- default "Invoices"
- The heading before the sentence names its noun; it takes the noun's name once it docks.
- height
- number
- default 520
- Height of the surface in px.
- disabled
- boolean
- default false
- The line and the chips are inert; the surface dims.
- className
- string
- default —
- Classes for the outer surface.
| Prop | Type | Default | Description |
|---|---|---|---|
| schema | ProseSchema | defaultProseSchema | What the line can read: { noun: { one, other, words }, fields } with enum (options with words, optional lead words), money, date (lead words, primary) and code fields. |
| rows | ProseRow[] | defaultProseRows | The records the chips filter: { id, ...fields }. |
| defaultValue | string | "" | A sentence read on first render; its finished phrases dock straight away and doubtful words stay in the line. |
| placeholder | string | "Try: overdue invoices over 500 from Coldbrook" | The empty line's hint. |
| onQueryChange | (query: ProseQuery) => void | — | Fires with { noun, clauses, text, unsure } on first render and whenever a chip docks, leaves, is pulled back or the line changes. |
| onApply | (query: ProseQuery) => void | — | Fires from Enter or the apply button, after finished phrases have docked. |
| status | "ready" | "loading" | "error" | "ready" | Whether the results have arrived: loading shows skeleton rows, error a Try again. |
| onRetry | () => void | — | Try again was pressed after the results failed to load. |
| chipStyle | "segment" | "soft" | "outline" | "segment" | Chip look: field, operator and value in three tinted segments, one soft wash pill, or a hairline outline. |
| underlineStyle | "dotted" | "dashed" | "wavy" | "dotted" | The underline under words with more than one reading. |
| accent | string | "var(--accent-bright)" | Chips, underlines, read-phrase washes and the live count, any CSS colour. |
| now | number | defaultProseNow | Today in ms, for last month, this week, the last N days and month names (always the most recent one). |
| formatAmount | (amount: number) => string | whole US dollars | Formats amounts in chips and rows. |
| maxRows | number | 40 | The most rows the table lists; it scrolls inside its box. |
| title | string | "Invoices" | The heading before the sentence names its noun; it takes the noun's name once it docks. |
| height | number | 520 | Height of the surface in px. |
| disabled | boolean | false | The line and the chips are inert; the surface dims. |
| className | string | — | Classes for the outer surface. |