-
Notifications
You must be signed in to change notification settings - Fork 23
Changelog v3
- [BREAKING] Upgraded SGDS masthead to v3.26.0
-
[BREAKING] Replace SGDS masthead script injection with dynamic import from
@govtechsg/sgds-web-component- The CSP whitelist to
https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3/components/Masthead/index.umd.jscan be removed from your application
- The CSP whitelist to
- Support disabling of truncation for
InputSelect,MultiSelect,InputGroupand other dropdowns - New
titleAddonto render custom elements to the left and right of each title inLocalNav - New
customCallToActionto render custom elements in the header ofDrawer - Support specific
Paginationlayout, independent of the screen size - Add option to display
Menu.Sectionitems in a multi-column layout - Add option to display
Navbarsubmenu items in a multi-column layout
- [Security] Sanitize href in
withNotificationBannerlink attributes (#1472) - Allow
Navbarsubmenu to resize so that it fits within the screen height
- Refactor
Breadcrumbto share fade implementation withTab - [Security] Escape GitHub parameters before usage in workflow (#1472)
- [Security] Prevent command injection via shell metacharacters in target path for codemod command (#1472)
- Update fonts
- Reduce line heights for
default,bookingsgschemes - Update letter spacing for
defaultscheme - Fix incorrect letter spacing unit for
sgw-digital-lobbyscheme
- Reduce line heights for
- Adjust spacing between
Form.Labellabel and subtitle - Adjust alignment of external icon for
Typography.Link - Adjust spacing between file name and error message in
FileUpload - Support optional description, allow custom label/subtitle for description field, and make visual enhancements to
FileUpload - New
ToteBoardtheme - [a11y] Trap focus in
Navbardrawer - Allow
DataTableaction bar to appear even without selection via theenableActionBarWithoutSelectionprop - Add new illustrations for
CareerCompasstheme inErrorDisplay - Update
Toggleerror selected styling - Show chevron icon for
Navbardesktop navitem when it has a submenu - Reposition
Navbardesktop submenu for the last navitem - Accept JSX for
Accordiontitle andLinkListtitle/description - Expose standalone
Tab.TabListandTab.Panelto support custom tab composition - Add
isOptionDisabledprop to support disabling of options inSelect,RangeSelectandInputGrouplist variant - Expose
onExpandChangeforAccordionto track the accordion item state. When specified, the component becomes controlled - Update
Navbardrawer item spacing and active state for submenu item -
FullscreenImageCarouselenhancements- Support custom actions in addition to the default close, zoom and delete buttons
- Expose the top bar element (containing the file info and buttons) via
topBarRef
-
FileDownloadenhancements- Add default PDF icon thumbnail for PDF files
- Support custom click action on the card, overriding the default download behaviour
- [BREAKING] Upgraded SGDS masthead to v3.26.0
-
[BREAKING] Replace SGDS masthead script injection with dynamic import from
@govtechsg/sgds-web-component- The CSP whitelist to
https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3/components/Masthead/index.umd.jscan be removed from your application
- The CSP whitelist to
- Update text colour of disabled
TimepickerandTimeRangePickerto match other form inputs - Improve calendar display with large fonts: allow calendar content to be scrolled when the date grid overflows. Affects components with calendar dropdowns such as
DateNavigatorandDateInput - Wrap long description text in
FileUpload - Update spacing between
Textareaand its error message/character counter - Update
Buttonto use body font family across all sizes
- Improve visibility of drawing in dark mode for
ESignature - Fix input fields remaining editable when
TimeRangePickercombobox variant is disabled - Improve scrolling behaviour of
DataTablefloating action bar - Fix flash of "No results found" in
PredictiveTextInput - Keep
DataTableselect all checkbox enabled ifrowsare non-empty BUTselectedIdsis undefined - Fix persisted hover state on
Sidenavitem - Resolve React unknown attribute warning for
Navbar - [Security] Sanitize href in
withNotificationBannerlink attributes (#1472)
- [Security] Escape GitHub parameters before usage in workflow (#1472)
- [Security] Prevent command injection via shell metacharacters in target path for codemod command (#1472)
- Expose
onExpandChangeforAccordionto track the accordion item state. When specified, the component becomes controlled - Update
Navbardrawer item spacing and active state for submenu item -
FullscreenImageCarouselenhancements- Support custom actions in addition to the default close, zoom and delete buttons
- Expose the top bar element (containing the file info and buttons) via
topBarRef
-
FileDownloadenhancements- Add default PDF icon thumbnail for PDF files
- Support custom click action on the card, overriding the default download behaviour
- Update
Buttonto use body font family across all sizes
- Accept JSX for
Accordiontitle andLinkListtitle/description - Expose standalone
Tab.TabListandTab.Panelto support custom tab composition - Add
isOptionDisabledprop to support disabling of options inSelect,RangeSelectandInputGrouplist variant
- Fix persisted hover state on
Sidenavitem - Resolve React unknown attribute warning for
Navbar
- Update
Toggleerror selected styling - Show chevron icon for
Navbardesktop navitem when it has a submenu - Reposition
Navbardesktop submenu for the last navitem
- Keep
DataTableselect all checkbox enabled ifrowsare non-empty BUTselectedIdsis undefined
- Allow
DataTableaction bar to appear even without selection via theenableActionBarWithoutSelectionprop - Add new illustrations for
CareerCompasstheme inErrorDisplay
- Wrap long description text in
FileUpload - Update spacing between
Textareaand its error message/character counter
- Improve scrolling behaviour of
DataTablefloating action bar - Fix flash of "No results found" in
PredictiveTextInput
- New
ToteBoardtheme - [a11y] Trap focus in
Navbardrawer
- Update text colour of disabled
TimepickerandTimeRangePickerto match other form inputs - Improve calendar display with large fonts: allow calendar content to be scrolled when the date grid overflows. Affects components with calendar dropdowns such as
DateNavigatorandDateInput
- Fix input fields remaining editable when
TimeRangePickercombobox variant is disabled
- Update fonts
- Reduce line heights for
default,bookingsgschemes - Update letter spacing for
defaultscheme - Fix incorrect letter spacing unit for
sgw-digital-lobbyscheme
- Reduce line heights for
- Adjust spacing between
Form.Labellabel and subtitle - Adjust alignment of external icon for
Typography.Link - Adjust spacing between file name and error message in
FileUpload - Support optional description, allow custom label/subtitle for description field, and make visual enhancements to
FileUpload
- Improve visibility of drawing in dark mode for
ESignature
- New
LanguageSwitcherwth a dropdown variant and link variant - [a11y] Improve
SmartAppBanneraccessibility -
FullscreenImageCarouselenhancements- Add optional delete button
- Support custom content slots
- Add a file info bar to optionally display file name and size
- Memoise
Mastheadcomponent. This may help with edge cases where the panel collapses automatically when the parent component rerenders - [a11y] Improve
TimeslotWeekViewaccessibility - [a11y] Improve
Timetableaccessibility - [a11y] Improve
DataTableaccessibility - [a11y] Improve
TimeslotBarWeekaccessibility -
[BREAKING] Build optimisations
-
Decreased time taken for the build step and reduced package size
-
Components are no longer packaged as standalone modules, reducing duplicate code
-
β οΈ Imports are now restricted to the root@lifesg/react-design-systemor pre-defined subpath entrypoints i.e.@lifesg/react-design-system/<component>. Internal file paths that were previously accessible (e.g. deep imports into@lifesg/react-design-system/<component>/*) will throw an error -
β οΈ For consumers using Styled Components + NextJS 16 + Turbopack + Page Router, you may encounter a flash of unstyled content. Update yournext.config.tswith this flag:bundlePagesRouterDependencies: true
-
- Update SMGS theme to use BookingSG
fontScheme - Create SMGS
resourceSchemeand update SMGSErrorDisplayillustrations - Support badge counter in
Filterheader - New
CareerCompasstheme - Add new semantic colour tokens for secondary, primary strong, and brand families
- Update SPF primitive colours and semantic colours
- Support custom alt text for
Footerlogo
- Fix incorrect font weight for
Form.Textareaerror message - Update text colours for
DateInputfield - Update disabled text colour for prefilled
Timepickerfield - Fix selected value not being visible in dark mode for
InputSelect,MultiSelect,InputGroupand other dropdowns - Fix
Filterheader andFilter.Pagecontent not being visible in dark mode - Update
body-size-mdtoken for SGWDigitalLobby - Fix hover styling for today's date when unselected in
Calendar - Add background for
DataTablein empty and loading state - Fix hover behaviour for
Navbaritem link elements - Fix text colour in dark mode for dropdown's fail load state
- Update
LinkListicon size and text/icon spacing
- [a11y] Apply accessible name for
Paginationpage size picker - Narrow
ModalandModalV2child typings to support only one valid JSX childβ οΈ The children ofModalandModalV2must be a single JSX element. This must be a valid HTML element or a component that forwards ref to a valid HTML element. This element is used to determine the boundaries for overlay click detection. Fragments are not supported
- [a11y] Fix invalid accessibility tree for dropdowns and nested dropdowns
- [a11y] Ensure
Form.CustomFieldhas a unique default id - Fix issue where
PopoverTrigger's modal would close immediately on mobile - Resolve hydration warnings related to unstable id, works for React 18+ only
- Fix large popovers getting cut off in
Timetable - Fix click not triggering for
DataTableheader - Improve entrance animation for
ModalandModalV2when keyboard is open - Fix issue where date can still be hovered while calendar popup is closing in
DateInput - Fix console error where aria props are assigned to Fragments in
TextArea - Prevent
onFocusandonBlurfrom being called whenTimepickeris disabled - Disable
DataTable"Select all" header checkbox when there are emptyrows, or whenselectedIdsis not specified - Fix
Tabinitial scroll offset when it is rendered within an ancestor container with any padding or margin - Fix
Timetablecopy for plural/singular results - Apply column props for
Form.MaskedInput
- Added
min-release-agewhich requires NPMv11.10.0minimum - Bump
fabricdependency from 7.2.0 to 7.4.0 - Bump
dompurifydependency from 3.3.2 to 3.4.11
- Support custom alt text for
Footerlogo
- Fix hover behaviour for
Navbaritem link elements - Fix text colour in dark mode for dropdown's fail load state
- Update
LinkListicon size and text/icon spacing
- Fix
Tabinitial scroll offset when it is rendered within an ancestor container with any padding or margin - Fix
Timetablecopy for plural/singular results - Apply column props for
Form.MaskedInput
- Bump
dompurifydependency from 3.4.2 to 3.4.11
- Add new semantic colour tokens for primary strong and brand families
- Update SPF primitive colours and semantic colours
- Fix selected value not being visible in dark mode for
InputSelect,MultiSelect,InputGroupand other dropdowns - Fix
Filterheader andFilter.Pagecontent not being visible in dark mode - Update
body-size-mdtoken for SGWDigitalLobby - Fix hover styling for today's date when unselected in
Calendar - Add background for
DataTablein empty and loading state
- Disable
DataTable"Select all" header checkbox when there are emptyrows, or whenselectedIdsis not specified
- Restore informational fields in
package.json - Bump
fabricdependency from 7.2.0 to 7.4.0
- Support badge counter in
Filterheader - New
CareerCompasstheme - Add new secondary colour semantic tokens
- Update text colours for
DateInputfield - Update disabled text colour for prefilled
Timepickerfield
- Fix issue where date can still be hovered while calendar popup is closing in
DateInput - Fix console error where aria props are assigned to Fragments in
TextArea - Prevent
onFocusandonBlurfrom being called whenTimepickeris disabled
- Update SMGS theme to use BookingSG
fontScheme - Create SMGS
resourceSchemeand update SMGSErrorDisplayillustrations
- Improve entrance animation for
ModalandModalV2when keyboard is open
- Added
min-release-agewhich requires NPMv11.10.0minimum
-
[BREAKING] Build optimisations
-
Decreased time taken for the build step and reduced package size
-
Components are no longer packaged as standalone modules, reducing duplicate code
-
β οΈ Imports are now restricted to the root@lifesg/react-design-systemor pre-defined subpath entrypoints i.e.@lifesg/react-design-system/<component>. Internal file paths that were previously accessible (e.g. deep imports into@lifesg/react-design-system/<component>/*) will throw an error -
β οΈ For consumers using Styled Components + NextJS 16 + Turbopack + Page Router, you may encounter a flash of unstyled content. Update yournext.config.tswith this flag:bundlePagesRouterDependencies: true
-
- Fix incorrect font weight for
Form.Textareaerror message
- Fix click not triggering for
DataTableheader
- Bump
dompurifydependency from 3.3.2 to 3.4.2
- [a11y] Improve
TimeslotWeekViewaccessibility - [a11y] Improve
Timetableaccessibility
- Resolve hydration warnings related to unstable id, works for React 18+ only
- Fix large popovers getting cut off in
Timetable
- [a11y] Improve
DataTableaccessibility - [a11y] Improve
TimeslotBarWeekaccessibility
- Narrow
ModalandModalV2child typings to support only one valid JSX childβ οΈ The children ofModalandModalV2must be a single JSX element. This must be a valid HTML element or a component that forwards ref to a valid HTML element. This element is used to determine the boundaries for overlay click detection. Fragments are not supported
- [a11y] Fix invalid accessibility tree for dropdowns and nested dropdowns
- [a11y] Ensure
Form.CustomFieldhas a unique default id - Fix issue where
PopoverTrigger's modal would close immediately on mobile
- New
LanguageSwitcherwth a dropdown variant and link variant - [a11y] Improve
SmartAppBanneraccessibility -
FullscreenImageCarouselenhancements- Add optional delete button
- Support custom content slots
- Add a file info bar to optionally display file name and size
- Memoise
Mastheadcomponent. This may help with edge cases where the panel collapses automatically when the parent component rerenders
- [a11y] Apply accessible name for
Paginationpage size picker
Note
Storybook was upgraded to v10. Development now requires Node 22 minimum.
- Enhancement to
RangeSelect- Update styling to new card-based dropdown and V3 design
- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- Enhancement to
TimeRangePicker(dial) andTimePicker- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- Enhance
OtpInputto support external controls- New
otpOnlyprop to hide the action button - New
startCooldownandonCountdownChangemethods to control and track the countdown state outside of the component
- New
- Support counter offset for
Timelinenumeric variant - Add
multivariant to the Calendar to support selection of multiple dates - Expose Navbar and Button component tokens
-
FileUploadenhancements- Add default PDF icon thumbnail for PDF files
- Adjust file size text colour
- Update display of delete button for a file item with error
- Support initial scroll position in dropdown for
TimeRangePickercombobox variant - New
SMGStheme - Update semantic colour tokens for SGW Digital Lobby theme
- Support hover colour for slot in
TimeSlotBar - [a11y] Improve
LinkListaccessibility - [a11y] Improve
ErrorDisplayaccessibility - [a11y] Improve
MaskedInputaccessibility - [a11y] Improve
FeedbackRatingaccessibility - [a11y] Improve
TimePickerandTimeRangePickeraccessibility - [a11y] Improve
RangeSelectaccessibility - [a11y] Improve
RangeSliderandSlideraccessibility - [a11y] Improve
FullscreenImageCarouselaccessibility - [a11y] Improve
HistogramSlideraccessibility - [a11y] Introduce
focusableWhenDisabledprop forRadioButton,ToggleandCheckbox - [a11y] Improve accessibility of
TimeSlotBar - [a11y] Improve accessibility of
OTPVerification
- Fix incorrect text colour for
Tab.Item - Improve display of larger fonts in
DateInputandDateRangeInputinput fields
- Fix
PopoverTriggerdismissing when triggering nested floating content such as other popovers or dropdowns - Prevent submit behaviour when a button in
OtpVerificationis clicked within a form - Fix issue where the page jumps to the top when a modal is forcibly unmounted
- Improve backdrop click detection on
Overlay. This fixes an issue whereDrawerwould auto-close when users highlight text inside the drawer and drag their mouse outside of the drawerβ οΈ The children ofModalandModalV2must be a single JSX element. This must be a valid HTML element or a component that forwards ref to a valid HTML element. This element is used to determine the boundaries for overlay click detection. Fragments are not supported
- Make viewport resize detection in
ModalandModalV2more robust by listening to the scroll event
- Migrate Storybook 8 to 10
- Update
tsconfig.jsonmoduleResolutionto bundler - Bump
fabricdependency from 6.7.0 to 7.2.0 - Set
data-testidon the top-level container element forForm.MaskedInput,Form.TimePicker,Form.TimeRangePicker,Form.RangeSelect,Form.RangeSlider,Form.Slider,Form.HistogramSlider - Update
data-testidforTimeRangePicker(combobox) start and end fields:timepicker-selectorsplit totimepicker-selector-startandtimepicker-selector-end - Include the label addon as part of the input's accessible name in
InputGroup(also affectsPhoneNumberInputwith fixed country code)
- Support initial scroll position in dropdown for
TimeRangePickercombobox variant - New
SMGStheme - Update semantic colour tokens for SGW Digital Lobby theme
- Support hover colour for slot in
TimeSlotBar - [a11y] Improve accessibility of
TimeSlotBar - [a11y] Improve accessibility of
OTPVerification
- Improve display of larger fonts in
DateInputandDateRangeInputinput fields
- Make viewport resize detection in
ModalandModalV2more robust by listening to the scroll event
- Include the label addon as part of the input's accessible name in
InputGroup(also affectsPhoneNumberInputwith fixed country code)
-
FileUploadenhancements- Add default PDF icon thumbnail for PDF files
- Adjust file size text colour
- Update display of delete button for a file item with error
- [a11y] Introduce
focusableWhenDisabledprop forRadioButton,ToggleandCheckbox
- Improve backdrop click detection on
Overlay. This fixes an issue whereDrawerwould auto-close when users highlight text inside the drawer and drag their mouse outside of the drawerβ οΈ The children ofModalandModalV2must be a single JSX element. This must be a valid HTML element or a component that forwards ref to a valid HTML element. This element is used to determine the boundaries for overlay click detection. Fragments are not supported
- [a11y] Fix slider interaction on Android Talkback for
InputSlider,InputRangeSliderandHistogramSlider
- [a11y] Improve
FullscreenImageCarouselaccessibility - [a11y] Improve
HistogramSlideraccessibility
- Fix incorrect text colour for
Tab.Item
- Set
data-testidon the top-level container element forForm.HistogramSlider
- [a11y] Improve
FeedbackRatingaccessibility - [a11y] Improve
TimePickerandTimeRangePickeraccessibility - [a11y] Improve
RangeSelectaccessibility - [a11y] Improve
RangeSliderandSlideraccessibility - Add
multivariant to the Calendar to support selection of multiple dates - Expose Navbar and Button component tokens
- Prevent submit behaviour when a button in
OtpVerificationis clicked within a form - Fix issue where the page jumps to the top when a modal is forcibly unmounted
- Set
data-testidon the top-level container element forForm.TimePicker,Form.TimeRangePicker,Form.RangeSelect,Form.RangeSliderandForm.Slider - Update
data-testidforTimeRangePicker(combobox) start and end fields:timepicker-selectorsplit totimepicker-selector-startandtimepicker-selector-end
- Enhancement to
TimeRangePicker(dial) andTimePicker- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- [a11y] Improve
MaskedInputaccessibility - Support counter offset for
Timelinenumeric variant
- Fix
PopoverTriggerdismissing when triggering nested floating content such as other popovers or dropdowns
- Set
data-testidon the top-level container element forForm.MaskedInput
- [a11y] Improve
ErrorDisplayaccessibility - Enhance
OtpInputto support external controls- New
otpOnlyprop to hide the action button - New
startCooldownandonCountdownChangemethods to control and track the countdown state outside of the component
- New
Note
Storybook was upgraded to v10. Development now requires Node 22 minimum.
- Enhancement to
RangeSelect- Update styling to new card-based dropdown and V3 design
- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- [a11y] Improve
LinkListaccessibility
- Migrate Storybook 8 to 10
- Update
tsconfig.jsonmoduleResolutionto bundler - Bump
fabricdependency from 6.7.0 to 7.2.0
- Add
square-numbervariant toBadge - Support addon for
Tab.Item - Allow customisation of
TimeTablecell colours and display style - Create new font specs for OneService theme
- Add new
OTPVerificationfield for inline OTP verification of email or phone number. Note that only fixed country codes are supported for phone numbers at the moment - Update MyLegacy form typography tokens
- Support custom upload button label for
FileUpload - [a11y] Add keyboard navigation for
Menu - Migrate
Navbarsubmenu to useMenufor desktop - [a11y] Improve keyboard navigation for
Navbarsubmenu - Enhance
TextList.Ulto accept custom bullet type - Add
SGWDigitalLobbytheme - Enhance
InputGrouplist variant to supportnoBorder
- Apply viewport-specific spacing for
stretchlayouts (affectsLayout,NavbarandMasthead) - Fix invalid css from
Border.Util.solid - Update line height and letter spacing across themes to follow Figma documentation
- Extend clickable area to entire width of
Tab.Itemwhen it is wider than actual label - Fix issue where
PredictiveTextInputdoes not allow space input - [a11y] Remove unnecessary
aria-labelledbyfor an element inBoxContainer - [a11y] Hide
Navbaritem link indicator from screen readers
- [a11y] Add keyboard navigation for
Menu - Migrate
Navbarsubmenu to useMenufor desktop - [a11y] Improve keyboard navigation for
Navbarsubmenu - Enhance
TextList.Ulto accept custom bullet type - Add
SGWDigitalLobbytheme - Enhance
InputGrouplist variant to supportnoBorder
- Add new
OTPVerificationfield for inline OTP verification of email or phone number. Note that only fixed country codes are supported for phone numbers at the moment - Update MyLegacy form typography tokens
- Support custom upload button label for
FileUpload
- Update line height and letter spacing across themes to follow Figma documentation
- [a11y] Hide
Navbaritem link indicator from screen readers
- Apply viewport-specific spacing for
Masthead's stretched layout
- Fix issue where
PredictiveTextInputdoes not allow space input - Remove unnecessary
aria-labelledbyfor an element inBoxContainer
- Allow customisation of
TimeTablecell colours and display style - Create new font specs for OneService theme
- Extend clickable area to entire width of
Tab.Itemwhen it is wider than actual label
- Add
square-numbervariant toBadge - Support addon for
Tab.Item
- Apply viewport-specific spacing for
stretchlayouts (affectsLayout,NavbarandMasthead) - Fix invalid css from
Border.Util.solid
- New SPF theme
- New slash separator variant for
Breadcrumb - Enhancements to
PredictiveTextInput- Update styling to new card-based dropdown and V3 design
- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- [a11y] Improve accessibility
- Update
Footercopyright to be generic by default. The product-specific copyright are unaffected. - Introduce standalone
Filter.SidebarandFilter.Modal - Update PA colour tokens
- Introduce component tokens for
NavbarandFooter - Show scrollbar when text overflows in
Textarea - Introduce
initialScrollTimeto set the initial scroll position inTimeTableandTimeSlotBar - Add
numericvariation toTimelinecomponent - [a11y] Improve
Timelineaccessibility - [a11y] Improve
Tabaccessibility - [a11y] Improve
Popoveraccessibility - [a11y] Improve label association for select-based fields:
Form.Select,Form.MultiSelect,Form.NestedSelect,Form.NestedMultiSelectandForm.SelectHistogram - [a11y] Inject
aria-labelledbyinto the form element inForm.CustomField
- Clear hover state after
DateInputcalendar is dismissed on mobile -
[WARNING] Adjust indentation for
TextListto beem-based to accommodate large font sizes
- Hide error icon from form inputs when the error message consists of only whitespace
- Resolve
DateInputbecoming uneditable due to stale hover state on Android webview - Fix
TimeSlotBarmissing time markers for non-hourly start and end times - Restore missing props for
Filter - Skip serialisation of JSX element in
FileUploaderror announcement - Fix hydration issue due to invalid element nesting when using visually hidden elements
- Fix transient props warning for
ProgressIndicator - [a11y] Fix incorrect list item index and list size being reported for dropdowns
- Fix
onBlurevent trigger forInputGrouplist addon variant - Fix incorrect date displayed in
DateInputandDateRangeInputfield while hovering over a date in the calendar when UTC time and system time have different days - Fix
TimeRangePickercombobox dropdown not displaying correctly on smaller viewports
- Set
data-testidon the top-level container element forForm.Input,Form.PhoneNumberInput,Form.PredictiveTextInput,Form.UnitNumberInput,Form.Select,Form.MultiSelect,Form.NestedSelect,Form.NestedMultiSelectandForm.SelectHistogram - Forward
data-testidtoFilter,Filter.Sidebar(defaultfilter-desktop), andFilter.Modal's top-level container element
- Fix
onBlurevent trigger forInputGrouplist addon variant - Fix incorrect date displayed in
DateInputandDateRangeInputfield while hovering over a date in the calendar when UTC time and system time have different days
- Set
data-testidon the top-level container element forForm.Input,Form.PhoneNumberInput,Form.PredictiveTextInput, andForm.UnitNumberInput - Forward
data-testidtoFilter's top-level container element - Forward
data-testidtoFilter.Sidebar's top-level container element (defaultfilter-desktop) - Forward
data-testidtoFilter.Modal's top-level container element
- Add
numericvariation toTimelinecomponent - [a11y] Improve label association for select-based fields:
Form.Select,Form.MultiSelect,Form.NestedSelect,Form.NestedMultiSelectandForm.SelectHistogram - [a11y] Inject
aria-labelledbyinto the form element inForm.CustomField
- [a11y] Fix incorrect list item index and list size being reported for dropdowns
- Set
data-testidon the top-level container element forForm.Select,Form.MultiSelect,Form.NestedSelect,Form.NestedMultiSelectandForm.SelectHistogram
-
Filterprop handling-
[WARNING] Remove unused
insetsprop forFilter.Sidebar - Forward
className,style,idanddata-testidselectors to the top-level container element - Fix passing of
Filter.Modal-specific props toFilter.Sidebarcausing a React warning
-
[WARNING] Remove unused
- Set
data-testidon the top-level container element forForm.Input,Form.PhoneNumberInput,Form.PredictiveTextInput, andForm.UnitNumberInput - Forward
data-testidtoFilter's top-level container element - Forward
data-testidtoFilter.Sidebar's top-level container element (defaultfilter-desktop) - Forward
data-testidtoFilter.Modal's top-level container element
- Introduce
initialScrollTimeto set the initial scroll position inTimeTableandTimeSlotBar
-
[WARNING] Adjust indentation for
TextListto beem-based to accommodate large font sizes
- Restore missing props for
Filter - Skip serialisation of JSX element in
FileUploaderror announcement - Fix hydration issue due to invalid element nesting when using visually hidden elements
- Fix transient props warning for
ProgressIndicator
- Introduce component tokens for
NavbarandFooter - Show scrollbar when text overflows in
Textarea
- Resolve
DateInputbecoming uneditable due to stale hover state on Android webview - Fix
TimeSlotBarmissing time markers for non-hourly start and end times
- Update PA colour tokens
- Hide error icon from form inputs when the error message consists of only whitespace
- New SPF theme
- New slash separator variant for
Breadcrumb - Enhancements to
PredictiveTextInput- Update styling to new card-based dropdown and V3 design
- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
- [a11y] Improve accessibility
- [a11y] Improve
Timelineaccessibility - [a11y] Improve
Tabaccessibility - [a11y] Improve
Popoveraccessibility - Update
Footercopyright to be generic by default. The product-specific copyright are unaffected. - Introduce standalone
Filter.SidebarandFilter.Modal
- Clear hover state after
DateInputcalendar is dismissed on mobile
We have officially released a new major version! π
In V3, we have overhauled the design tokens and expanded theming capabilities.
Refer to this migration document for the changes that are required to upgrade from v2 to v3.
- New design tokens
- Dark mode
- Improved accessibility across components
- Support for React 19 and Styled Components 6
- [a11y] Improve
IconButtonandImageButtonaccessibility - [a11y] Improve
UnitNumberInputaccessibility - New
Tablecomponent to create tables from scratch (details)
- Let
Mastheadtake up the full width whenstretchis enabled
- Fix broken IMDA footer links
- Update
NavbarandFooterto show IMDA resources for IMDA theme - Add error icon to error messages across inputs,
FileUploadandFileDownload - [a11y] Improve
UneditableSectionaccessibility - [a11y] Improve
RadioButtonaccessibility -
[BREAKING] [a11y] Add underline style by default to
Typography.Link. This can be removed by settingunderlineStyle="none"
- Extend
FileUploadmobile layout tomdto resolve UI issues on smaller viewports
- Add primary colour variant for
PillandTag -
Filter.Checkboxenhancements- Support nested options
- Use
showAsCheckboxInMobileto display checkbox list in mobile view - Use
minimisableOptionsto hide the "View more" button
- Add component token to control
LoadingDotsSpinnercolour- LifeSG theme defaults to
brand-50 - Other themes default to
icon-primary
- LifeSG theme defaults to
- [a11y] Improve accessibility of
PhoneNumberInputandInputGrouplist variant
- Fix unreadable text in dark mode for read-only
InputGroupandPhoneNumberInput
- [a11y] Fix label association in
FileUpload - Avoid unmounting
Filterin mobile - Fix persistent scroll lock on iOS when
Overlay/Modalis forcefully unmounted
-
PhoneNumberInput- Contact number text field
data-testid:"<data-testid>"β"input" - Country code field
data-testid:"<data-testid>"β"selector" - Country code field role:
buttonβcombobox
- Contact number text field
-
InputGrouplist variant- Text field
data-testid:"<data-testid>"β"input" - List dropdown field
data-testid:"<data-testid>"β"selector" - List dropdown field role:
buttonβcombobox
- Text field
- New
IMDAtheme - New
ModalV2(details)- Provides a new compositional API that lets you combine pre-built content slots
- Supports scrolling, compared to V1 where you had to manually handle content overflow
- Comes with improved accessibility and focus trapping
-
[WARNING]
ModalAnimationDirectionimport has moved from Modal to ModalV2 -
FullscreenImageCarouselnow applies the bottom inset - Enhancement to
InputGrouplist addon variant- Update styling to new card-based dropdown and V3 design
- Fix dropdown getting cut off when it exceeds the parent container bounds
- Support auto positioning
-
PhoneNumberInputwhich is based onInputGroupalso has the above enhancement applied
- [BREAKING] Standardise all read-only inputs to align left
- Fix
Sidenavitem hover highlight persisting even after cursor leaves the item
- Add
fullWidthprop to renderUneditableSectionwithout the defaultLayout.Contentspacing
- Update styling of
OtpInput - Add padding to
DataTableaction bar's floating state - Restore scrollbar styles in
DataTableandSelectpickers
- Sync
Accordionstate between parent and children. "Show/Hide all" button now properly reflects the actual state of all items
- [a11y] Improve
Alertaccessibility - [a11y] Improve
Draweraccessibility and add focus trapping - [a11y] Improve
CountdownTimeraccessibility - Add prefix option to
OTPInput - Support custom/safe area insets in
Filtermobile mode
- Fix some text styles not being applied
- Resolve "A callback ref should not return a function" warning on React 18
-
[WARNING] Add alternative scroll lock method on iOS for
OverlayandModal. As a side effect, this resolves a cosmetic issue where the page content is visible behind the status bar and tab bar on iOS 26.
- New
Schedulecomponent (details) - Support custom clear button label in
Filter - Support custom/safe area insets in
FullscreenImageCarousel - Introduce
onModalOpentoFilter -
[WARNING] Replace
listStyleWidthwithdropdownWidthto customise the width of the dropdowns inInputSelect,MultiSelect,NestedSelect, andNestedMultiSelect -
[WARNING] Increase
lgbreakpoint from1024pxto1200px
- Disable active/hover states for
Button,Checkbox,RadioButtonandToggleon devices where the primary pointer is notfine
- [a11y] Improve
BoxContaineraccessibility - [a11y] Improve
FileUploadaccessibility - [a11y] Improve
Paginationaccessibility - [a11y] Improve
Filteraccessibility and add focus trapping in mobile modal
- Gracefully handle missing icon for
ButtonWithIcon - Resolve unknown prop warnings on styled components by marking props as transient
- Fix issue where the polymorphic
asprop was not respected byTypography - Resolve
act()warnings in unit tests
- Add React 19 support
- [BREAKING] Upgrade Styled Components to v6. Refer to the official docs for migration steps
- New shadow tokens
- Add SupportGoWhere resources in
NavbarandFooter - Support hiding of
Footerlogo - Support custom
fadeColorinTab - Support custom dropdown labels for
InputSelect,MultiSelect,NestedSelect,NestedMultiSelect-
[WARNING] The props
noResultsDescriptionandsearchPlaceholderare now undercustomLabels. The original props have been deprecated
-
[WARNING] The props
-
[WARNING] The
FilterpropsheaderTitle,toggleFilterButtonLabel, anddoneButtonLabelare now undercustomLabels. The original props have been deprecated -
[BREAKING] Rename
customLabeltocustomLabelsinLinkList - [a11y] Improve
Toastaccessibility and enhance keyboard navigation - [a11y] Improve
Pillaccessibility - [a11y] Improve
ProgressIndicatoraccessibility
- Fix unresponsive
Toggleon iOS devices
Important
Known issues with styled-components v6
- If youβre using pseudo-classes or pseudo-elements, make sure they they are prefixed with
&. You can search by this regex\s+:?:[a-zA-Z0-9]in your codebase. For example:
- :hover { }
- ::before { }
+ &:hover { }
+ &::before { }- If youβre using jest-dom
expect().toHaveStyle(), your tests may now fail due to extra whitespace, please update your assertions accordingly
- [a11y] Improve
Footeraccessibility - Introduce
onExpandCollapseChangeprop, called when "Show all"/"Hide all" is toggled inAccordion
- Fix
DateRangeInputjumping to present month when the date is cleared due to user input or when selecting a start date after the end date
- New
Menucomponent (details) - Support custom label for Done button in
Filter - Add lazy-loading mode for
LinkList -
[WARNING] Separate subtitle from label container in
Form.Labelto distinguisharia-labelledbyandaria-describedby. This affects all inputs under theFormnamespace - [a11y] Improve labelling of
Form.DateInputandForm.DateRangeInput -
Form.Input- [a11y] Improve labelling
- [WARNING] The input now remains focusable even when disabled
-
Footer- Add
showResourceAddonprop to render additional content for MyLegacy - Switch to fluid layout instead of grid
- Add
-
NotificationBanner- Support optional
icon - [a11y] Improve accessibility
- Support optional
-
LocalNav- [a11y] Improve accessibility
- [a11y] Support keyboard navigation
-
[WARNING] The
onNavItemSelectevent now includesReact.KeyboardEventin addition toReact.MouseEvent
-
Toggle- [a11y] Improve accessibility
- [a11y] Add keyboard focus style
- Fix padding of
LocalNavlink - Fix misaligned fade in
Breadcrumb
-
[WARNING] Increase
sm-maxbreakpoint from420pxto480px - Adjust cutover for
mdandlgbreakpoints to be consistent with other breakpoints - New
Badgecomponent (details) - New
Avatarcomponent (details) - Reduced toggle min width to 5rem for
Filter.Checkboxin mobile view - [a11y] Make
DataTablefocusable to support scrolling for keyboard-only users - [a11y] Improve
Sidenavaccessibility and enhance keyboard navigation
- Update
OneServicecolour tokens - Fix
info-40and CCubebrand-100colour tokens
- Ensure collapsed
Filter.Itemcontent is inaccessible - Fix missing toggles in
Filter.Checkboxwhen there are more than 5 but less than 3 rows in mobile view
- [a11y] Improve
Breadcrumb,Checkbox, andTagaccessibility -
Buttonenhancements- Improve accessibility
- Introduce
focusableWhenDisabledprop
-
Navbarenhancements- Improve accessibility
- Support Escape key press to dismiss drawer
- Support custom accessible labels for main header and mobile drawer
-
[BREAKING] Pin SGDS
Mastheadto v3 and apply SGDS day and night themes
Important
Breaking changes for Masthead and Navbar users:
If your site has previously whitelisted the script url in the Content Security Policy headers, update it to match the new value
- https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component/Masthead/index.js
+ https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3/components/Masthead/index.umd.js-
Accordionenhancements- Improve aria annotations
-
[BREAKING] Update
Accordion.Itemtitle to be wrapped in a<h3>and<button> - Support customisation of heading level
Important
Breaking changes for Accordion users:
If you are using a custom title, ensure that you are rendering it as a <span>
<Accordion.Item title={<Typography.XL inline>Item title</Typography.XL>}>
<Accordion.Item title={<span>Item title</span>}>
<Accordion.Item title={<h1 as="span">Item title</h1>}>
- Apply border for components with drop shadows in dark mode:
CardNavbarSmartAppBanner
- Adjust spacing between
Paginationelements
- Fix
Paginationtooltip position - Fix incorrect
V2_Text.Hyperlink.Smallmapping inmigrate-textcodemod - Fix missing styles for
Mastheadin dark mode, causing text to become unreadable
- [a11y] Improve
DateInputandDateRangeInputaccessibility and enhance keyboard navigation
- Use colour token for secondary
Buttonbackground - Add missing radius token usage in components
- Make collapsed
Accordion.Itemcontent inaccessible
- New
SupportGoWheretheme - Add component tokens for A11y Playground
- Upgrade to fabric 6 to resolve error in
ESignaturewhenunsafe-evalis not enabled in CSP
- New
SingpassButton(details) - Dark theme (details)
- New set of semantic colour tokens for dark mode
- New
DSThemeProviderto support automatic dark mode based on the user's preferences - Support light/dark mode-specific overrides for primitive and semantic colour tokens
- Update minor ui elements to use colour tokens in the following:
-
Breadcrumbfade effect -
Navbarbackground -
Tabsfade effect -
SelectHistogramtext
-
- Ensure
Markuprespects thebaseTextColorprop - Fix error in
SelectHistogram
- Expose
dropdownRootNodefor components using Floating UI-based dropdowns:-
DateInput,DateRangeInput DateNavigator-
InputSelect,MultiSelect,NestedSelect,NestedMultiSelect SelectHistogram
-
- Ensure search is case-insensitive in
InputSelectandMultiSelect - [a11y] Fix Chrome/Voiceover getting stuck on countdown in
OtpInput
- New
A11yPlaygroundtheme - [a11y] Improve
OtpInputaccessibility and enhance keyboard navigation - [a11y] Improve
Calendaraccessibility and support keyboard navigation
- Update
Mastheadto match new SGDS styling and align with current breakpoints - Fix missing background for the
currentvariant inTimeline
- Support custom width for
Tab.Itemtab selector - Add
maxSelectableprop to set a maximum number of options that can be selected inMultiSelect - Support optional description under the default "No results found" display in
InputSelect,MultiSelect,NestedSelect, andNestedMultiSelect
- Update PA font tokens
Note
- Node 18 reached EOL on 30 Apr 2025. You're recommended to use Node 22 as the minimum version for development
- The pipeline has been upgraded to use Node 22
- Introduce
ThemedLoadingSpinner. Details - Set up component tokens and introduce tokens for
Button
- Update
LoadingSpinnerto remove white background - Fix incorrectly migrated breakpoints in
ButtonandTimeline
-
TimeTableenhancements- Add
pendingrow cell status - Automatically block the entire row if it has no entries and
rowMinTimeandrowMaxTimeare not set - Handle slots in 15 minute intervals, automatically rounding non-standard times
- Update left border colour
- Add
- Resolve React 18+ spread key warning in unit tests for
InputSelect,MultiSelect,NestedSelect, andNestedMultiSelect
- Update PA tokens
- Add
TextListto the top-level exports
- Codemod enhancements
- Migrate
TextStyleHelper.getTextStyle()inmigrate-text - Improve handling of imports
- Migrate
- Add placeholder OneService theme
- Update PA tokens
Caution
V3 is in early alpha
- Disable common ligatures for PlusJakartaSans and Lato font
- Install
jscodeshiftbefore executing codemods - Includes changes from
v2.10.0-canary.6
Caution
V3 is in early alpha
- Update PA theme
- Enable Typescript strict mode - this should not affect you as a consumer. However, you are highly recommended to enable
strictmode (or minimallynoImplicitAny) in your project for improved type safety when accessing design tokens. - Includes changes from
v2.10.0-canary.4
Caution
V3 is in early alpha
- All components migrated to the new V3 design tokens
- Add PA theme
- Includes changes from
v2.10.0-canary.2andv2.10.0-canary.3
Caution
V3 is in early alpha and is not ready for production use
- Migrate existing components to use the new V3 design tokens
- Fixes for codemods
Caution
V3 is in early alpha and is not ready for production use
- Overhaul theming to use new standardised design tokens
- Deprecate components based on the old V2 design tokens
- New components based on the new V3 design tokens
- Codemods to support migration