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
The preview has been updated.
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
The preview has been updated.
As Responsive Image
More details can be found at Responsive Image
The preview has been updated.
As Progressive Image
More details can be found at Progressive Image
The preview has been updated.
Paragraph
This component is a wrapper for Typography
, but outputting a <p>
tag by default.
The preview has been updated.
Section
This component is a wrapper for Typography
, but outputting a <section>
tag by default.
The preview has been updated.
Span
This component is a wrapper for Typography
, but outputting a <span>
tag by default.
The preview has been updated.