Go to the media global configuration (System -> Global Configuration -> Media).
- Add svg,SVG to the list of global extensions (file types),
- Add svg as legal image extension,
- Add image/svg+xml,application/svg+xml as legal MIME types.
From that point on, you will be able to see SVG files in the media manager (but you won’t have any preview for the file).
ip You should keep your SVG files under a specific folder assigned for them.
In that folder, add a dummy raster file (any PNG or JPG file will do). The dummy file will help you later on when inserting a SVG file into an article - for instance - (when you open the media manager from the default editor, the SVG files are not visible).
By selecting the dummy file, you will get the proper markup you need.
The last step will be then to swap the dummy file name with the name of the SVG file you intended to use.
TinyMCE
In TinyMCE, the default editor, you can add ‘svg’ as extended valid element (to trusted user groups).
Go to Extensions -> Plugins -> Editors type.
Joomla 4 is a little bit more aware of the SVG file format (once you have made the proper additions to the media global settings to support it, like in Joomla 3). The CMS takes a few steps in the right direction, but is still shy of a few features: there is still no preview in the media manager (as of today – beta 4) and it does not appear that uploaded files are sanitized: basically, you are fully responsible for any SVG you upload.
However, you can easily select the SVG files wherever the media manager is used for image insertion.
source: https://simplifyyourweb.com/documentation/topics/1290-svg-support-in-the-joomla-cms