@klondike/ui-preact
v0.0.4
Published
Styleless Preact UI components
Downloads
9
Maintainers
Readme
ui-preact
Styleless Preact UI components
Install
npm
npm i -S @klondike/ui-preact
yarn
yarn add @klondike/ui-preact
Direct Usage
Here is a quick example to get you started, it's all you need:
import { render } from 'preact';
import { Button } from '@klondike/ui-preact';
function App() {
return (
<Button>
Get Started
</Button>
);
}
render(<App />, document.querySelector('#app'));
Extending Components
Here is an example of extending a component:
import { render } from 'preact';
import { Button } from '@klondike/ui-preact';
const LoudButton = ({ children, ...props }) => (
<Button className="Button-loud" {...props}>{ children }</Button>
);
function App() {
return (
<LoudButton>
Get Crackin!
</LoudButton>
);
}
render(<App />, document.querySelector('#app'));