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)
Example
Section titled “Example”// Using global Mark component with custom props typeinterface ButtonProps { label: string; onClick: () => void }<MarkedInput<ButtonProps> Mark={Button} options={[{ markup: '@[__value__]', slotProps: { mark: { label: 'Click me', onClick: () => {} } } }]}/>Extends
Section titled “Extends”CoreMarkputProps
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TMarkProps | MarkProps |
TOverlayProps | OverlayProps |
Properties
Section titled “Properties”className?
Section titled “className?”optional className: string;Defined in: packages/markput/src/components/MarkedInput.tsx:53
Additional classes
defaultValue?
Section titled “defaultValue?”optional defaultValue: string;Defined in: packages/core/src/shared/types.ts:46
Default value
Inherited from
Section titled “Inherited from”CoreMarkputProps.defaultValueoptional Mark: ComponentType<TMarkProps>;Defined in: packages/markput/src/components/MarkedInput.tsx:42
Global component used for rendering markups (fallback for option.slots.mark)
onChange()?
Section titled “onChange()?”optional onChange: (value) => void;Defined in: packages/core/src/shared/types.ts:48
Change event handler
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value | string |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”CoreMarkputProps.onChangeoptions?
Section titled “options?”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.
Default
Section titled “Default”[{overlayTrigger: '@', markup: '@[__label__](__value__)', data: []}]Overrides
Section titled “Overrides”CoreMarkputProps.optionsOverlay?
Section titled “Overlay?”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)
readOnly?
Section titled “readOnly?”optional readOnly: boolean;Defined in: packages/core/src/shared/types.ts:50
Prevents from changing the value
Inherited from
Section titled “Inherited from”CoreMarkputProps.readOnlyoptional ref: ForwardedRef<MarkedInputHandler>;Defined in: packages/markput/src/components/MarkedInput.tsx:40
Ref to handler
showOverlayOn?
Section titled “showOverlayOn?”optional showOverlayOn: OverlayTrigger;Defined in: packages/markput/src/components/MarkedInput.tsx:72
Events that trigger overlay display
Default
Section titled “Default”'change'Overrides
Section titled “Overrides”CoreMarkputProps.showOverlayOnslotProps?
Section titled “slotProps?”optional slotProps: SlotProps;Defined in: packages/markput/src/components/MarkedInput.tsx:67
Props to pass to slot components
Example
Section titled “Example”slotProps={{ container: { onKeyDown: handler }, span: { className: 'custom' } }}slots?
Section titled “slots?”optional slots: Slots;Defined in: packages/markput/src/components/MarkedInput.tsx:61
Override internal components using slots
Example
Section titled “Example”slots={{ container: 'div', span: 'span' }}style?
Section titled “style?”optional style: CSSProperties;Defined in: packages/markput/src/components/MarkedInput.tsx:55
Additional style
value?
Section titled “value?”optional value: string;Defined in: packages/core/src/shared/types.ts:44
Annotated text with markups for mark
Inherited from
Section titled “Inherited from”CoreMarkputProps.value