Sanity Library Reference Docs
    Preparing search index...

    Interface PortableTextInputProps

    Component props for the PortableTextInput React component.

    Extends ArrayOfObjectsInputProps.

    interface PortableTextInputProps {
        __unstable_computeDiff: ComputeDiff<ProvenanceDiffAnnotation>;
        changed: boolean;
        editorRef?: MutableRefObject<PortableTextEditor>;
        focused?: boolean;
        focusPath: Path;
        hideToolbar?: boolean;
        hotkeys?: HotkeyOptions;
        id: string;
        initialActive?: boolean;
        initialFullscreen?: boolean;
        level: number;
        markers?: PortableTextMarker[];
        onCopy?: OnCopyFn;
        onEditorChange?: (change: EditorChange, editor: PortableTextEditor) => void;
        onPaste?: OnPasteFn;
        path: Path;
        rangeDecorations?: RangeDecoration[];
        readOnly?: boolean;
        renderBlockActions?: RenderBlockActionsCallback;
        renderCustomMarkers?: RenderCustomMarkers;
        schemaType: ArraySchemaType;
        validation: FormNodeValidation[];
        value: PortableTextBlock[];
    }
    Index

    Properties

    __unstable_computeDiff: ComputeDiff<ProvenanceDiffAnnotation>

    A function that takes any value and produces a diff between that value and the value the node is being compared to.

    This can be used to compute a diff optimistically.

    This is marked as unstable because the API may need to evolve as we iterate on the advanced version control functionality. It will be stabilised when that project has matured.

    changed: boolean

    Whether the current value is different to the value the node is being compared to.

    editorRef?: MutableRefObject<PortableTextEditor>

    A React Ref that can reference the underlying editor instance

    focused?: boolean

    Whether the node is focused.

    focusPath: Path

    The focus path of the form node.

    hideToolbar?: boolean

    Option to hide the default toolbar

    hotkeys?: HotkeyOptions

    Assign hotkeys that can be attached to custom editing functions

    id: string

    The unique identifier of the node.

    initialActive?: boolean

    Whether the input is activated and should receive events on mount. By default, this value is set to true

    initialFullscreen?: boolean

    Whether the input is initially open in fullscreen mode

    level: number

    The level of the node in the form hierarchy.

    markers?: PortableTextMarker[]

    Array of PortableTextMarker with meta data connected to the content.

    will be removed in the next major version of Sanity Studio. Use the renderBlock interface instead.

    onCopy?: OnCopyFn

    Custom copy function

    onEditorChange?: (change: EditorChange, editor: PortableTextEditor) => void

    Returns changes from the underlying editor

    onPaste?: OnPasteFn

    Custom paste function

    path: Path

    The path of the node in the form hierarchy.

    rangeDecorations?: RangeDecoration[]

    Array of RangeDecoration that can be used to decorate the content.

    readOnly?: boolean

    Whether the node is read-only.

    renderBlockActions?: RenderBlockActionsCallback

    Function to render custom block actions

    will be removed in the next major version of Sanity Studio. Use the renderBlock interface instead.

    renderCustomMarkers?: RenderCustomMarkers

    Function to render custom markers

    will be removed in the next major version of Sanity Studio. Use the renderBlock interface instead.

    schemaType: ArraySchemaType

    The schema type of the node.

    validation: FormNodeValidation[]

    The validation markers of the node.

    The value of the node.