preact-markup icon indicating copy to clipboard operation
preact-markup copied to clipboard

Add 'as' and 'markupClass' Props

Open Saeris opened this issue 5 years ago • 0 comments

Added two new props to provide better control over the rendered wrapper element.

as (default: 'div') will accept a component or a string to set the wrapping element

markdownClass (default: 'markdown') will accept a string which will be added to the classNames list on the wrapping element. A falsy value will result in no class name being added.

For myself this solves a use-case where I wanted the wrapper element to be a list item instead of a div and I didn't want to add a class name either. This should allow better compatibility with styled-components as well, allowing users of that library to change the rendered element using the forwardedAs prop from that library.

Saeris avatar Apr 02 '20 00:04 Saeris