Sanity Library Reference Docs
    Preparing search index...

    Interface NumberInputProps<S>

    interface NumberInputProps<S extends NumberSchemaType = NumberSchemaType> {
        __unstable_computeDiff: ComputeDiff<ProvenanceDiffAnnotation>;
        changed: boolean;
        compareValue?: number;
        displayInlineChanges: boolean;
        elementProps: PrimitiveInputElementProps;
        focused?: boolean;
        hasUpstreamVersion: boolean;
        id: string;
        level: number;
        onChange: (patch: PatchEvent | FormPatch | FormPatch[]) => void;
        path: Path;
        presence: FormNodePresence[];
        readOnly?: boolean;
        renderDefault: (props: InputProps) => Element;
        schemaType: S;
        validation: FormNodeValidation[];
        validationError?: string;
        value: number;
    }

    Type Parameters

    Hierarchy (View Summary)

    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.

    compareValue?: number

    The value the node is currently being compared to. This is taken from the upstream version, if the document has an upstream version. Otherwise, it's taken from the document's current value.

    You can use the hasUpstreamVersion prop to determine whether the document has an upstream version.

    displayInlineChanges: boolean

    Whether the input should display inline changes. Inline changes express how a field's value differs from its upstream version. Unlike custom diff components, inline changes is a mode that allows the input component itself to display the change in situ.

    focused?: boolean

    Whether the node is focused.

    hasUpstreamVersion: boolean

    Whether the document has an upstream version.

    id: string

    The unique identifier of the node.

    level: number

    The level of the node in the form hierarchy.

    onChange: (patch: PatchEvent | FormPatch | FormPatch[]) => void
    path: Path

    The path of the node in the form hierarchy.

    presence: FormNodePresence[]
    readOnly?: boolean

    Whether the node is read-only.

    renderDefault: (props: InputProps) => Element
    schemaType: S

    The schema type of the node.

    validation: FormNodeValidation[]

    The validation markers of the node.

    validationError?: string
    value: number

    The value of the node.