Litopis GitHub

Integrations

Use @litopis/dom directly or install a package for your framework.

Packages

Plain DOM

Install @litopis/dom and create a date picker on an existing element.

sh
npm install @litopis/dom
ts
import { createDatePicker } from "@litopis/dom";
import "@litopis/dom/styles/base.css";

const picker = createDatePicker(root, {
  mode: "popover",
  label: "Start date",
});

picker.getISOValue();

To use your own field, place an input directly inside the root with slot="input" before calling createDatePicker().

html
<div id="picker">
  <input slot="input" class="my-input" placeholder="Choose a date" />
</div>

See the API reference for options and controller methods.

CSS

Packages do not load CSS. Import one Litopis stylesheet in your application entry.

ts
import "@litopis/dom/styles/base.css";
Styling guide →