JSX attributes

prop:*

Edit this page

prop:* forces a JSX key to be written as a DOM property instead of an attribute.

Strong-Typing Custom Properties

Type definitions are required when using TypeScript. See the TypeScript page for examples.


Syntax

<div prop:scrollTop={value} />

Value

  • Type: property value

Value assigned directly to the property after the prop: prefix is removed.


Behavior

  • On the client, prop:name={value} strips the prop: prefix and assigns the value directly to the name property.
  • prop:* does not produce SSR output.
  • Use prop:* when a DOM property must receive the value directly. Solid can still assign some custom-element properties without prop:*.

Examples

Basic usage

<input type="checkbox" prop:indeterminate={true} />

Report an issue with this page