@custom_okoshko/react
v0.1.0-beta.1
Published
React wrapper for @custom_okoshko/core calendar.
Readme
@custom_okoshko/react
React-обёртка (React ≥ 18) для @custom_okoshko/core.
npm i @custom_okoshko/react @custom_okoshko/themes @custom_okoshko/localesimport '@custom_okoshko/themes/base.css';
import '@custom_okoshko/themes/light.css';
import { Calendar } from '@custom_okoshko/react';
import { ru } from '@custom_okoshko/locales/ru';
function DatePicker() {
const [value, setValue] = useState(null);
return (
<Calendar locale={ru} value={value} onChange={setValue}>
{value ?? 'Выбрать дату'}
</Calendar>
);
}value(включаяnull) — controlled,defaultValue— uncontrolled.inlineрендерит календарь в<div>, без него —<button>-якорь попапа.ref— инстанс ядра. Пакет помечен'use client'.
Документация и живые демо: DOCS_URL
Лицензия MIT.
