Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface InjectProps

Hierarchy

  • InjectProps

Index

Properties

Properties

Optional inject

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

Type declaration

  • Optional props?: { classNames?: AnyObject; defaultNodeValue?: any; nodeKey?: string; styleKey?: keyof CSSProperties; transformClassName?: (options: TransformOptions) => any; transformNodeValue?: (options: TransformOptions) => any; transformStyle?: (options: TransformOptions) => 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) => any

      Transform the className.

      default

      clsx(className, classNames[value])

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

      Transform the node value for the style or className.

      default

      nodeValue

    • Optional transformStyle?: (options: TransformOptions) => 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