react-spectrum
react-spectrum copied to clipboard
Segmented control
Closes
โ Pull Request Checklist:
- [ ] Included link to corresponding React Spectrum GitHub Issue.
- [ ] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [ ] Filled out test instructions.
- [ ] Updated documentation (if it already exists for this component).
- [ ] Looked at the Accessibility Practices for this feature - Aria Practices
๐ Test Instructions:
๐งข Your Project:
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
Not sure what's going on, but there's a wiggle in the animation.
Maybe try transform-origin: left / transform-origin: right ?
Build successful! ๐
Build successful! ๐
Build successful! ๐
Build successful! ๐
## API Changes
@react-spectrum/s2
/@react-spectrum/s2:SegmentedControl
+SegmentedControl {
+ UNSAFE_className?: string
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-errormessage?: string
+ aria-label: string
+ aria-labelledby?: string
+ children: ReactNode
+ defaultValue?: string | null
+ id?: string
+ isDisabled?: boolean
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (string) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ slot?: string | null
+ styles?: StylesProp
+ value?: string | null
+}
/@react-spectrum/s2:SegmentedControlItem
+SegmentedControlItem {
+ UNSAFE_className?: string
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ children: ReactNode
+ id?: string
+ inputRef?: RefObject<HTMLInputElement | null>
+ isDisabled?: boolean
+ onBlur?: (FocusEvent<Target>) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ slot?: string | null
+ styles?: StylesProp
+ value: string
+}
/@react-spectrum/s2:SegmentedControlContext
+SegmentedControlContext {
+ UNTYPED
+}
/@react-spectrum/s2:SegmentedControlProps
+SegmentedControlProps {
+ UNSAFE_className?: string
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-errormessage?: string
+ aria-label: string
+ aria-labelledby?: string
+ children: ReactNode
+ defaultValue?: string | null
+ id?: string
+ isDisabled?: boolean
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (string) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ slot?: string | null
+ styles?: StylesProp
+ value?: string | null
+}
/@react-spectrum/s2:SegmentedControlItemProps
+SegmentedControlItemProps {
+ UNSAFE_className?: string
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ children: ReactNode
+ id?: string
+ inputRef?: RefObject<HTMLInputElement | null>
+ isDisabled?: boolean
+ onBlur?: (FocusEvent<Target>) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ slot?: string | null
+ styles?: StylesProp
+ value: string
+}