Skip to content

MarkedInputProps

Defined in: packages/markput/src/components/MarkedInput.tsx:38

Props for MarkedInput component with hierarchical type support.

Type parameters:

  • TMarkProps - Type of props for the global Mark component (default: MarkProps)
  • TOverlayProps - Type of props for the global Overlay component (default: OverlayProps)

The global Mark and Overlay components serve as defaults when options don’t specify their own slot components. Each option can override these with option.slots.

Default types:

  • TMarkProps = MarkProps: Type-safe base props (value, meta, nested, children)
  • TOverlayProps = OverlayProps: Type-safe overlay props (trigger, data)
// Using global Mark component with custom props type
interface ButtonProps { label: string; onClick: () => void }
<MarkedInput<ButtonProps>
Mark={Button}
options={[{
markup: '@[__value__]',
slotProps: { mark: { label: 'Click me', onClick: () => {} } }
}]}
/>
  • CoreMarkputProps
Type ParameterDefault type
TMarkPropsMarkProps
TOverlayPropsOverlayProps
optional className: string;

Defined in: packages/markput/src/components/MarkedInput.tsx:53

Additional classes


optional defaultValue: string;

Defined in: packages/core/src/shared/types.ts:46

Default value

CoreMarkputProps.defaultValue

optional Mark: ComponentType<TMarkProps>;

Defined in: packages/markput/src/components/MarkedInput.tsx:42

Global component used for rendering markups (fallback for option.slots.mark)


optional onChange: (value) => void;

Defined in: packages/core/src/shared/types.ts:48

Change event handler

ParameterType
valuestring

void

CoreMarkputProps.onChange

optional options: Option<TMarkProps, TOverlayProps>[];

Defined in: packages/markput/src/components/MarkedInput.tsx:51

Configuration options for markups and overlays. Each option can specify its own slot components and props via option.slots and option.slotProps. Falls back to global Mark/Overlay components when not specified.

[{overlayTrigger: '@', markup: '@[__label__](__value__)', data: []}]
CoreMarkputProps.options

optional Overlay: ComponentType<TOverlayProps>;

Defined in: packages/markput/src/components/MarkedInput.tsx:44

Global component used for rendering overlays like suggestions, mentions, etc (fallback for option.slots.overlay)


optional readOnly: boolean;

Defined in: packages/core/src/shared/types.ts:50

Prevents from changing the value

CoreMarkputProps.readOnly

optional ref: ForwardedRef<MarkedInputHandler>;

Defined in: packages/markput/src/components/MarkedInput.tsx:40

Ref to handler


optional showOverlayOn: OverlayTrigger;

Defined in: packages/markput/src/components/MarkedInput.tsx:72

Events that trigger overlay display

'change'
CoreMarkputProps.showOverlayOn

optional slotProps: SlotProps;

Defined in: packages/markput/src/components/MarkedInput.tsx:67

Props to pass to slot components

slotProps={{ container: { onKeyDown: handler }, span: { className: 'custom' } }}

optional slots: Slots;

Defined in: packages/markput/src/components/MarkedInput.tsx:61

Override internal components using slots

slots={{ container: 'div', span: 'span' }}

optional style: CSSProperties;

Defined in: packages/markput/src/components/MarkedInput.tsx:55

Additional style


optional value: string;

Defined in: packages/core/src/shared/types.ts:44

Annotated text with markups for mark

CoreMarkputProps.value