ReferenceIcons
Icons
The SVG icon sets used by the packaged skins, as React components, SVG strings, and the media-icon element
The icons the packaged skins render. Skin source added with the Shadcn registry imports its icons from these modules, and your own controls can use them too.
Each icon is available as an SVG string and by name through the <media-icon> element.
Import
Register <media-icon>:
Or import SVG strings:
Icon sets
Three sets ship with the same icon names and different designs.
Available icons
Element
<media-icon> renders a registered icon as its child <svg>, in the light DOM. It renders nothing when the name is not registered in the family.
Each module below defines <media-icon> if it is not already defined:
SVG strings
Each icon export from @videojs/html/icons, @videojs/html/icons/default, @videojs/html/icons/neutral, and @videojs/html/icons/compat is the icon’s SVG markup as a string; @videojs/html/icons also exports registerIcons. Importing them does not define <media-icon>.
registerIcons
registerIcons(family, icons) registers SVG strings under icon names for <media-icon> and defines the element if needed. Only the icons you import ship, which is how skin source from the Shadcn registry registers its icons. Registering into an existing family adds to it, and <media-icon> elements already in the page update.
Once a family has registered icons, <media-icon> renders only those for it, even when @videojs/html/icons/element is also imported. registerIcons throws when a different element is already defined as media-icon and does not support registration.
Styling
Icons use fill="currentColor", so they take the text color of their parent. They are drawn on an 18×18 grid and render most sharply at 18px or a whole multiple, such as 36px.
Accessibility
Every icon renders with aria-hidden="true". Give the surrounding control its accessible name. Built-in buttons, such as the play button, provide one automatically.