preact-flatpickr

1.0.3 • Public • Published

📅 Preact Flatpickr

Open Source Love Open Source Love PRs Welcome

Flatpicker component for Preact.

Getting Started

Install the package by running:

npm install --save preact-flatpickr

Example

import { Component } from 'preact';
import Flatpickr from 'preact-flatpickr';
 
export default class App extends Component {
  constructor(props) {
    super(props)
 
    this.state = {
      flatpickrConfig: {
        'weekNumbers': true
      }
    }
  }
  render() {
    return (
      <div>
        <Flatpickr
          theme="dark"
          config={this.state.flatpickrConfig}
          onChange={() => console.log('You just changed the date.')}>
        </Flatpickr>
      </div>
    );
  }
}

API

Every Flatpickr configuration option is available. You can check out every option here. You can also set themes via the theme attribute. Learn more about the options here.

License

  • MIT

I'm new to Preact, so don't bite my head off. 😊

Package Sidebar

Install

npm i preact-flatpickr

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

7.74 kB

Total Files

5

Last publish

Collaborators

  • molnarmark