Skip to content

SVG Icons: Unable to Supply <defs> Element #4489

@joncursi

Description

@joncursi

Although the SVG font icons support a children prop, I am unable to pass in a defs element to define a custom linear gradient. I.e.:

         import Stars from 'material-ui/svg-icons/action/stars';

          <Stars
            children={
              <defs>
                <linearGradient id="MyGradient">
                  <stop offset="5%" stopColor="#F60" />
                  <stop offset="95%" stopColor="#FF6" />
                </linearGradient>
              </defs>
            }
            className="star--half"
          />

The icon renders without the defs element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: SvgIconThe React component.good first issueGreat for first contributions. Enable to learn the contribution process.type: new featureExpand the scope of the product to solve a new problem.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions