PillInput

PillInput component - a CodeMirror-based input that converts expressions to visual pills. Supports drag/drop, formatting, and contextual value selection. Uses CodeMirror 6 with React 18 compatibility.

Installation

import { PillInput } from 'uxp/components';

Signature

const PillInput: React.ForwardRefExoticComponent<React.RefAttributes<any> & any>

Examples

Basic usage with field options
```tsx
<PillInput
  value="Hello {user.name}!"
  onChange={setValue}
  contextDataSections={[
    { label: "User", fields: [{ label: "Name", value: "user.name" }] }
  ]}
/>
With custom pill configuration
```tsx
<PillInput
  value="{field.date|number|2}"
  onChange={setValue}
  contextDataSections={sections}
  pillConfiguration={{
    field: {
      valueIndex: 1,
      icon: "fas calendar",
      backgroundColor: "#007bff",
      textColor: "#fff"
    }
  }}
/>

Last updated