Skip to content

Commit

Permalink
feat: add demo gif
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed Jul 22, 2023
1 parent a6b21c3 commit 56370b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![npm](https://img.shields.io/npm/v/typed-htmx?style=flat-square)](https://www.npmjs.com/package/typed-htmx)

[![demo](/static/demo.gif)](https://asciinema.org/a/598553)

Definitions for htmx attributes in JSX.

## Usage
Expand Down
23 changes: 19 additions & 4 deletions example/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@

/** @param {{children: any}} _ */
export function MyComponent({ children }) {
return <div hx-get="/">{children} asd</div>;
export function MyComponent() {
return '<!DOCTYPE html>' + (
<html lang='en'>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/static/htmx.min.js"></script>
</head>
<body hx-boost="true" hx-ext="sse,ws">
<form action='/posts' method='post' hx-trigger="reset" hx-vals={{foo: 'bar'}}>
<label for='author'>
Author
<input type='text' name='author'/>
</label>
<button type='submit'>Submit</button>
</form>
</body>
</html>
);
}
Binary file added static/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56370b6

Please sign in to comment.