Commit 7d8eef4
committed
docs(website): Introduce React code editor and preview (#13183)
- Adds a live React code editor (Monaco) alongside the existing HTML
playground for every component sample, letting users view, edit, and
preview UI5 Web Components as React/TSX code with full TypeScript
intellisense
- Introduces createComponent in @ui5/webcomponents-base — a lightweight
React wrapper factory that documentation samples use to wrap UI5 Web
Component classes into typed React components
- Generates ~380 React sample files (sample.tsx) covering main, fiori,
ai, compat, and patterns packages
https://github.com/user-attachments/assets/c4619908-607d-4d00-ac2d-421b41ca1993
#### What's included
- **ReactPlayground.tsx** — Monaco editor + live preview with Babel
transpilation, error boundary, theme/density/direction support
- **monaco-ui5-types.d.ts** — Auto-generated TypeScript definitions for all
components (props, events, slots) powering Monaco autocomplete
- **generate-monaco-types.mjs** — Script to regenerate Monaco types from
component .d.ts files
- **createComponent.tsx** — Typed React wrapper factory
(@ui5/webcomponents-base/dist/createComponent.js, not in barrel export)
- HTML/React toggle in the Editor toolbar to switch between views
- React >=18 version label in the editor tab bar
#### Technical notes
- **createComponent** is NOT in the barrel export to avoid forcing a React
dependency on non-React consumers
- Samples import via direct path:
@ui5/webcomponents-base/dist/createComponent.js
- React is an optional peer dependency of @ui5/webcomponents-base1 parent 2642c2e commit 7d8eef4
772 files changed
Lines changed: 28395 additions & 409 deletions
File tree
- packages
- base
- src
- website
- docs/_samples
- ai
- Button
- ButtonMenu
- ButtonSplitMenu
- IconOnlyButton
- Input/Basic
- PromptInput/Basic
- TextArea
- Basic
- Extended
- compat/Table
- ActiveRows
- Basic
- Grouping
- GrowingOnButtonPress
- GrowingOnScroll
- MultipleSelection
- NoData
- Popin
- SingleSelection
- StickyHeader
- fiori
- BardcodeScannerDialog/Basic
- DynamicPage/Basic
- DynamicSideContent
- Basic
- EqualSplit
- SideContentPosition
- FlexibleColumnLayout
- Basic
- LayoutsConfiguration
- IllustratedMessage
- Basic
- CustomTitle
- WithDialog
- MediaGallery
- Basic
- Horizontal
- Interactive
- ThumbnailCustom
- Vertical
- VideoContent
- WithDisabledItem
- WithSelectedItem
- NotificationList
- Basic
- GroupItems
- InShellBar
- Page
- Basic
- ProductSwitch
- Basic
- WithImageSlot
- WithShellBar
- Search
- Actions
- AdvancedFilter
- Advanced
- Basic
- Byline
- Loading
- ShowMore
- ShellBar
- Advanced
- Basic
- MultipleNonProductiveInstances
- MultipleProductiveInstances
- Overflow
- TrialExample
- Timeline
- Basic
- Horizontal
- InCard
- WithGroups
- WithGrowing
- WithState
- UploadCollection
- Basic
- DragAndDrop
- RenamingFiles
- VariousUploadStates
- UserMenu
- Advanced
- Basic
- UserSettingsDialog/Basic
- ViewSettingsDialog/Basic
- Wizard
- Basic
- PageMode
- main
- AvatarBadge
- Basic
- ValueStates
- AvatarGroup
- Basic
- GroupWithPopover
- IndividualWithPopover
- TypesAndSizes
- Avatar
- Basic
- ColorSchemes
- Decorative
- Interactive
- Shapes
- Sizes
- Styles
- Variants
- WithBadge
- WithIcon
- WithImage
- Bar
- AccessibleRole
- Basic
- Breadcrumbs
- Basic
- BreadcrumbsOverflow
- BreadcrumbsStyles
- NoCurrentPage
- BusyIndicator
- Basic
- Sizes
- TextPlacement
- WithComponent
- Button
- Basic
- ButtonBadge
- CustomStyling
- Design
- EndIcon
- IconOnly
- Loading
- MenuButton
- TextAndIcon
- CalendarLegend
- Basic
- HideToday
- ItemTypes
- Calendar
- Basic
- Bounds
- CalendarInDifferentTimezone
- CalendarTypes
- CalendarWeekNumbering
- CalendarWithDisabledDates
- CalendarWithLegend
- SelectionModes
- Card
- Basic
- MoreCards
- WithList
- WithTable
- WithTimeline
- Carousel
- AccessibleName
- ArrowsPlacement
- Basic
- CardsWithHidden
- Cyclic
- MultipleItemsPerPage
- PageIndicatorType
- CheckBox
- Basic
- Group
- Indeterminate
- States
- TextWrapping
- ColorPalettePopover
- Basic
- DefaultColor
- MoreColors
- ColorPalette/Basic
- ColorPicker
- Basic
- Simplified
- ComboBox
- Basic
- ClearIcon
- Filters
- Grouping
- SameTextDifferentValues
- SelectedValue
- SuggestionsWrapping
- TwoColumnsLayout
- DatePicker
- Basic
- CalendarTypes
- CalendarWeekNumbering
- ClearIcon
- CustomFormatting
- DatePickerInDifferentTimezone
- MinMax
- State
- DateRangePicker
- Basic
- ClearIcon
- CustomFormatting
- DateFormat
- MinMax
- DateTimePicker
- Basic
- ClearIcon
- CustomFormatting
- DateTimePickerInDifferentTimezone
- FormatPattern
- MinMax
- Dialog
- BarInDialog
- Basic
- DraggableAndResizable
- WithState
- DynamicDateRange
- Basic
- DynamicDateRangeValueSample
- ExpandableText
- Basic
- OverflowModePopover
- FileUploader
- Basic
- FileSizeLimit
- FilesFilter
- MultipleFiles
- WithoutInput
- Form
- Basic
- CustomHeader
- Edit
- EmptySpan
- FreeStyleForm
- GroupColumnSpan
- Groups
- HeaderTextWrapping
- ItemColumnSpan
- LabelSpan
- LabelsOnTop
- Layout
- Icon
- BSIcons
- Basic
- CustomStyling
- Design
- Interactive
- TntIcons
- Input
- Basic
- BuiltInFiltering
- ClearIcon
- CustomStyling
- CustomSuggestions
- DynamicSuggestions
- Label
- SuggestionsWrapping
- Suggestions
- ValueHelpDialog
- ValueStateMessage
- Label
- Basic
- CustomStyling
- TextWrapping
- UsageWithInputs
- Link
- Basic
- CustomStyling
- Design
- TextWrapping
- WithIcons
- List
- Basic
- DragAndDrop
- GroupHeaderStyling
- GroupHeaders
- GrowingOnButtonPress
- Growing
- Modes
- MultipleDrag
- NoData
- SeparationTypes
- StickyHeader
- WrappingBehavior
- Menu
- AditionalText
- Basic
- DynamicallyAddedItems
- ItemGroups
- MenuEndContent
- SubMenu
- MessageStrip
- Basic
- CustomColors
- Custom
- Design
- HideIconAndButton
- MultiComboBox
- Basic
- ClearIcon
- MultiComboBoxCustomValue
- MultiComboBoxGrouping
- MultiComboBoxSelectAll
- SelectedValuesDynamic
- SelectedValues
- SuggestionsWrapping
- MultiInput
- Basic
- SuggestionsWrapping
- TokenCreation
- Panel
- Basic
- CustomHeader
- Fixed
- StickyHeader
- Popover
- Basic
- Placement
- Resizable
- ProgressIndicator
- Basic
- DisplayValue
- States
- RadioButton
- Basic
- States
- TextWrapping
- RangeSlider
- Basic
- ShowTickmarks
- ShowTooltip
- RatingIndicator
- Basic
- CustomIcons
- Sizes
- ResponsivePopover
- Basic
- Placement
- SegmentedButton
- Basic
- ItemsFitContent
- SelectionModes
- Select
- AdditionalText
- Basic
- CustomOptions
- Selection
- States
- Slider
- Basic
- ShowTickmarks
- ShowTooltip
- SplitButton
- Basic
- Design
- OpeningMenu
- StepInput
- Basic
- MinMax
- States
- ValuePrecision
- Switch
- Basic
- Design
- TabContainer
- Basic
- NestedTabs
- OverflowModeStartAndEnd
- OverflowMode
- ReorderTabsFixedTabs
- ReorderTabsMaxNestingLevel
- ReorderTabs
- TabLayoutInline
- TabLayout
- TextOnlyTabs
- TransparentDesign
- Table
- Basic
- ColumnWidths
- DragAndDrop
- Growing
- HAlign
- HeaderCellActionAI
- Interactive
- NoDataSlot
- Popin
- RowAction
- ScrollMode
- ScrollToLoad
- SelectionMulti
- SelectionSingle
- Selection
- StickyHeaderContainer
- StickyHeader
- Virtualizer
- Tag
- Basic
- Designs
- Interactive
- Set1
- Set2
- Size
- WrappingTypes
- TextArea
- Basic
- Growing
- MaxLength
- States
- Text
- Basic
- CustomStyling
- EmptyIndicatorMode
- Hyphenation
- MaxLines
- RenderWhiteSpace
- TimePicker
- Basic
- FormatPatterns
- States
- TimePickerInDifferentTimezone
- Title
- Basic
- WrappingType
- Toast
- Basic
- Duration
- Placement
- ToggleButton
- Basic
- Design
- IconOnly
- Tokenizer
- Basic
- MultiLine
- Token
- Basic
- TokenInMultiInput
- Toolbar
- AlwaysOverflowingItems
- Basic
- ItemsAlignment
- NeverOverflowingItems
- SpacerAndSeparator
- ToolbarItem
- Tree
- Basic
- CustomTreeItems
- DragAndDrop
- patterns
- AIAcknowledgement
- ScrollToAccept
- StandardAcknowledgement
- AIGuidedPrompt/Dialog
- AIQuickPrompt
- AIRegenerate/Basic
- scripts
- src/components/Editor
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
| 5 | + | |
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
| 5 | + | |
0 commit comments