
Customizable calendar UI component offering grid and horizontal week views, per-day background images, extensive styling options, indicators, and English/Korean localization.
A fully customizable Compose calendar component for Compose Multiplatform.
It supports both horizontal scrolling calendars and grid-based calendars.
This library lets you add rich visual elements, like background images for specific days.
It also provides extensive configuration options for styling and localization.
특정 날짜에 배경 이미지를 추가, Styling과 Localization 등 다양한 설정 옵션을 제공하는 Compose Multiplatform 기반 캘린더 컴포넌트입니다.
| Grid-based Calendar | Horizontal Calendar |
|---|---|
Add the following to your build.gradle file:
// Project level build.gradle
allprojects {
repositories {
google()
mavenCentral()
}
}
// App level build.gradle
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("io.github.dongchyeon:photo-calendar:<latest_version>")
}Replace usages of java.time.LocalDate with kotlinx.datetime.LocalDate:
// Before
import java.time.LocalDate
// After
import kotlinx.datetime.LocalDatevar selectedDate by remember { mutableStateOf(LocalDate.now()) }
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 2)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
Calendar(
selectedDate = selectedDate,
events = events,
) {
selectedDate = it
}var selectedDate by remember { mutableStateOf(LocalDate.now()) }
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 2)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
HorizontalCalendar(
selectedDate = selectedDate,
events = events,
) {
selectedDate = it
}You can add events to specific dates using the CalendarEvent class. Each event can include a background image and a shape.
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 3)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
HorizontalCalendar(
selectedDate = LocalDate.now(),
events = events,
onDayClicked = { selectedDate ->
println("Selected Date: $selectedDate")
}
)Calendar(
// ...
headerConfig = CalendarHeaderConfig.default().copy(
textStyle = Typography.titleLarge,
textColor = Color.Red
)
// ...
)Calendar(
// ...
weekHeaderConfig = CalendarWeekHeaderConfig.default().copy(
textStyle = Typography.bodyLarge,
textColor = Color.Gray
)
// ...
)Calendar(
// ...
dayConfig = CalendarDayConfig.default().copy(
dayTextColor = Color.Blue,
selectedDayTextColor = Color.White
)
// ...
)Calendar(
// ...
indicatorConfig = CalendarIndicatorConfig(
indicatorColor = Color.Yellow.copy(alpha = 0.4f),
shape = RoundedCornerShape(12.dp)
)
// ...
)This project is licensed under the MIT License. See the LICENSE file for details.
A fully customizable Compose calendar component for Compose Multiplatform.
It supports both horizontal scrolling calendars and grid-based calendars.
This library lets you add rich visual elements, like background images for specific days.
It also provides extensive configuration options for styling and localization.
특정 날짜에 배경 이미지를 추가, Styling과 Localization 등 다양한 설정 옵션을 제공하는 Compose Multiplatform 기반 캘린더 컴포넌트입니다.
| Grid-based Calendar | Horizontal Calendar |
|---|---|
Add the following to your build.gradle file:
// Project level build.gradle
allprojects {
repositories {
google()
mavenCentral()
}
}
// App level build.gradle
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("io.github.dongchyeon:photo-calendar:<latest_version>")
}Replace usages of java.time.LocalDate with kotlinx.datetime.LocalDate:
// Before
import java.time.LocalDate
// After
import kotlinx.datetime.LocalDatevar selectedDate by remember { mutableStateOf(LocalDate.now()) }
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 2)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
Calendar(
selectedDate = selectedDate,
events = events,
) {
selectedDate = it
}var selectedDate by remember { mutableStateOf(LocalDate.now()) }
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 2)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
HorizontalCalendar(
selectedDate = selectedDate,
events = events,
) {
selectedDate = it
}You can add events to specific dates using the CalendarEvent class. Each event can include a background image and a shape.
val events = listOf(
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 1)),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plus(DatePeriod(days = 3)),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)
HorizontalCalendar(
selectedDate = LocalDate.now(),
events = events,
onDayClicked = { selectedDate ->
println("Selected Date: $selectedDate")
}
)Calendar(
// ...
headerConfig = CalendarHeaderConfig.default().copy(
textStyle = Typography.titleLarge,
textColor = Color.Red
)
// ...
)Calendar(
// ...
weekHeaderConfig = CalendarWeekHeaderConfig.default().copy(
textStyle = Typography.bodyLarge,
textColor = Color.Gray
)
// ...
)Calendar(
// ...
dayConfig = CalendarDayConfig.default().copy(
dayTextColor = Color.Blue,
selectedDayTextColor = Color.White
)
// ...
)Calendar(
// ...
indicatorConfig = CalendarIndicatorConfig(
indicatorColor = Color.Yellow.copy(alpha = 0.4f),
shape = RoundedCornerShape(12.dp)
)
// ...
)This project is licensed under the MIT License. See the LICENSE file for details.