--- sidebar_position: 3 --- # Custom Modifiers {#custom-modifiers} In DayPicker, a **custom modifier** is added to a day when the day matches a specific condition, called a [`Matcher`](../api/type-aliases/Matcher.md). Modifiers are set using the `modifiers` prop. When a date matches a modifier, the modifier is passed to the `onSelect` event and other [DayEventHandler](../api/type-aliases/DayEventHandler.md) events (`onDayClick`, etc.) to inspect the days the user has interacted with. For example, you can use a custom modifier to mark days as already booked in a booking app: ```tsx { if (modifiers.booked) { alert("This day is already booked."); } }} /> ``` ## Understanding Modifiers - Use modifiers to change the appearance of days in the calendar or to inspect the days the user has interacted with (e.g., picking a day). - DayPicker comes with some [pre-built modifiers](../api/type-aliases/Modifiers.md), such as `disabled`, `selected`, `hidden`, `today`, `range_start`, etc., designed to cover the most common use cases. - You can implement custom modifiers to extend the behavior of DayPicker. See the examples below for more details. ## Built-in Modifiers ### `selected` Modifier ```tsx ``` In selection mode, use the `selected` prop to add the `selected` modifier to the selected dates and style them accordingly. For more details on implementing the `selected` modifier, see the [Selecting Days guide](../selections/selection-modes.mdx). ### `disabled` Modifier Use the `disabled` modifier to disable one or more days. Pass a [`Matcher`](../api/type-aliases/Matcher.md) or an array of matchers to specify the disabled days: ```tsx // Disable Sundays and Saturdays ``` ### `hidden` Modifier The `hidden` modifier removes a day from the calendar. Use the `hidden` prop to specify the days to be hidden: ```tsx const hiddenDays = [ new Date(2022, 5, 10), new Date(2022, 5, 20), new Date(2022, 5, 11), ];