Description
With #13229 we got the proper infrastructure to present our demos both in JavaScript and TypeScript. We want to continue this effort with the goal to have all demos available in TypeScript.
If you want to make contributions to this repository and know a bit of TypeScript we would appreciate you helping us.
Getting started
TL;DR: Use #14739, #14485 or #14535 as example workflows.
- Set up your fork (See 'getting started" in the contributing guide).
- Choose a demo you want to convert. For this example, we'll use: https://next.material-ui.com/demos/lists/#nested-list
- go to
./docs/src/pages/demos/lists/lists.md
and find the section. You're looking for a{{ "demo": "some-path" }}
block:
{{"demo": "pages/demos/lists/NestedList.js"}}
^^^ Name of the demo file in `./docs/src/pages/demos/lists/`
- Copy this file into the same directory and change the extension to
.tsx
- Add types
- run
yarn docs:typescript:check
to verify your work - Submit a PR
While working
If you're stuck at any point and the type checker will not let your code pass you can still submit the PR. A maintainer will take a look and provide guidance.
It's important that you don't change any behavior. To verify this you can run yarn docs:typescript:formatted
. This will transpile the typescript demos to JavaScript. This should not cause changes in any JavaScript file. It is possible, however, that this will uncover a bug, at which point a change to the JavaScript version is more than welcome. You may encounter some changes in whitespace (mainly added or removed lines). Changes to the JavaScript file are perfectly fine in this case.
Work Items
Missing
-
components/steppers:
- SwipeableTextMobileStepper [docs] Add SwipeableTextMobileStepper demo #18503
done
done
-
components/app-bar:
- BackToTop
- BottomAppBar
- ButtonAppBar
- DenseAppBar
- ElevateAppBar [AppBar] Hide and Elevate on Scroll #15522
- HideAppBar [AppBar] Hide and Elevate on Scroll #15522
- MenuAppBar
- PrimarySearchAppBar
- SearchAppBar
-
components/autocomplete:
- IntegrationAutosuggest [docs] Convert react-autosuggest demo to TypeScript #15485
- IntegrationDownshift [docs] Add remaining TypeScript component demos #15755
- IntegrationReactSelect [MenuItem] Add buttonRef (and other button props) type #14772
-
components/avatars [docs] Add Avatar TypeScript demos #14954:
- IconAvatars
- ImageAvatars
- LetterAvatars
-
components/badges:
- BadgeAlignment
- BadgeMax [docs] Add Badge Typescript demo for Maximum Value #15013
- BadgeOverlap
- BadgeVisibility [docs] Add Badge TypeScript demo #14969
- CustomizedBadges
- DotBadge [docs] Add Badge TypeScript demo #14969
- SimpleBadge [docs] Add Badge TypeScript demo #14969
-
components/bottom-navigation [docs] BottomNavigation TypeScript docs #14979:
- LabelBottomNavigation
- SimpleBottomNavigation
-
components/breadcrumbs [docs] Add Breadcrumbs TypeScript demos #15139:
- CollapsedBreadcrumbs
- CustomizedBreadcrumbs
- CustomSeparator
- IconBreadcrumbs
- RouterBreadcrumbs
- SimpleBreadcrumbs
-
components/buttons:
- ButtonBases
- ButtonSizes
- ContainedButtons
- CustomizedButtons
- FloatingActionButtons
- FloatingActionButtonZoom
- GroupedButtons
- IconButtons
- IconLabelButtons
- OutlinedButtons
- SplitButton [docs] Add TS demos for SplitButton in components/buttons #17862
- TextButtons
-
components/cards:
- ImgMediaCard [docs] Add ImgMediaCard TypeScript demo #15130
- MediaCard [docs] Add some Card TypeScript demos #15011
- MediaControlCard [docs] Add some Card TypeScript demos #15011
- RecipeReviewCard [docs] Add some Card TypeScript demos #15011
- SimpleCard [docs] Add some Card TypeScript demos #15011
-
components/checkboxes:
- Checkboxes [docs] Add Checkbox TypeScript demo #15222
- CheckboxesGroup [docs] Add CheckboxesGroup TypeScript demo #15228
- CheckboxLabels [docs] Add CheckboxLabel TypeScript demo #15237
- CustomizedCheckbox
- FormControlLabelPosition [docs] Add TS demo for FormControlLabelPosition #17964
-
components/chips:
- Chips [Chip] Enable generic props #15052
- ChipsArray [docs] Add Chip TypeScript demo for Chip array #15050
- OutlinedChips [Chip] Enable generic props #15052
- SmallChips
- SmallOutlinedChips
-
components/click-away-listener:
-
components/container [docs] Migrate batch of demos to hooks/typescript #16322:
- FixedContainer
- SimpleContainer
-
components/dialogs:
- AlertDialog [docs] Add most Dialog TypeScript demos #15271
- AlertDialogSlide [docs] Add most Dialog TypeScript demos #15271
- ConfirmationDialog [DialogContent] Add divider prop type for TypeScript #15273
- CustomizedDialogs
- DraggableDialog [docs] Add most Dialog TypeScript demos #15271
- FormDialog [docs] Add most Dialog TypeScript demos #15271
- FullScreenDialog [docs] Add most Dialog TypeScript demos #15271
- MaxWidthDialog [Select] Fix incorrect event.target type in onChange #15272
- ResponsiveDialog [docs] Add most Dialog TypeScript demos #15271
- ScrollDialog [docs] Add most Dialog TypeScript demos #15271
- SimpleDialog [docs] Add most Dialog TypeScript demos #15271
-
components/dividers [docs] Add TypeScript demos for Dividers #15037:
- InsetDividers
- ListDividers
- MiddleDividers
- SubheaderDividers
- VerticalDividers
-
components/drawers:
- ClippedDrawer [docs] Add ClippedDrawer TypeScript demo #15284
- MiniDrawer [docs] Add most Drawer TypeScript demos #15119
- PermanentDrawerLeft [docs] Add most Drawer TypeScript demos #15119
- PermanentDrawerRight [docs] Add most Drawer TypeScript demos #15119
- PersistentDrawerLeft [docs] Add most Drawer TypeScript demos #15119
- PersistentDrawerRight [docs] Add most Drawer TypeScript demos #15119
- ResponsiveDrawer [docs] Add most Drawer TypeScript demos #15119
- SwipeableTemporaryDrawer [docs] Add most Drawer TypeScript demos #15119
- TemporaryDrawer [docs] Add most Drawer TypeScript demos #15119
-
components/expansion-panels [docs] Add ExpansionPanels TypeScript Demo #15162:
- ControlledExpansionPanels
- CustomizedExpansionPanels
- DetailedExpansionPanel
- SimpleExpansionPanel
-
components/grid-list [docs] Add Grid List TypeScript demos #15118:
- AdvancedGridList
- ImageGridList
- SingleLineGridList
- TitlebarGridList
-
components/grid:
- AutoGrid
- AutoGridNoWrap
- CenteredGrid
- ComplexGrid [docs] Migrate Grid demos to hooks #15970
- CSSGrid
- FullWidthGrid
- InteractiveGrid
- NestedGrid
- SpacingGrid
-
components/hidden:
- BreakpointDown
- BreakpointOnly
- BreakpointUp
- GridIntegration
-
components/icons:
- FontAwesome
- Icons
- SvgIcons
- SvgMaterialIcons
-
components/links:
-
components/lists:
- AlignItemsList [docs] Add some List Typescript demos #15323
- CheckboxList [docs] Add some List Typescript demos #15323
- CheckboxListSecondary [docs] Add some List Typescript demos #15323
- FolderList [docs] Add some List Typescript demos #15323
- InsetList [docs] Add some List Typescript demos #15323
- InteractiveList [docs] Add Interactive List TypeScript demos #15416
- NestedList [docs] Add Nested List and Switch List Secondary TypeScript demos #15493
- PinnedSubheaderList [docs] Add some List Typescript demos #15323
- SelectedListItem [docs] Add Selected List Item to TypeScript demos #15417
- SimpleList
- SwitchListSecondary [docs] Add Nested List and Switch List Secondary TypeScript demos #15493
- VirtualizedList
-
components/menus:
- CustomizedMenus
- FadeMenu
- LongMenu
- MenuListComposition
- SimpleListMenu
- SimpleMenu
- TypographyMenu
- MenuPopupState (no types for material-ui-popup-state, try to move the solve the problem in the core)
-
components/modal:
- ServerModal
- SimpleModal
- SpringModal
- TransitionsModal
-
components/no-ssr:
-
components/paper:
- PaperSheet
-
components/pickers [docs] Add Pickers TypeScript demos #15103:
- DateAndTimePickers
- DatePickers
- MaterialUIPickers
- TimePickers
-
components/popover [docs] Migrate batch of demos to hooks/typescript #16322:
- MouseOverPopover
- SimplePopover
- PopoverPopupState (no types for material-ui-popup-state, try to move the solve the problem in the core)
-
components/popper:
- FakedReferencePopper [docs] Migrate batch of demos to hooks/typescript #16322
- MinimalPopper [docs] Migrate batch of demos to hooks/typescript #16322
- NoTransitionPopper [docs] Migrate batch of demos to hooks/typescript #16322
- PositionedPopper [docs] Migrate batch of demos to hooks/typescript #16322
- SimplePopper [Popper] Fix anchorEl prop types #16004
- PopperPopupState (no types for material-ui-popup-state, try to move the solve the problem in the core)
-
components/portal:
- SimplePortal
-
components/progress:
- CircularDeterminate [docs] Add most Progress TypeScript demos #15104
- CircularIndeterminate [docs] Add most Progress TypeScript demos #15104
- CircularIntegration [docs] Add most Progress TypeScript demos #15104
- CircularStatic [docs] Add most Progress TypeScript demos #15104
- CircularUnderLoad [docs] Add most Progress TypeScript demos #15104
- CustomizedProgressBars
- DelayingAppearance [docs] Add DelayingApperance TypeScript demo #15551
- LinearBuffer [docs] Add most Progress TypeScript demos #15104
- LinearDeterminate [docs] Add most Progress TypeScript demos #15104
- LinearIndeterminate [docs] Add most Progress TypeScript demos #15104
- LinearQuery [docs] Add most Progress TypeScript demos #15104
-
components/radio-buttons:
- CustomizedRadios
- FormControlLabelPosition
- RadioButtons
- RadioButtonsGroup
-
components/rating:
- CustomizedRatings
- HalfRating
- HoverRating
- RatingSize
- SimpleRating
-
components/selects [docs] Add Select TypeScript demos #15288:
- ControlledOpenSelect
- CustomizedSelects
- DialogSelect
- MultipleSelect
- NativeSelects
- SimpleSelect
-
components/skeleton:
- YouTube
-
components/slider:
- ContinuousSlider
- CustomizedSlider
- DiscreteSlider
- InputSlider
- RangeSlider
- TrackFalseSlider
- TrackInvertedSlider
- VerticalSlider
-
components/snackbars [docs] Add Snackbars TypeScript Demos #15087:
- ConsecutiveSnackbars
- CustomizedSnackbars
- DirectionSnackbar
- FabIntegrationSnackbar
- IntegrationNotistack
- LongTextSnackbar
- PositionedSnackbar
- SimpleSnackbar
- TransitionsSnackbar
-
components/speed-dial:
- OpenIconSpeedDial
- SpeedDials
- SpeedDialTooltipOpen
-
components/steppers:
- CustomizedSteppers
- DotsMobileStepper [docs] Adding Most Stepper Typescript Demos #15223
- HorizontalLinearAlternativeLabelStepper [docs] Adding Most Stepper Typescript Demos #15223
- HorizontalLinearStepper [docs] Adding Most Stepper Typescript Demos #15223
- HorizontalNonLinearAlternativeLabelStepper [docs] Adding Most Stepper Typescript Demos #15223
- HorizontalNonLinearStepper [docs] Adding Most Stepper Typescript Demos #15223
- HorizontalNonLinearStepperWithError [docs] Adding Most Stepper Typescript Demos #15223
- ProgressMobileStepper [docs] Adding Most Stepper Typescript Demos #15223
- TextMobileStepper [docs] Adding Most Stepper Typescript Demos #15223
- VerticalLinearStepper [docs] Adding Most Stepper Typescript Demos #15223
-
components/switches:
- CustomizedSwitches
- FormControlLabelPosition
- Switches
- SwitchesGroup
- SwitchesSize
- SwitchLabels
-
components/tables:
- AcccessibleTable
- CustomizedTables
- CustomPaginationActionsTable [docs] More Table TypeScript demos #15086
- DenseTable [docs] More Table TypeScript demos #15086
- EnhancedTable [docs] Add remaining TypeScript component demos #15755
- MaterialTableDemo [docs] Add TS demo for MaterialTable #17938
- ReactVirtualizedTable [docs] Add remaining TypeScript component demos #15755
- SimpleTable [docs] Add TypeScript demos for Simple and Spanning Table #14985
- SpanningTable [docs] Add TypeScript demos for Simple and Spanning Table #14985
- StickyHeadTable
-
components/tabs [docs] Add Tabs TypeScript demo #15053:
- CenteredTabs
- CustomizedTabs
- DisabledTabs
- FullWidthTabs
- IconLabelTabs
- IconTabs
- NavTabs
- ScrollableTabsButtonAuto
- ScrollableTabsButtonForce
- ScrollableTabsButtonPrevent
- SimpleTabs
- TabsWrappedLabel
- VerticalTabs
-
components/text-fields:
- ComposedTextField
- CustomizedInputBase [docs] Add CustomInputBase TypeScript demo #15209
- CustomizedInputs
- FilledInputAdornments
- FilledTextFields
- FormattedInputs
- InputAdornments
- Inputs
- InputWithIcon
- OutlinedInputAdornments
- OutlinedTextFields
- TextFieldMargins
- TextFields
-
components/textarea-autosize:
- EmptyTextarea
- MaxHeightTextarea
- MinHeightTextarea
-
components/toggle-button:
- CustomizedDividers
-
components/tooltips [docs] Add Tooltip TypeScript demos #15061:
- ControlledTooltips
- CustomizedTooltips
- DelayTooltips
- DisabledTooltips
- InteractiveTooltips
- PositionedTooltips
- SimpleTooltips
- TransitionsTooltips
- TriggersTooltips
- VariableWidth
-
components/transfer-list:
- SelectAllTransferList [docs] Transfer List TypeScript Demo #15419
- TransferList [docs] Transfer List TypeScript Demo #15419
-
components/transitions [docs] Migrate batch of demos to hooks/typescript #16003:
- SimpleCollapse
- SimpleFade
- SimpleGrow
- SimpleSlide
- SimpleZoom
-
components/tree-view:
- CustomizedTreeView
- FileSystemNavigator
- GmailTreeView
-
components/typography:
- Types
- TypographyTheme [docs] Migrate batch of demos to hooks/typescript #16003
-
components/use-media-query:
- JavaScriptMedia
- SimpleMediaQuery
- ThemeHelper
- ServerSide [useMediaQuery] Fix ssrMatchMedia requiring listener mixin #18501
- UseWidth [docs] Add useWidth TS demo #17770
-
css-in-js/basics:
- AdaptingHook
- AdaptingStyledComponents
-
customization/breakpoints:
- MediaQuery [docs] Add Media Query TS demo #17766
- WithWidth [docs] Add TS demo for WithWidth #17930
-
customization/components:
- ClassesNesting [docs] Migrate batch of demos to hooks/typescript #16003
- ClassesShorthand [docs] Migrate batch of demos to hooks/typescript #16003
- ClassesState [docs] Migrate batch of demos to hooks/typescript #16003
- ClassNames [docs] Add classNames TS demo #17771
- Component [docs] Add component demos in ts #17790
- DynamicClassName [docs] Add dynamic class name TS demo #17793
- DynamicCSS [docs] Add TS demo for DynamicCSS #17994
- DynamicCSSVariables [docs] Add TS demo for DynamicCSSVariables #17983
- DynamicInlineStyle [styles] Make StyleRules backwards compatible #16200
- DynamicThemeNesting [docs] Add Customization/Components TS demo #17788
- GlobalCssOverride
- GlobalThemeOverride
- InlineStyle [docs] Add Customization/Components TS demo #17788
- ThemeVariables
-
customization/globals [docs] Migrate Globals demo to TypeScript #17785:
- DefaultProps
- GlobalCss
-
customization/palette:
- DarkTheme
- Palette [docs] Migrate Palette demo to TypeScript #17683
-
customization/theming:
- CustomStyles
- ThemeNesting
- ThemeNestingExtend
-
customization/typography:
- FontSizeTheme [docs] Migrate batch of demos to hooks/typescript #16334
- ResponsiveFontSizes
- TypographyVariants
-
guides/composition:
- ButtonRouter
- Composition [docs] Migrate batch of demos to hooks/typescript #16334
- LinkRouter
- ListRouter
-
guides/interoperability:
- EmotionCSS
- StyledComponents
- StyledComponentsDeep
- StyledComponentsPortal
- StyledComponentsTheme ([core] Batch small changes #17910)
-
guides/right-to-left:
- Direction [docs] Migrate batch of demos to hooks/typescript #16334
- RtlOptOut
-
styles/advanced:
- GlobalClassName [docs] Migrate batch of demos to hooks/typescript #16334
- GlobalCss [docs] Migrate batch of demos to hooks/typescript #16334
- HybridGlobalCss [docs] Migrate batch of demos to hooks/typescript #16334
- ThemeNesting [docs] Migrate batch of demos to hooks/typescript #16334
- Theming [docs] Migrate batch of demos to hooks/typescript #16334
- UseTheme [docs] Migrate batch of demos to hooks/typescript #16334
- WithTheme
- StringTemplates (plan to migrate to styled-components)
-
styles/basics:
- AdaptingHOC [core] Fix withStyles not including props #16134
- AdaptingHook [docs] Add AdaptingHook TypeScript demo #16131
- AdaptingStyledComponents [styles] Fix styled type definition not including properties #15548
- HigherOrderComponent [docs] Migrate batch of demos to hooks/typescript #16334
- Hook [docs] Migrate batch of demos to hooks/typescript #16334
- NestedStylesHook
- StressTest [docs] Migrate batch of demos to hooks/typescript #16334
- StyledComponents [styles] Fix styled type definition not including properties #15548
-
system/basics:
- CollocationApi
- CssProp
- Demo
- Emotion
- JSS [styles] Fix styled type definition not including properties #15548
- RealWorld
- StyledComponents
- Variant
-
system/borders:
- BorderAdditive [core] Avoid
!important
inborderColor
prop #16875 - BorderColor [core] Avoid
!important
inborderColor
prop #16875 - BorderRadius [core] Avoid
!important
inborderColor
prop #16875 - BorderSubtractive [core] Avoid
!important
inborderColor
prop #16875
- BorderAdditive [core] Avoid
-
system/display [docs] Migrate batch of demos to hooks/typescript #16334:
- Block
- Hiding
- Inline
- Overflow
- TextOverflow
- Visibility
- WhiteSpace
-
system/flexbox [docs] Migrate batch of demos to hooks/typescript #16334:
- AlignContent
- AlignItems
- AlignSelf
- Display
- FlexDirection
- FlexGrow
- FlexShrink
- FlexWrap
- JustifyContent
- Order
-
system/palette [docs] Migrate batch of demos to hooks/typescript #16334:
- BackgroundColor
- Color
-
system/positions [docs] Migrate batch of demos to hooks/typescript #16334:
- ZIndex
-
system/shadows [docs] Migrate batch of demos to hooks/typescript #16334:
- Demo
-
system/sizing [docs] Migrate batch of demos to hooks/typescript #16334:
- Height
- Values
- Width
-
system/spacing [docs] Migrate batch of demos to hooks/typescript #16334:
- Demo
- HorizontalCentering
-
system/typography:
- FontFamily
- FontSize
- FontStyle
- FontWeight
- LetterSpacing
- LineHeight
- TextAlignment