Type alias InlineAttrName<QualifiedAttributeNames>

when explicitly declaring a prop to be of an attribute kind, use the attr: prefix to specify.
examples: attr:id, attr:style, attr:class, and attr:href.
common values for the QualifiedAttributeNames type parameter:

  • for all html attributes: InlineAttrName<HTMLTagNameAttributesMap[HTMLTagNames]>
  • for all svg attributes: InlineAttrName<SVGTagNameAttributesMap[SVGTagNames]>
  • for any allowing arbitrary attribute name: InlineAttrName

note that using a union of string literal attributes instead of just using any arbitrary string attribute, will lead to slowdowns in you IDE.

Type Parameters

  • QualifiedAttributeNames extends string = string

Example

const MyComponent = () => {
return <div style="color: blue;" class="some-thing" attr:id="another-thing">
Hello world!
</div>
}
const my_green_component = <MyComponent style="color: green;" attr:id="a-different-thing" />
// this will create:
// <div style="color: green;" id="a-different-thing" class="some-thing">Hello World!</div>

Generated using TypeDoc