Skip to main content

SVG

The SVG Widget lets you display a scalable vector graphic (SVG) — such as a logo, icon, or illustration — anywhere in your Astroid layout. Because SVGs are vector-based, they stay sharp at any size and on any screen. You can control the SVG's width and height per device, and even override its colors for light and dark modes.

svg-preview.png

📌 Features​

  • Select an SVG file from the Joomla Media Manager or upload a new one
  • Responsive width and height settings (per device)
  • Override SVG fill and stroke colors for light and dark modes
  • Add a custom CSS class for extra styling
  • Animation, advanced styling, and page assignment options

🔍 Step 1: Add the SVG Widget to the Layout​

  1. Go to your Joomla Administrator Panel
  2. Navigate to: System → Site Template Styles → Click on your Astroid template
  3. Click the “Template Options” button
  4. Open the Layout tab
  5. Launch the Layout Builder
  6. Click the ➕ button where you want to add the SVG.
  7. Select SVG from the Media widget list.

add-element.jpeg

select-media.jpg


⚙️ Step 2: Configure the SVG Widget​

After adding the widget, click the ⚙️ (settings) icon to open the configuration panel. The General tab contains the main options for the SVG.

svg-general.png

OptionDescription
Element TitleThe name of the widget shown in the Layout Builder (e.g., SVG, Site Logo). It is used for identification only and is not displayed on the frontend.
Select SVGClick Select Image / Change Image to choose an SVG file from the media library or upload a new one. The selected file path is shown in the Url field (e.g., company/logo.svg). Click Clear to remove it.
SVG WidthThe width of the SVG (e.g., 160px). Use the unit selector to change the unit and the device selector (Global, Desktop, Tablet, Mobile…) to set a different width per screen size.
SVG HeightThe height of the SVG (e.g., 160px). Like width, it supports units and responsive values per device.
SVG ColorOverride the SVG's fill and stroke colors for light and dark modes. Areas whose fill or stroke is set to none remain unchanged. Leave empty to keep the original colors of the file.
Custom ClassAdd one or more CSS classes to the SVG wrapper (e.g., logo-white) for custom styling via your own CSS.

💡 Tip: If you only set the width (or height), keep the other value proportional to the SVG's original aspect ratio to avoid unwanted empty space around the graphic.


🎨 Step 3: Other Tabs​

TabDescription
SettingsSpacing (margin/padding), background, border, alignment, and responsive visibility options.
AnimationAdd an entrance animation (e.g., fade, slide, zoom) with duration and delay when the SVG appears in the viewport.
AdvancedConfigure the widget's dynamic content source.
AssignmentChoose where the widget is displayed.

📌 Step 4: Assign Widget to Specific Pages​

In the Assignment tab, choose where the widget will be displayed:

  • All pages
  • No pages
  • Specific pages only → Select specific menu items

Click Save changes to apply your settings, then save the template.


🎯 Example Use Cases​

  • ✅ Display your site or company logo in the header or footer
  • ✅ Show icons or illustrations that stay crisp on retina screens
  • ✅ Use a single-color SVG and recolor it to match your brand or dark mode
  • ✅ Add decorative shapes or dividers between sections

✅ Tips​

  • Use SVG Color to make one SVG file work on both light and dark backgrounds instead of uploading two versions.
  • Optimize your SVG files (e.g., with SVGOMG) to reduce file size.
  • Only upload SVG files from trusted sources, since SVGs can contain scripts.

🛠 Troubleshooting​

  • SVG not showing?
    • Make sure an SVG file is selected and the path in the Url field is correct.
    • Check that the Assignment setting includes the current page.
    • Verify that SVG Width / SVG Height are not set to 0 for the current device.
  • Color override not applied?
    • Parts of the SVG with fill="none" or stroke="none" are intentionally left unchanged.
    • Colors defined inside embedded <style> blocks or gradients in the SVG file may take precedence.