@@ -147,6 +147,120 @@ string QuillHTMLContent;
147147 }
148148}
149149```
150+
151+ ### Alternative Using of the BlazoredTextEditor Component
152+ Depending on our use case , we may want to add some styling to the Toolbar or Editor . We can also place the Toolbar below the Editor by setting the BottomToolbar property to ‘true ’ in the BlazoredTextEditor component :
153+ ```csharp
154+ < style >
155+ .rounded {
156+ border - radius : 8px ;
157+ }
158+ .colored - border {
159+ border : 4px solid red ! important ;
160+ }
161+ < / style >
162+
163+ < h1 > Blazored .TextEditor Usage Examples < / h1 >
164+
165+ < h3 > Basic Example < / h3 >
166+ < BlazoredTextEditor
167+ @ref = " @richEditor" >
168+ < ToolbarContent >
169+ @((MarkupString ) toolbar )
170+ < / ToolbarContent >
171+ < EditorContent >
172+ @((MarkupString ) body )
173+ < / EditorContent >
174+ < / BlazoredTextEditor >
175+ < br / >
176+ < br / >
177+
178+ < h3 > Show the Toolbar Below the Editor < / h3 >
179+ < BlazoredTextEditor
180+ BottomToolbar = " true"
181+ @ref = " @richEditor" >
182+ < ToolbarContent >
183+ @((MarkupString ) toolbar )
184+ < / ToolbarContent >
185+ < EditorContent >
186+ @((MarkupString ) body )
187+ < / EditorContent >
188+ < / BlazoredTextEditor >
189+ < br / >
190+ < br / >
191+
192+ < h3 > Styled Toolbar < / h3 >
193+ < BlazoredTextEditor
194+ @ref = " @richEditor"
195+ ToolbarCSSClass = " rounded colored-border"
196+ ToolbarCssStyle = " background: lightpink" >
197+ < ToolbarContent >
198+ @((MarkupString ) toolbar )
199+ < / ToolbarContent >
200+ < EditorContent >
201+ @((MarkupString ) body )
202+ < / EditorContent >
203+ < / BlazoredTextEditor >
204+ < br / >
205+ < br / >
206+
207+ < h3 > Styled Editor < / h3 >
208+ < BlazoredTextEditor
209+ EditorCSSClass = " rounded colored-border"
210+ EditorCssStyle = " padding: 10px; background: lightpink"
211+ @ref = " @richEditor" >
212+ < ToolbarContent >
213+ @((MarkupString ) toolbar )
214+ < / ToolbarContent >
215+ < EditorContent >
216+ @((MarkupString ) body )
217+ < / EditorContent >
218+ < / BlazoredTextEditor >
219+
220+ @code
221+ {
222+ BlazoredTextEditor richEditor = default ! ;
223+ string toolbar = """" ...markup here..."""" ;
224+ string body = """" ...markup here..."""" ;
225+
226+ protected override void OnInitialized ()
227+ {
228+ toolbar = """"
229+ <select class="ql-header">
230+ <option selected=""></option>
231+ <option value="1"></option>
232+ <option value="2"></option>
233+ <option value="3"></option>
234+ <option value="4"></option>
235+ <option value="5"></option>
236+ </select>
237+ <span class="ql-formats">
238+ <button class="ql-bold"></button>
239+ <button class="ql-italic"></button>
240+ <button class="ql-underline"></button>
241+ <button class="ql-strike"></button>
242+ </span>
243+ <span class="ql-formats">
244+ <select class="ql-color"></select>
245+ <select class="ql-background"></select>
246+ </span>
247+ <span class="ql-formats">
248+ <button class="ql-list" value="ordered"></button>
249+ <button class="ql-list" value="bullet"></button>
250+ </span>
251+ <span class="ql-formats">
252+ <button class="ql-link"></button>
253+ </span>
254+ """" ;
255+
256+ body = """"
257+ <h4>This Toolbar works with HTML</h4>
258+ <a href="https://BlazorHelpWebsite.com">BlazorHelpWebsite.com</a>
259+ """" ;
260+ }
261+ }
262+ ```
263+ ! [examples_screenshot .png ](samples % 2FTextEditorDemo % 2Fwwwroot % 2Fexamples_screenshot .png )
150264### Rich Text Screenshot
151265! [Screenshot ](DeltaExample .png )
152266### Read Only Screenshot
0 commit comments