Format HTML attributes as tagged tmplate
Format properties for to ArrowJS
import { html } from '@arrow-js/core';import { arrowTags } from 'arrow-tags';const props = {style: 'color: red;', id: 'red-span'};const [ pads, ...vals ] = arrowAttributes('span', props);// <span style="color: red;" id="red-span">hello</span>const el = document.getElementById('root');html([...pads, '</span>'], ...[...vals, 'hello'])(el); Copy
import { html } from '@arrow-js/core';import { arrowTags } from 'arrow-tags';const props = {style: 'color: red;', id: 'red-span'};const [ pads, ...vals ] = arrowAttributes('span', props);// <span style="color: red;" id="red-span">hello</span>const el = document.getElementById('root');html([...pads, '</span>'], ...[...vals, 'hello'])(el);
string for valid HTML tag
object with attributes
tagged tmplate inputs
Generated using TypeDoc
Format HTML attributes as tagged tmplate
Example
Format properties for to ArrowJS