You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass a [`Language`]variant when building[`SourceCode`]. The `runtime` feature includes Rust; enable the matching `lang-*` feature, or `all-languages`, for additional grammars.
76
+
Language can be set explicitly with the same [`CodeOptions`]builder used by[`code!`], or auto-detected from the source. The default `runtime` feature includes Rust; pass `lang-python`, `lang-toml`, or `all-languages` for the rest.
76
77
77
78
## Editor
78
79
79
-
[`dioxus-code-editor`] is a sibling crate that pairs the highlighter with a textarea input layer:
80
+
[`dioxus-code-editor`] is a sibling crate that pairs the highlighter with a `contenteditable` input layer:
80
81
81
82
```rust
82
83
# usedioxus::prelude::*;
@@ -130,7 +131,7 @@ Code {
130
131
131
132
```sh
132
133
dx serve --example dioxus-code-basic # macro + runtime side by side
Copy file name to clipboardExpand all lines: code-editor/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The component is controlled — drive [`CodeEditorProps::value`] from your own s
53
53
| prop | description |
54
54
|---|---|
55
55
|[`CodeEditorProps::value`]| Current editor contents. |
56
-
|[`CodeEditorProps::language`]|Syntax grammar selection. Pass a [`Language`] variant (for example [`Language::Rust`]) or use [`Language::from_slug`] for runtime slugs. |
56
+
|[`CodeEditorProps::language`]|Tree-sitter grammar selection. Pass a [`Language`] variant (for example [`Language::Rust`]) or use [`Language::from_slug`] for custom slugs. |
57
57
|[`CodeEditorProps::theme`]| Syntax theme selection shared with [`dioxus-code`](https://crates.io/crates/dioxus-code); accepts [`Theme`] or [`CodeTheme`]. |
58
58
|[`CodeEditorProps::line_numbers`]| Show a one-based line gutter. Defaults to `true`. |
59
59
|[`CodeEditorProps::read_only`]| Disable editing while preserving highlighting. |
0 commit comments