Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface InjectProps<V>

Type parameters

Hierarchy

  • InjectProps

Index

Properties

Properties

Optional inject

inject: { props?: { classNames?: AnyObject; defaultNodeValue?: any; nodeKey?: string; styleKey?: keyof CSSProperties; transformClassName?: (options: TransformOptions<V>) => any; transformNodeValue?: (options: TransformOptions<V>) => any; transformStyle?: (options: TransformOptions<V>) => CSSProperties; validNodeValues?: any[]; validTypes?: string[] } }

Type declaration

  • Optional props?: { classNames?: AnyObject; defaultNodeValue?: any; nodeKey?: string; styleKey?: keyof CSSProperties; transformClassName?: (options: TransformOptions<V>) => any; transformNodeValue?: (options: TransformOptions<V>) => any; transformStyle?: (options: TransformOptions<V>) => CSSProperties; validNodeValues?: any[]; validTypes?: string[] }

    Properties used by Plate to inject props into any node component.

    • Optional classNames?: AnyObject

      Object whose keys are node values and values are classNames which will be extended.

    • Optional defaultNodeValue?: any

      Default node value. The node key would be unset if the node value = defaultNodeValue.

    • Optional nodeKey?: string

      Node key to map to the styles.

    • Optional styleKey?: keyof CSSProperties

      Style key to override.

      default

      nodeKey

    • Optional transformClassName?: (options: TransformOptions<V>) => any

      Transform the className.

      default

      clsx(className, classNames[value])

    • Optional transformNodeValue?: (options: TransformOptions<V>) => any

      Transform the node value for the style or className.

      default

      nodeValue

    • Optional transformStyle?: (options: TransformOptions<V>) => CSSProperties

      Transform the style.

      default

      { ...style, [styleKey]: value }

    • Optional validNodeValues?: any[]

      List of supported node values.

    • Optional validTypes?: string[]

      Node types required to inject the props.

      default

      [ELEMENT_DEFAULT]

Generated using TypeDoc