Skip to content

Commit 5e260b5

Browse files
Copilotkermanx
andauthored
docs: Monaco editor height property (#2350)
Co-authored-by: kermanx <63178754+kermanx@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: _Kerman <kermanx@qq.com>
1 parent 16dfe4c commit 5e260b5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/features/monaco-editor.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,16 @@ console.log('Original text')
3434
console.log('Modified text')
3535
```
3636
````
37+
38+
## Editor Height
39+
40+
By default, the Monaco editor has a fixed height based on the initial content. If you start with an empty or small code block and want the editor to automatically grow as you type more code, you can set `{height:'auto'}`.
41+
42+
````md
43+
```ts {monaco} {height:'auto'}
44+
// The editor will automatically grow as you type more code
45+
console.log('Hello, World!')
46+
```
47+
````
48+
49+
You can also set a specific height using CSS units like `{height:'300px'}` or `{height:'100%'}`.

0 commit comments

Comments
 (0)