JSONPathField
API reference and demos for JSONPathField.
Import
Section titled “Import”import { JSONPathField } from "@flanksource/clicky-ui/components";The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.
| Prop | Type | Default | Description |
|---|---|---|---|
as |
enum |
— | — |
evaluate |
(…) => Promise<JSONPathEvalResult> |
— | Enables the playground's live match preview. See JSONPathPlaygroundProps. |
getPath |
(…) => string |
— | — |
hotkey |
string |
— | Shortcut to bind, in `useHotkey` combo syntax (`"mod+k"`, `"mod+shift+p"`), where `mod` is ⌘ on macOS and Ctrl elsewhere. Preferred over `shortcutKey`: it matches modifiers exactly, whereas a key derived from the `shortcut` badge cannot express them. |
inputClassName |
string |
— | Classes applied to the native input. |
invalid |
boolean |
— | Marks the control as invalid: renders a destructive border and sets aria-invalid on the native element. Purely presentational — the consumer decides what invalid means, exactly as `Combobox`'s own `invalid` does. |
isSelectable |
(…) => boolean |
— | — |
json |
unknown |
— | — |
onChange* |
(…) => void |
— | — |
onSelectPath |
(…) => void |
— | Commits a picked path together with the column it must be rooted at, set when the path addresses a decoded JSON-encoded column. Consumers that own the whole column can write `source` alongside `jsonpath`; the default just calls `onChange`, leaving the pairing to whoever writes `source` by hand. |
onShortcut |
(…) => … |
— | Called before the field is focused when the shortcut is pressed. |
pickerLabel |
string |
— | — |
prefix |
ReactNode |
— | Leading adornment rendered before the input. |
rows |
unknown[] |
— | Every sampled row, for the playground's row switcher. Defaults to `json` alone — a field absent from the first row cannot be browsed otherwise. |
shortcut |
string | null |
— | Keyboard-shortcut hint rendered as a trailing `<kbd>`. Pass `null` to hide it. |
shortcutClassName |
string |
— | Classes applied to the shortcut badge. |
shortcutKey |
string |
— | Override the key matched for cmd/ctrl shortcuts. Defaults to the shortcut's last character. |
source |
string |
— | The column the current path is already rooted at — its saved `source`. The playground browses and evaluates from there, so a column that already pairs the two does not read as broken. |
type |
HTMLInputTypeAttribute |
— | Native input type. Ignored when `as="textarea"`. |
value* |
string |
— | — |