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.

Answer from Dan Homola on Stack Overflow
🌐
npm
npmjs.com › package › csstype
csstype - npm
November 17, 2025 - TypeScript and Flow definitions for CSS, generated by data from MDN. It provides autocompletion and type checking for CSS properties and values. ... import type * as CSS from 'csstype'; const style: CSS.Properties = { colour: 'white', // Type error on property textAlign: 'middle', // Type error on value };
      » npm install csstype
    
Published   Nov 17, 2025
Version   3.2.3
Author   Fredrik Nicol
Discussions

Typescript Type support for style objects
I'm working with React Typescript and Emotion. So far I have used template strings, but I'd like to gradually move to style objects. I'd like to be able to declare a style object, get type support from the editor, and then pass it to a css function, or a styled component. More on github.com
🌐 github.com
6
March 12, 2019
CSS Styling in Typescript

element.style.color = "red"; IS javascript. AFAIK typescript doesn't change anything about the dom API, it only adds things like static typing and enums.

Actually, I don't think this question is related to typescript at all.

Edit: I guess I misread what you said, but my point still stands, every line you posted here is valid javascript (and valid typescript).

More on reddit.com
🌐 r/typescript
4
1
October 22, 2019
how to set multiple CSS style properties in typescript for an element? - Stack Overflow
It also does not require you to stringify your styles like it would be necessary when you use element.setAttribute. ... BTW: Does anyone know why the CSSStyleDeclaration in TypeScript's declarations file has that number-based index signature instead of a string-based? More on stackoverflow.com
🌐 stackoverflow.com
Is any[] the TypeScript equivalent of !important in CSS?
Yep. In almost all cases there is a better type than any. Even when you don't care about the type or don't know it (like a pass-through function or some API types you don't care about), you can use unknown or some generic type. any just renders TS basically useless past that point. More on reddit.com
🌐 r/typescript
12
0
February 2, 2022
🌐
Oida
oida.dev › typescript-react › styles
TypeScript and React: Styles and CSS - oida.dev
July 17, 2019 - TypeScript support comes through DefinitelyTyped: ... import styled from "styled-components"; export const Heading = styled.h1` font-weight: normal; font-style: italic; `; You get typings directly out of the box. You can constraint CSS properties to certain values if you like, or even pass custom properties to regular CSS properties. You need to explicitly type your styled component:
🌐
DhiWise
dhiwise.com › post › how-to-elevate-ui-design-using-react-cssproperties-typescript
Implementing React CSSProperties Typescript for Styling
May 20, 2024 - TypeScript also assists in ensuring the 'style attribute' of elements like an h1 tag is of the correct type in editors like Visual Studio Code. Inline styles in React are applied using the style prop, which accepts an object where the keys are camelCased versions of the CSS property names, and the values are the CSS values as strings.
🌐
GitHub
github.com › emotion-js › emotion › issues › 1267
Typescript Type support for style objects · Issue #1267 · emotion-js/emotion
March 12, 2019 - I'm working with React Typescript and Emotion. So far I have used template strings, but I'd like to gradually move to style objects. I'd like to be able to declare a style object, get type support from the editor, and then pass it to a css function, or a styled component.
Author   carpben
🌐
GitHub
github.com › frenic › csstype
GitHub - frenic/csstype: Strict TypeScript and Flow types for style based on MDN data · GitHub
TypeScript and Flow definitions for CSS, generated by data from MDN. It provides autocompletion and type checking for CSS properties and values. ... import type * as CSS from 'csstype'; const style: CSS.Properties = { colour: 'white', // Type error on property textAlign: 'middle', // Type error on value };
Starred by 1.8K users
Forked by 75 users
Languages   TypeScript 98.4% | JavaScript 1.6%
🌐
8hob
8hob.io › posts › javascript › typescript: typing css variables in react
TypeScript: Typing CSS Variables in React
June 1, 2025 - src/App.tsx:2:23 - error TS2353: Object literal may only specify known properties, and '"--component-style"' does not exist in type 'Properties<string | number, string & {}>'. 2 return <h1 style={{ "--component-style": "classical" }}>Hello World!</h1> ~~~~~~~~~~~~~~~~~~~ node_modules/@types/react/index.d.ts:2908:9 2908 style?: CSSProperties | undefined; ~~~~~ The expected type comes from property 'style' which is declared here on type 'DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>' In this post, we discuss how to properly type CSS variables in React. Here, we avoid using type assertions and strive for type safety by typing as narrowly as possible. To make the TypeScript compiler recognize CSS variables, we can explicitly spell them out, like the following:
Find elsewhere
🌐
CSS-Tricks
css-tricks.com › css-in-typescript-with-vanilla-extract
CSS in TypeScript with vanilla-extract | CSS-Tricks
October 7, 2021 - These variations become easily discoverable with TypeScript — all you need to type is CMD/CTRL + Space (on most editors) and you get a dropdown list of the different ways to customize your component.
🌐
Fettblog
fettblog.eu › typescript-react › styles
TypeScript and React: Styles and CSS
TypeScript support comes through DefinitelyTyped: ... import styled from "styled-components"; export const Heading = styled.h1` font-weight: normal; font-style: italic; `; You get typings directly out of the box. You can constraint CSS properties to certain values if you like, or even pass custom properties to regular CSS properties. You need to explicitly type your styled component:
🌐
Reddit
reddit.com › r/typescript › css styling in typescript
r/typescript on Reddit: CSS Styling in Typescript
October 22, 2019 -

I'm fairly new to Typescript and I need to know how to style elements with Typescript. I already know that:

element.style.color = "red";

in Javascript is equivalent to

element.setAttribute("style", "color: red")

in Typescript, but I'm having a few problems with converting a couple of other things, such as:

element.style.removeProperty("color");

or

if (element.style.borderColor == "red")

Any help would be much appreciated. The lack of documentation and answers I can find using Google on these problems I encounter is disappointing to say the least.

🌐
GitHub
github.com › typestyle › typestyle
GitHub - typestyle/typestyle: Making CSS Typesafe 🌹
Use it like you would use CSS modules or CSS in general with webpack etc, but this time you get to use TypeScript / JavaScript! ... /** Import */ import {style} from "typestyle"; /** convert a style object to a CSS class name */ const className = style({color: 'red'}); /** Use the class name in a framework of choice */ // e.g.
Starred by 3.1K users
Forked by 86 users
Languages   TypeScript 96.9% | JavaScript 1.7% | HTML 1.4% | TypeScript 96.9% | JavaScript 1.7% | HTML 1.4%
🌐
Emotion
emotion.sh › docs › typescript
Emotion – TypeScript
Emotion includes TypeScript definitions for @emotion/react and @emotion/styled. These definitions infer types for css properties with the object syntax, HTML/SVG tag names, and prop types.
🌐
Netlify
use-form.netlify.app › interfaces › _node_modules__types_react_index_d_.react.cssproperties.html
CSSProperties | typescript
It corresponds to the border-top-style, border-right-style, border-bottom-style, or border-left-style property depending on the values defined for writing-mode, direction, and text-orientation. ... The border-inline-end-width CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation.
🌐
npm
npmjs.com › package › ts-style
ts-style - npm
December 28, 2015 - ts-style is a library for defining CSS styles using JavaScript or TypeScript, primarily intended for use with front-end libraries like React where components are defined in JavaScript.
      » npm install ts-style
    
Published   Dec 28, 2015
Version   0.7.1
Author   Robert Knight
🌐
LogRocket
blog.logrocket.com › home › using styled-components in typescript: a tutorial with examples
Using styled-components in TypeScript: A tutorial with examples - LogRocket Blog
June 4, 2024 - This installs the styled-components types for TypeScript as a dev dependency. We’re also going to use Material Icons, so let’s install the material-ui package. Type the following and press enter: ... There’s a styled-components extension for VS Code that makes it look like we’re typing actual CSS even though it’s a TypeScript file.
🌐
Bobby Hadz
bobbyhadz.com › blog › typescript-add-css-style-to-element
Set CSS styles on an Element using TypeScript | bobbyhadz
February 29, 2024 - This is why we used a type assertion to type the collection as HTMLCollectionOf<HTMLElement>. We used the style object to set CSS properties on the element.
🌐
Bobby Hadz
bobbyhadz.com › blog › react-pass-style-as-props-typescript
Pass CSS styles as props in React TypeScript | bobbyhadz
February 29, 2024 - Use the `React.CSSProperties` type to pass CSS styles as props in React TypeScript.
🌐
Medium
medium.com › @ramunarasinga › heres-how-you-can-type-check-your-css-properties-and-values-26002f3bfe5b
Here’s how you can type check your CSS properties and values. | by Ramu Narasinga | Medium
May 16, 2025 - TypeScript and Flow definitions for CSS, generated by data from MDN. It provides autocompletion and type checking for CSS properties and values. import type * as CSS from 'csstype'; const style: CSS.Properties = { colour: 'white', // Type error on property textAlign: 'middle', // Type error on value };