className

The React prop, and DOM property, that sets an element's HTML class attribute.

In more detail

React uses className because class is a reserved word in JavaScript. Design system components accept a className from callers and merge it with their own classes rather than replacing them.

Example

<div className={`box box--${variant}`} />

Related terms

Taught in

References