diff --git a/README.md b/README.md index 64c9ad0..33abc72 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ npm install feather-icons * [`feather.icons`](#feathericons) * [`feather.icons[name].toSvg()`](#feathericonsnametosvgattrs) * [`feather.replace()`](#featherreplaceattrs) + * [`feather.replaceElement()`](#featherreplaceelementelement-attrs) * [(DEPRECATED) `feather.toSvg()`](#deprecated-feathertosvgname-attrs) * [Contributing](#contributing) * [Related Projects](#related-projects) @@ -354,6 +355,71 @@ All attributes on the placeholder element (i.e. ``) will be copied to the `` tag (e.g. `{ foo: 'bar' }` maps to `foo="bar"`). All default attributes on the `` tag can be overridden with the `attrs` object. | + +#### Usage + +> **Note:** `feather.replaceElement()` only works in a browser environment. + +Simple usage: +```html + + + + +``` + +You can pass `feather.replaceElement()` an `attrs` object: +```html + + + + +``` + +All attributes on the placeholder element (i.e. ``) will be copied to the `` tag: + +```html + + + + +``` + +[View Source](https://github.com/colebemis/feather/blob/master/src/replaceElement.js) + +--- + ### (DEPRECATED) `feather.toSvg(name, [attrs])` > **Note:** `feather.toSvg()` is deprecated. Please use `feather.icons[name].toSvg()` instead.