Workday Canvas

Year Picker

Year Pickers allow users to select a specific year.

Note

Our Year Picker utilizes a native iOS menu component to align with our Date Picker which provides a more familiar and expected date selection experience for our users. All behaviors and interactions follow the default native iOS guidelines.

Anatomy

Anatomy of the year picker input view

Anatomy of the year picker with the year 2025 selected

  1. Input: Invokes the picker when tapped.
  2. Pill: Displays the selected year.
  3. Picker Allows selection of a single year.
  4. Selected Date: Signifies which year is currently selected.

Usage Guidance

When to Use

  • When a year-only based date is needed.
  • When selecting a date within a few years. Selecting dates far in the past or present may be hard to navigate for some users. When pickers open they default to the current year.

When to Consider Something Else

  • Use the keyboard style Date Input when entering dates that are familiar to the user, like birthdays; or dates that are far out, beyond a few years.
  • If a more granular determinate time frame is needed (ie. months, days, minutes, etc.) use either Date Picker or Time Picker instead.
  • If an indeterminate time frame is needed use Date Input.

API Guidelines

Methods

Class name: LabeledYearPicker
Module name: UIComponentsPlugin

public init( selection: Binding<Int?>, calendar: Calendar = .init(identifier: .gregorian), label: String, helperText: String?, context: Binding<SemanticContext>, localizer: LocalizationAdapting, contentInsetsOverride: EdgeInsets? = nil, featureData: FeatureMetricsData )

Parameters

NameDescriptionDefault values
selectionOptional year selected by the user. This parameter provides a means of passing back the user selection back to the features that are using this component. When the component loads, we display this as the current selection and fall back on the current year if this field does not have a value.
calendarThe Calendar used as reference for dates. Defaults to Gregorian..init(identifier: .gregorian)
labelLabel to be positioned above field, already localized.
helperTextHelper text below field, already localized.
contextSemanticContext of the field.
localizerLocalizer for the field.
contentInsetsOverrideOptional content insets, if not provided we default to the component’s internal padding.nil
featureDataThe feature name/context and the screen ID in which the component appears.

Accessibility Guidelines

Coming soon!

Content Guidelines

  • Labels for Year Pickers are written in the title case.
  • Use helper text to instruct the user what the proper input may be.
  • Use placeholder text only to provide examples of proper inputs. Never use placeholder text to help instruct users.

Can't Find What You Need?

Check out our FAQ section which may help you find the information you're looking for. For further information, contact the #ask-canvas-design or #ask-canvas-kitchannels on Slack.

On this Page: