Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkolind committed May 20, 2024
1 parent 78cf179 commit 09dba5d
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,49 @@ A **jsx-free**, **super-lightweight** and **zero-dependency** library to add int

Read [this blog post](https://www.itsmeseb.dev/2024/01/03/tent.html) to get a better understanding of what Tent is and why it exists. You might also be interested in "[What is Tent?](https://tentjs.github.io/docs/what-is-it.html)".

## Installation
## ⚙️ Installation

```bash
npm install @tentjs/tent
```

or, the official starter template
## ⚡ Quickstart

```bash
git clone @tentjs/starter my-app
cd my-app
npm install
npm run watch
Getting started with Tent is easy. Here's a simple example component that increments a number when the button is clicked. This example demonstrates creating a stateful component, updating the state, and mounting it to the DOM.

```typescript
import { type Component, mount, tags } from '@tentjs/tent';

// Tags are functions that create elements
// A tag takes 2 arguments: the children and the attributes (optional)
// The attributes will be assigned to the element, and can be
// onclick, onchange, disabled, classNames, etc..
const { button } = tags;

type State = { count: number };

const Counter: Component<State> = {
// Initial state
state: { count: 0 },
// Define the view
view: ({ state }) => {
return button(
`You clicked ${state.count} times`,
// Assign an onclick event to the button
{ onclick: () => state.count++ },
);
},
};

// Append the component to the body
mount(document.body, Counter);
```

To get started you can read the [official and friendly documentation](https://tentjs.github.io/docs/). Or, you might be interested in some of the [examples](https://tentjs.github.io/cookbook/).
## 👍🏻 Contribute

## Contributing
If you want to support the active development of Tent, there are a few ways you can help:

Feel free to get involved in the [discussions](https://github.com/tentjs/tent/discussions), submit a pull request or send me an [email](mailto:[email protected]).
1. [**Give a ⭐**](https://github.com/tentjs/tent/stargazers) &mdash; bring attention to the project.
2. **Tweet about it** &mdash; share your excitement.
3. [**Get involved**](https://github.com/tentjs/tent/discussions) &mdash; join the discussions.
4. [**Contribute**](https://github.com/tentjs/tent/pulls) &mdash; submit a pull request.

0 comments on commit 09dba5d

Please sign in to comment.