Type for style attribute passed to function

The type is React.CSSProperties. You can find this in VSCode by writing <div style={{}}> and pressing F12 when having your cursor in the style attribute.


The style prop on regular DOM elements should be in the form of an object where the keys are the css attributes.

Example: <div style={{ width: "100%", backgroundColor: "black" }} />

Notice that in the case of attributes containing dashes, they become camel cased. For instance background-color becomes backgroundColor.

React style documentation