
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
838 bytes! minified, gzipped and has 0 dependencies25ms which is ~21x faster than JSX (540ms) 🚀npm install htsx
or with Yarn:
yarn install htsx
You can use HTSX everywhere you want.
import htsx from 'htsx';import htsx from './htsx.min.js';<script src="htsx.min.js"></script>And start creating your UI with htsx template literal.
Live demo: Codepen.io demo
const info = 'This is awesome!';
const handler = () => {};
const Component = htsx`
<section>
<h1>HTS</h1>
<span>Next level UI builder</span>
${info}
<button class="btn" onclick=${handler}>Download (1.5kb)</button>
</section>
`;
document.body.appendChild(Component);
htsx is not like HTML, it is HTML. You can use any tag you want with all html attributes.
const Component = htsx`
<h1>Hello!</h1>
<div class="box">I'm a box</div>
`;
document.body.appendChild(Component);
You can simply render your properties just like this
const name = 'Mike';
const Component = htsx`
<span>${name}</span>
`;
document.body.appendChild(Component);
Or pass props down:
const Component = (props) => htsx`
<span>${props.name}</span>
`;
document.body.appendChild(Component({ name: 'Mike' }));
You can attach events to elements in the simplest way.
const handler = (event) => {
};
const Button = htsx`
<button onclick=${handler}>Click me!</button>
`;
or with your parameters
const handler = (param, event) => {
};
const Button = htsx`
<button onclick=${handler.bind(this, 'foo')}>Click me!</button>
`;
All native event types are supported: onclick, onchange, onkeyup, onkeypress.
With htsx you can simply compose your elements:
const HelloElement = htsx`
<span>Hey!</span>
`;
const Container = htsx`
Hello!
${HelloElement}
`
FAQs
##### Build UIs with native HTML in JS.
The npm package htsx receives a total of 5 weekly downloads. As such, htsx popularity was classified as not popular.
We found that htsx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.