Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 2.87 KB

flare-components-flarecodeblock.md

File metadata and controls

40 lines (30 loc) · 2.87 KB

FlareCodeBlock

Flare.Components.FlareCodeBlock

Parameters

Name Type Default Kind Required Description
IndentSize int 2 Parameter Number of spaces inserted by the Tab key when SmartEditing is enabled.
Language string "csharp" Parameter highlight.js language hint (e.g. "csharp", "javascript").
LineNumbers bool false Parameter Shows line numbers in the left gutter when true.
Markers IReadOnlyList<FlareCodeMarker>? `` Parameter Spans worth drawing attention to, such as anything that does not parse. Drawn under the text they cover, with the message shown when the pointer rests on one.
MaxLength int 0 Parameter Maximum characters accepted/displayed. 0 = unlimited.
MaxSuggestions int 8 Parameter Longest list of suggestions shown at once. Defaults to 8.
ReadOnly bool true Parameter Renders a static, non-editable highlighted block when true. Default true.
Rows int 10 Parameter Number of visible rows in edit mode (controls height via line-height).
SmartEditing bool true Parameter Enables Tab indentation and bracket/quote auto-closing in edit mode. Default true.
SuggestionProvider FlareCodeSuggestionProvider? `` Parameter Supplies what could be written at the caret. Null offers nothing, which is the default: what is worth suggesting is a question about the language being edited, and this component has no opinion about any language.
Value string? `` Parameter The code string displayed (and edited when ReadOnly is false).
ValueChanged EventCallback<string> `` Callback Callback invoked when the user edits the code (ignored while read-only).
Wrap bool false Parameter Wraps long lines instead of scrolling sideways. Off by default, since code is usually easier to follow when a line stays a line; turn it on for generated output that has to be read rather than edited. With LineNumbers a wrapped line still gets one number, so the numbers stop matching the rows on screen.
AdditionalAttributes IReadOnlyDictionary<string, object>? `` Parameter Additional attributes. Inherited from FlareComponentBase.
Class string? `` Parameter Additional CSS class(es) appended to the component's root element. Inherited from FlareComponentBase.
Style string? `` Parameter Inline style string appended to the component's root element. Inherited from FlareComponentBase.

Methods

DisposeAsync()

Disposes the component; override to release JS interop or subscriptions. Returns: ValueTask.

Inheritance

  • FlareComponentBase
  • ComponentBase
  • object