Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metadream/thyme

Web UI components based on native javascript
https://github.com/metadream/thyme

javascript-library ui-components web-components

Last synced: 4 days ago
JSON representation

Web UI components based on native javascript

Awesome Lists containing this project

README

        

# Thyme UI Components

Demo: https://metadream.github.io/thyme

## Usage

```

```

If you want to use the formulas, you also need to import

```

```

## Components

```
E=mc^2
Submit

Football
Basketball


iPhone
Samsang

This is remark content.

This is a dialog!



1




2






3



4





5



6




7








8






9







10

```

## Modules

### WebSocket

```
const channel = new Thyme.Channel('ws://endpoint');
channel.on('message', (data) => console.log(data));
```

### Form

```
const object = Thyme.form.getJsonObject('selector');
const array = Thyme.form.getJsonArray('selector>children');
```

### Http

```
# get, post, put, patch, delete
Thyme.http.post('/path', data).then(res => {
console.log(res);
})
```

### Utils

```
Thyme.alert('Alert!');
Thyme.confirm('Confirm?', () => console.log('callback'));
Thyme.info('message');
Thyme.success('message');
Thyme.warn('message');
Thyme.error('message');

Thyme.util.nanoId(24);
Thyme.util.createElement('

');
Thyme.util.formatDate(new Date(), 'yyyy-MM-dd hh:mm');
Thyme.util.formatDecimal(10.3212123, 2);
Thyme.util.formatBytes(28932892);
Thyme.util.parseDuration('3:20');
Thyme.util.formatSeconds(280);
Thyme.util.stringify({a:1, b:2});
Thyme.util.base64Encode('plain text');
Thyme.util.svg2png(svgElement);
Thyme.util.toDataURI(svgHTML);
```