Back to React Spectrum

API Changelog

packages/@react-spectrum/s2/api-diff.md

2022-12-1623.1 KB
Original Source
<!-- Copyright 2024 Adobe. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

API Changelog

This changelog documents the differences between React Spectrum v3 and Spectrum 2.

All

React Spectrum v3 style props have been replaced by the style macro across all components.

PropSpectrum 2RSP v3Comments
styles🟢 StylesPropPass the result of the style macro to this prop.
margin🔴 Responsive<DimensionValue>
marginStart🔴 Responsive<DimensionValue>
marginEnd🔴 Responsive<DimensionValue>
marginTop🔴 Responsive<DimensionValue>
marginBottom🔴 Responsive<DimensionValue>
marginX🔴 Responsive<DimensionValue>
marginY🔴 Responsive<DimensionValue>
width🔴 Responsive<DimensionValue>
height🔴 Responsive<DimensionValue>
minWidth🔴 Responsive<DimensionValue>
minHeight🔴 Responsive<DimensionValue>
maxWidth🔴 Responsive<DimensionValue>
maxHeight🔴 Responsive<DimensionValue>
flex🔴 Responsive<boolean | number | string>
flexGrow🔴 Responsive<number>
flexShrink🔴 Responsive<number>
flexBasis🔴 Responsive<number | string>
justifySelf🔴 Responsive<'auto' | 'center' | 'end' | 'flex-end' | 'flex-start' | 'left' | 'normal' | 'right' | 'self-end' | 'self-start' | 'start' | 'stretch'>
alignSelf🔴 Responsive<'auto' | 'center' | 'end' | 'flex-end' | 'flex-start' | 'normal' | 'self-end' | 'self-start' | 'start' | 'stretch'>
order🔴 Responsive<number>
gridArea🔴 Responsive<string>
gridColumn🔴 Responsive<string>
gridRow🔴 Responsive<string>
gridColumnStart🔴 Responsive<string>
gridColumnEnd🔴 Responsive<string>
gridRowStart🔴 Responsive<string>
gridRowEnd🔴 Responsive<string>
position🔴 Responsive<'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'>
zIndex🔴 Responsive<number>
top🔴 Responsive<DimensionValue>
bottom🔴 Responsive<DimensionValue>
start🔴 Responsive<DimensionValue>
end🔴 Responsive<DimensionValue>
left🔴 Responsive<DimensionValue>
right🔴 Responsive<DimensionValue>
isHidden🔴 Responsive<boolean>

Badge

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
variant🟢 'accent' | 'blue' | 'brown' | 'celery' | 'chartreuse' | 'cinnamon' | 'cyan' | 'fuchsia' | 'gray' | 'green' | 'indigo' | 'informative' | 'magenta' | 'negative' | 'neutral' | 'notice' | 'orange' | 'pink' | 'positive' | 'purple' | 'red' | 'seafoam' | 'silver' | 'turquoise' | 'yellow'🔴 'fuchsia' | 'indigo' | 'info' | 'magenta' | 'negative' | 'neutral' | 'positive' | 'purple' | 'seafoam' | 'yellow'

Button

PropSpectrum 2RSP v3Comments
form🟢 string
formAction🟢 string
formEncType🟢 string
formMethod🟢 string
formNoValidate🟢 boolean
formTarget🟢 string
name🟢 string
value🟢 string
slot🟢 null | string
variant🟢 'accent' | 'negative' | 'primary' | 'secondary'🔴 'accent' | 'negative' | 'primary' | 'secondary' | LegacyButtonVariantNote that the deprecated cta and overBackground variants are no longer supported. Please use accent and primary + staticColor: 'white' as replacements respectively.
fillStyle🟢 'fill' | 'outline'This prop replaces v3's style prop.
size🟢 'L' | 'M' | 'S' | 'XL'
style🔴 'fill' | 'outline'This prop is replaced by the fillStyle prop.
isPending🔴 booleanNot yet implemented in S2.
isQuiet🔴 booleanNot supported in S2 design.
href🔴 stringThis prop has been removed in favor of the new LinkButton component.
target🔴 stringThis prop has been removed in favor of the new LinkButton component.
rel🔴 stringThis prop has been removed in favor of the new LinkButton component.
elementType🔴 ElementType | JSXElementConstructor<any>Not supported in S2.

ActionButton

PropSpectrum 2RSP v3Comments
form🟢 string
formAction🟢 string
formEncType🟢 string
formMethod🟢 string
formNoValidate🟢 boolean
formTarget🟢 string
name🟢 string
value🟢 string
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL' | 'XS'

ToggleButton

PropSpectrum 2RSP v3Comments
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL' | 'XS'

Avatar

PropSpectrum 2RSP v3Comments
size🟢 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96 | 112 | number🔴 'avatar-size-100' | 'avatar-size-200' | 'avatar-size-300' | 'avatar-size-400' | 'avatar-size-50' | 'avatar-size-500' | 'avatar-size-600' | 'avatar-size-700' | 'avatar-size-75' | string | numberNamed sizes have been replaced with pixel values.
isOverBackground🟢 boolean
isDisabled🔴 booleanFocusable/interactive Avatars aren't supported in S2 yet.
PropSpectrum 2RSP v3Comments
dependencies🟢 Array<any>
slot🟢 null | string
size🟢 'L' | 'M'🔴 'L' | 'M' | 'S'Small is no longer supported in Spectrum Design.
showRoot🔴 booleanNot yet implemented in S2.
isMultiline🔴 booleanNot yet implemented in S2.
autoFocusCurrent🔴 booleanNot yet implemented in S2.

ButtonGroup

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
slot🟢 null | string

Checkbox

PropSpectrum 2RSP v3Comments
inputRef🟢 RefObject<HTMLInputElement | null>
size🟢 'L' | 'M' | 'S' | 'XL'

CheckboxGroup

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'

ColorArea

PropSpectrum 2RSP v3Comments
slot🟢 null | string
size🔴 DimensionValueSet size via style macro instead.

ColorWheel

PropSpectrum 2RSP v3Comments
size🟢 number🔴 DimensionValueUse pixel values instead.
slot🟢 null | string

ColorSlider

PropSpectrum 2RSP v3Comments
label🟢 string🔴 ReactNode
slot🟢 null | string
showValueLabel🔴 booleanRemoved for accessibility reasons.

ColorField

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isInvalid🟢 boolean
slot🟢 null | string
isQuiet🔴 booleanNot supported in S2 design.
placeholder🔴 stringRemoved for accessibility reasons.
validationState🔴 ValidationStateUse isInvalid instead.

ColorSwatch

PropSpectrum 2RSP v3Comments
slot🟢 null | string

ComboBox

PropSpectrum 2RSP v3Comments
menuWidth🟢 number🔴 DimensionValueThis accepts pixel values in S2.
isInvalid🟢 boolean
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL'
isQuiet🔴 booleanNot supported in S2 design.
loadingState🔴 LoadingStateNot yet implemented in S2.
placeholder🔴 stringRemoved for accessibility reasons.
validationState🔴 ValidationStateUse isInvalid instead.
onLoadMore🔴 () => anyNot yet implemented in S2.

ContextualHelp

PropSpectrum 2RSP v3Comments
size🟢 'S' | 'XS'

Dialog

PropSpectrum 2RSP v3Comments
children🟢 (DialogRenderProps) => ReactNode | ReactNode🔴 ReactNodeClose function moved from DialogTrigger to Dialog.
slot🟢 null | string
onDismiss🔴 () => voidUse onOpenChange on the DialogTrigger or onDismiss on the DialogContainer instead.

DialogTrigger

PropSpectrum 2RSP v3Comments
type🟢 'fullscreen' | 'fullscreenTakeover' | 'modal' | 'popover'🔴 'fullscreen' | 'fullscreenTakeover' | 'modal' | 'popover' | 'tray'Tray not yet implemented in S2.
mobileType🔴 'fullscreen' | 'fullscreenTakeover' | 'modal' | 'tray'Not yet implemented in S2.
targetRef🔴 RefObject<HTMLElement>No longer supported in S2.
children🟢 ReactNode🔴 [ReactElement, ReactElement | SpectrumDialogClose]Close function moved from DialogTrigger to Dialog.

Divider

PropSpectrum 2RSP v3Comments
staticColor🟢 'black' | 'white'

Form

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isQuiet🔴 booleanNot supported in S2 design.
isReadOnly🔴 booleanNot yet implemented in S2.
validationState🔴 ValidationStateNo longer supported in S2.
validationBehavior🔴 'aria' | 'native'Not yet implemented in S2.

IllustratedMessage

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S'
orientation🟢 'horizontal' | 'vertical'

InlineAlert

PropSpectrum 2RSP v3Comments
variant🟢 'informative' | 'negative' | 'neutral' | 'notice' | 'positive'🔴 'info' | 'negative' | 'neutral' | 'notice' | 'positive'
fillStyle🟢 'boldFill' | 'border' | 'subtleFill'
PropSpectrum 2RSP v3Comments
slot🟢 null | string
variant🟢 'primary' | 'secondary'🔴 'overBackground' | 'primary' | 'secondary'Use staticColor to replace overBackground.
staticColor🟢 'black' | 'white'
isStandalone🟢 boolean

Meter

PropSpectrum 2RSP v3Comments
slot🟢 null | string
variant🟢 'informative' | 'negative' | 'notice' | 'positive'🔴 'critical' | 'informative' | 'positive' | 'warning'
size🟢 'L' | 'M' | 'S' | 'XL'🔴 'L' | 'S'
staticColor🟢 'black' | 'white'
labelPosition🔴 LabelPositionNot yet implemented in S2.
showValueLabel🔴 booleanRemoved for accessibility reasons.
PropSpectrum 2RSP v3Comments
closeOnSelect🔴 booleanNot yet implemented in S2.
PropSpectrum 2RSP v3Comments
targetKey🔴 Key
PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
slot🟢 null | string
onScroll🟢 (UIEvent<Element>) => void

ActionMenu

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
closeOnSelect🔴 booleanNot yet implemented in S2.
trigger🔴 MenuTriggerTypeNot yet implemented in S2.

NumberField

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isInvalid🟢 boolean
slot🟢 null | string
isQuiet🔴 booleanNot supported in S2 design.
validationState🔴 ValidationStateUse isInvalid instead.

Picker

PropSpectrum 2RSP v3Comments
menuWidth🟢 number🔴 DimensionValueThis accepts pixel values in S2.
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL'
isQuiet🔴 booleanNot supported in S2 design.
validationState🔴 ValidationStateUse isInvalid instead.
isLoading🔴 booleanNot yet implemented in S2.
onLoadMore🔴 () => anyNot yet implemented in S2.

ProgressBar

PropSpectrum 2RSP v3Comments
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL'🔴 'L' | 'S'
variant🔴 'overBackground'Use staticColor to replace overBackground.
labelPosition🔴 LabelPositionNot yet implemented in S2.
showValueLabel🔴 booleanRemoved for accessibility reasons.

ProgressCircle

PropSpectrum 2RSP v3Comments
slot🟢 null | string
variant🔴 'overBackground'Use staticColor to replace overBackground.

Radio

PropSpectrum 2RSP v3Comments
inputRef🟢 RefObject<HTMLInputElement | null>
slot🟢 null | string

RadioGroup

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
slot🟢 null | string
validationState🔴 ValidationStateUse isInvalid instead.
showErrorIcon🔴 booleanRemoved for accessibility reasons.

SearchField

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isInvalid🟢 boolean
slot🟢 null | string
placeholder🔴 stringRemoved for accessibility reasons.
icon🔴 ReactElement | nullNot yet implemented in S2.
isQuiet🔴 booleanNot supported in S2 design.
validationState🔴 ValidationStateUse isInvalid instead.

Slider

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
labelAlign🟢 Alignment
isEmphasized🟢 boolean
trackStyle🟢 'thick' | 'thin'
thumbStyle🟢 'default' | 'precise'
slot🟢 null | string
isFilled🔴 booleanAlways filled in S2 design.
trackGradient🔴 Array<string>Not supported in S2 design.
showValueLabel🔴 booleanRemoved for accessibility reasons.
getValueLabel🔴 (number) => stringNot yet implemented in S2.
orientation🔴 OrientationNot yet implemented in S2.

RangeSlider

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
labelAlign🟢 Alignment
isEmphasized🟢 boolean
trackStyle🟢 'thick' | 'thin'
thumbStyle🟢 'default' | 'precise'
slot🟢 null | string
showValueLabel🔴 booleanRemoved for accessibility reasons.
getValueLabel🔴 (RangeValue<number>) => stringNot yet implemented in S2.
orientation🔴 OrientationNot yet implemented in S2.

StatusLight

PropSpectrum 2RSP v3Comments
variant🟢 'brown' | 'celery' | 'chartreuse' | 'cinnamon' | 'cyan' | 'fuchsia' | 'indigo' | 'informative' | 'magenta' | 'negative' | 'neutral' | 'notice' | 'pink' | 'positive' | 'purple' | 'seafoam' | 'silver' | 'turquoise' | 'yellow'🔴 'celery' | 'chartreuse' | 'fuchsia' | 'indigo' | 'info' | 'magenta' | 'negative' | 'neutral' | 'notice' | 'positive' | 'purple' | 'seafoam' | 'yellow'
size🟢 'L' | 'M' | 'S' | 'XL'
isDisabled🔴 booleanNot supported in S2 design.

Switch

PropSpectrum 2RSP v3Comments
inputRef🟢 RefObject<HTMLInputElement | null>
slot🟢 null | string
size🟢 'L' | 'M' | 'S' | 'XL'

TabList

PropSpectrum 2RSP v3Comments
aria-label🟢 string
aria-labelledby🟢 string
aria-describedby🟢 string
aria-details🟢 string
dependencies🟢 Array<any>
items🟢 Iterable<T>
id🔴 string

Tabs

PropSpectrum 2RSP v3Comments
slot🟢 null | string
items🔴 Iterable<{}>Pass items to TabList instead.
isQuiet🔴 booleanNot supported in S2 design.
isEmphasized🔴 booleanNot supported in S2 design.
disallowEmptySelection🔴 booleanTabs always disallow empty selection.

TabPanels

This component has been removed in S2. Provide <TabPanel> elements as direct children of <Tabs> instead.

TagGroup

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S'
isEmphasized🟢 boolean
actionLabel🔴 stringUse groupActionLabel instead.
onAction🔴 () => voidUse onGroupAction instead.
groupActionLabel🟢 string
onGroupAction🟢 () => void
selectionBehavior🟢 SelectionBehavior
disabledKeys🟢 Iterable<Key>
selectionMode🟢 SelectionMode
disallowEmptySelection🟢 boolean
selectedKeys🟢 'all' | Iterable<Key>
defaultSelectedKeys🟢 'all' | Iterable<Key>
onSelectionChange🟢 (Selection) => void
slot🟢 null | string
validationState🔴 ValidationStateUse isInvalid instead.

TextArea

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isInvalid🟢 boolean
slot🟢 null | string
icon🔴 ReactElement | nullNot yet implemented in S2.
isQuiet🔴 booleanNot supported in S2 design.
placeholder🔴 stringRemoved for accessibility reasons.
validationState🔴 ValidationStateUse isInvalid instead.

TextField

PropSpectrum 2RSP v3Comments
size🟢 'L' | 'M' | 'S' | 'XL'
isInvalid🟢 boolean
slot🟢 null | string
icon🔴 ReactElement | nullNot yet implemented in S2.
isQuiet🔴 booleanNot supported in S2 design.
placeholder🔴 stringRemoved for accessibility reasons.
validationState🔴 ValidationStateUse isInvalid instead.

Tooltip

PropSpectrum 2RSP v3Comments
variant🔴 'info' | 'negative' | 'neutral' | 'positive'Not supported in S2 design.
placement🔴 'bottom' | 'end' | 'left' | 'right' | 'start' | 'top'Use TooltipTrigger's placement instead
showIcon🔴 booleanNot supported in S2 design.
isOpen🔴 booleanShould be passed to TooltipTrigger instead.
id🔴 string

TooltipTrigger

PropSpectrum 2RSP v3Comments
placement🟢 'bottom' | 'end' | 'left' | 'right' | 'start' | 'top'🔴 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'

Item

The v3 Item component has been split into multiple components depending on the type of collection it is within. These include:

  • MenuItem
  • PickerItem
  • ComboBoxItem
  • Breadcrumb
  • Tag

In addition, the key prop has been renamed to id on all item components.

Section

The v3 Section component has been split into multiple components depending on the type of collection it is within. These include:

  • MenuSection
  • PickerSection
  • ComboBoxSection

The section components accept a Header as a child instead of a title prop. Both a heading and description are now supported within a section header.

jsx
<MenuSection>
  <Header>
    <Heading>Publish and export</Heading>
    <Text slot="description">Social media, other formats</Text>
  </Header>
  <MenuItem>Item</MenuItem>
</MenuSection>