Components

SVG

Utilize <svg> tags directly in a Page or within a Snippet to display custom images, icons, and more.

Usage

You may use HTML <svg> tags within Portal Custom Pages, Portal Snippets, and as slot content of MDC block components. Adding an inline SVG involves simply placing the SVG markup directly into your MDC document.

We recommend always wrapping a SVG in a Container component to allow for easy customization of colors, spacing, etc.
Rocket Icon
::container
---
color: "#0044f4"
---
<svg fill="none" role="img" viewBox="0 0 24 24" width="80px" height="80px" xmlns="http://www.w3.org/2000/svg">
<title>Rocket Icon</title>
<path d="M2.4498 10.575L6.6498 6.37504C6.88314 6.1417 7.15814 5.97504 7.4748 5.87504C7.79147 5.77504 8.11647 5.75837 8.4498 5.82504L9.7498 6.10004C8.8498 7.1667 8.14147 8.13337 7.6248 9.00004C7.10814 9.8667 6.60814 10.9167 6.1248 12.15L2.4498 10.575ZM7.5748 12.85C7.95814 11.65 8.47897 10.5167 9.1373 9.45004C9.79564 8.38337 10.5915 7.38337 11.5248 6.45004C12.9915 4.98337 14.6665 3.88754 16.5498 3.16254C18.4331 2.43754 20.1915 2.2167 21.8248 2.50004C22.1081 4.13337 21.8915 5.8917 21.1748 7.77504C20.4581 9.65837 19.3665 11.3334 17.8998 12.8C16.9831 13.7167 15.9831 14.5125 14.8998 15.1875C13.8165 15.8625 12.6748 16.3917 11.4748 16.775L7.5748 12.85ZM14.4748 9.85004C14.8581 10.2334 15.329 10.425 15.8873 10.425C16.4456 10.425 16.9165 10.2334 17.2998 9.85004C17.6831 9.4667 17.8748 8.99587 17.8748 8.43754C17.8748 7.8792 17.6831 7.40837 17.2998 7.02504C16.9165 6.6417 16.4456 6.45004 15.8873 6.45004C15.329 6.45004 14.8581 6.6417 14.4748 7.02504C14.0915 7.40837 13.8998 7.8792 13.8998 8.43754C13.8998 8.99587 14.0915 9.4667 14.4748 9.85004ZM13.7748 21.875L12.1748 18.2C13.4081 17.7167 14.4623 17.2167 15.3373 16.7C16.2123 16.1834 17.1831 15.475 18.2498 14.575L18.4998 15.875C18.5665 16.2084 18.5498 16.5375 18.4498 16.8625C18.3498 17.1875 18.1831 17.4667 17.9498 17.7L13.7748 21.875ZM4.0498 16.05C4.63314 15.4667 5.34147 15.1709 6.1748 15.1625C7.00814 15.1542 7.71647 15.4417 8.2998 16.025C8.88314 16.6084 9.1748 17.3167 9.1748 18.15C9.1748 18.9834 8.88314 19.6917 8.2998 20.275C7.88314 20.6917 7.1873 21.05 6.2123 21.35C5.2373 21.65 3.89147 21.9167 2.1748 22.15C2.40814 20.4334 2.6748 19.0917 2.9748 18.125C3.2748 17.1584 3.63314 16.4667 4.0498 16.05Z" fill="currentColor" />
</svg>
::
Container Component Props

The text color of the element. Accepts string.

Snippets

As you can see above, the downside of utilizing an SVG directly in your Portal Custom Page is that it can quickly make the larger Portal Page file appear "bloated" and difficult to read.

We recommend adding SVG markup to a Portal Snippet document when feasible and utilizing the Snippet component in your page for a cleaner developer experience. In theory, you could add multiple SVG to the same snippet and control their visibility via Snippet data from the parent document.

---
title: "My Page"
---

::page-section
---
full-width: true
color: "var(--kui-color-text-inverse)"
background-color: "var(--kui-color-background-decorative-purple)"
text-align: "center"
---
[Using SVG is easy!]{ style="font-weight: var(--kui-font-weight-bold); font-size: var(--kui-font-size-70);" }

:snippet{name="rocket-svg"}
::