Sanity Library Reference Docs
    Preparing search index...

    Interface ObjectItemProps<Item>

    Props for the ObjectItem component.

    interface ObjectItemProps<Item extends ObjectItem = ObjectItem> {
        changed: boolean;
        children: ReactNode;
        collapsed: boolean;
        collapsible: boolean;
        description: string;
        focused?: boolean;
        index: number;
        inputId: string;
        key: string;
        level: number;
        onBlur: (event: FocusEvent) => void;
        onClose: () => void;
        onCollapse: () => void;
        onExpand: () => void;
        onFocus: (event: FocusEvent) => void;
        onOpen: () => void;
        onRemove: () => void;
        open: boolean;
        parentSchemaType: ArraySchemaType;
        path: Path;
        readOnly?: boolean;
        renderDefault: (props: ItemProps) => Element;
        schemaType: ObjectSchemaType;
        title: string;
        validation: FormNodeValidation[];
        value: Item;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    changed: boolean

    Whether the item has changes in a draft.

    children: ReactNode

    The children of the item.

    collapsed: boolean

    Whether the item is collapsed.

    collapsible: boolean

    Whether the item is collapsible.

    description: string

    The description of the item.

    focused?: boolean

    Whether the item is focused.

    index: number

    The index of the item.

    inputId: string

    The ID of the input element.

    key: string

    The key of the item.

    level: number

    The level of the item.

    onBlur: (event: FocusEvent) => void

    The function to call when the item loses focus.

    onClose: () => void

    Callback for when the item is closed.

    onCollapse: () => void

    Callback for when the item is collapsed.

    onExpand: () => void

    Callback for when the item is expanded.

    onFocus: (event: FocusEvent) => void

    The function to call when the item receives focus.

    onOpen: () => void

    Callback for when the item is opened.

    onRemove: () => void

    The function to call when the item is removed.

    open: boolean

    Whether the item is open.

    parentSchemaType: ArraySchemaType

    The schema type of the parent array.

    path: Path

    The path of the item.

    readOnly?: boolean

    Whether the item is read-only.

    renderDefault: (props: ItemProps) => Element

    The function to call to render the default item. See ItemProps

    schemaType: ObjectSchemaType

    The schema type of the object.

    title: string

    The title of the item.

    validation: FormNodeValidation[]

    The validation markers for the item.

    value: Item

    The value of the item.