@bity/preact-base-components
A collection of basic user interface components written in preact.
See src/
for all the components and to learn how they work.
They are provided as ES2015 modules, and have already been transpiled once from
JSX to regular ES2015+.
You will probably want to use these in combination with
@bity/preact-conversion-components
, @bity/preact-exchange-client
, and
@bity/styles
.
Installation
npm install @bity/preact-base-components @bity/styles
Usage by example
First write your preact code as you normally would as ES2015+:
import { h, render } from 'preact';
import { Pulse } from '@bity/preact-base-components/pulse';
render(h(Pulse, {}, null), document.getElementById('root'));
Save the file and run your favorite bundler/transpiler combination, and then:
<head>
<link rel="stylesheet" type="text/css" href="node_modules/@bity/styles/index.css"/>
</head>
<body>
<div id="root"></div>
<script src="bundle.js"></script>
</body>