Sanity Library Reference Docs
    Preparing search index...

    Interface PortableTextInputProps

    Component props for the PortableTextInput React component.

    Extends ArrayOfObjectsInputProps.

    interface PortableTextInputProps {
        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

    changed: boolean

    Whether the node has changes in a draft.

    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.