Hi I'm creating ReactJS component library for personal usage and trying to create a spinner for ex.
I would like to create dynamic css class (not style attribute of component like style={{}}) according to Spinner's size,transition (for speed) etc. When I create a style attribute it is displaying on console when view the Inspect in chrome. I would like to create dynamic css for different properties and apply to the component classList.
Spinner Sizes:
type SizeType = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
For example in Chakra UI it is creating css class dynamically and append to the classList of component.
Chakra UI Spinner
<Spinner thickness='5px' size="lg" speed="3s" />
Chakra UI Spinner Class => css-do6byp
class="chakra-spinner css-do6byp"
How can I do that for different props?
I could not found the solution. I would appreciate it if you cloud help me on this.
Thanks in advance.