An official website of the United States government
Here's how you know
Official websites use .gov A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
An official website of the United States government
Here's how you know
Official websites use .gov A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
The Month Picker component renders a grid of checkboxes with shortened month names as well as buttons for selecting or deselecting all. For internationalization one can pass a locale prop, and the month names will change to match the language of the locale. Full month names are also included as aria-label attributes.
Loading
Code
React
See Storybook for React guidance of this component.
Web Component
See Storybook for Web Component guidance of this component.
Style customization
The following CSS variables can be overridden to customize MonthPicker fields:
CSS variables for choice
Variable
Default Core Theme Value
--choice__background-color
--color-background
--choice__background-color--checked
--color-primary
--choice__background-color--inverse
--color-transparent
--choice__border-color
--color-base
--choice__border-color--checked
--color-primary
--choice__border-color--error
--color-base
--choice__border-color--error--inverse
--color-white
--choice__border-color--inverse
--color-white
--choice__border-color--left
--color-primary
--choice__border-radius
0px
--choice__border-width
2px
--choice__color--unchecked
--color-white
--choice__color--disabled
--color-muted
--choice__size--small
20px
--choice__size-radio
22px
--choice__size-radio--small
12px
--choice-label__color--disabled
--color-muted
--choice-label__color--disabled--inverse
--color-muted-inverse
--choice-label__top-offset
0.25rem
--choice__background-color--disabled
--color-gray-lighter
--choice__border-color--disabled
--color-gray-light
--choice__border-color--focus
--color-primary-darker
--choice__border-color--disabled--inverse
--color-gray-light
--choice__size
32px
--choice__background-color--disabled--inverse
#e9ecf126
--choice-wrapper__gap
0.5rem
--choice-wrapper__gap--small
0.5rem
Form components
This component also makes use of form field styles, which can be customized by the following variables: