Convenience Elements provide a wrapper component for many commonly used HTML tags (like p
, h1-h6
, img
, section
, and span
), enabling convenience props like `margin`, `padding`, and `fontWeight`.
Components like Img
are wrappers around other components, letting you specify which of a number of related components you want to use.
For example, if you want to render an image as a progressive or a responsive image, you don't need to use the specific component ProgressiveImage
or ResponsiveImage
. Instead, you can simply use Img
with a variant
prop that indicates either progressive or responsive.
These convenience components enable SWAN standards and functionality, and are built for extensibility.
Headings
Img
The Img
component provides an image, in one of these types:
As Fluid Image (the default behaviour)
More details can be found at Fluid Image
As Responsive Image
More details can be found at Responsive Image
As Progressive Image
More details can be found at Progressive Image
Paragraph
This component is a wrapper for Typography
, but outputting a <p>
tag by default.
Section
This component is a wrapper for Typography
, but outputting a <section>
tag by default.
Span
This component is a wrapper for Typography
, but outputting a <span>
tag by default.