Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graysonarts/leptos-calendar
An unstyled calendar component for leptos
https://github.com/graysonarts/leptos-calendar
Last synced: about 1 month ago
JSON representation
An unstyled calendar component for leptos
- Host: GitHub
- URL: https://github.com/graysonarts/leptos-calendar
- Owner: graysonarts
- Created: 2024-11-13T14:30:47.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-13T14:43:33.000Z (about 1 month ago)
- Last Synced: 2024-11-13T15:34:33.583Z (about 1 month ago)
- Language: Rust
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# an unstyled calendar component for Leptos
This component provides a calendar component and a configuration hook to be able to apply styles to it.
## Example Usage
```rust
#[component]
fn Parent() -> into ImplView {
let calendar_config = CalendarConfig {
active_classes: Some("border-pink-400 border-2".to_string()),
header_classes: Some("bg-slate-900 text-white".to_string()),
month_classes: Some("bg-black p-3 text-center text-4xl font-normal".to_string()),
cell_classes: Some("bg-black text-center py-3 px-4 border aspect-square".to_string()),
..Default::default()
};
let (selected_date, _) = create_signal(
NaiveDate::from_ymd_opt(2025, 1, 30)
.and_then(|x| x.and_hms_opt(12, 12, 12))
.and_then(|x| Some(x.and_local_timezone(Local).unwrap()))
.unwrap(),
);view! {
}
}
```## Remaining Work
- [ ] Add ability to click the cell to set the current date
- [ ] Move `cell_renderer` into a sub-component instead of config (if possible)
- [ ] Add doctests and documentation## Please file issues
This isn't super well tested, so if you use it and run into problems or rough edges, [please file issues](https://github.com/graysonarts/leptos-calendar/issues)