Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/SharifClick/svelte-touch-timepicker

A simple time picker - best for mobile web app (no dependency 🔥)
https://github.com/SharifClick/svelte-touch-timepicker

Last synced: 3 months ago
JSON representation

A simple time picker - best for mobile web app (no dependency 🔥)

Awesome Lists containing this project

README

        

# Native like time-picker for Svelte

[![NPM version](https://img.shields.io/npm/v/svelte-touch-timepicker.svg?style=flat)](https://www.npmjs.com/package/svelte-touch-timepicker) [![NPM downloads](https://img.shields.io/npm/dm/svelte-touch-timepicker.svg?style=flat)](https://www.npmjs.com/package/svelte-touch-timepicker)

[View the demo.](https://sharifclick.github.io/svelte-touch-timepicker/)

## Installation

```bash
npm i -D svelte-touch-timepicker
```

## Usage

```html

import TimePicker from "svelte-touch-timepicker"; // 4.38kb gzipped

let time = new Date();
$: _time = time.toLocaleTimeString("en-US");

.container{
height: 100%;
width: 100%;
}

.center {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font: 20px 'Roboto', sans-serif;
}



Time: {_time}




```

## Default css custom properties

```css

:root{
--svtt-popup-bg-color: white;
--svtt-popup-color: black;
--svtt-popup-radius: 10px;
--svtt-font-size: 20px;
--svtt-button-color: black;
--svtt-button-bg-color: transparent;
--svtt-border: 1px solid grey;
--svtt-button-box-shadow: none;
--svtt-bar-color: grey;
}
```

## Props

| Name | Type | Description | Required | Default |
| --- | --- | --- | --- | --- |
| `time` | `object` | default date object | yes | `new Date()` |
| `visible` | `Boolean` | Popup visibility | No | `false` |
| `classes` | `String` | custom classes to be add on input | No | `empty string` |