-
-
Notifications
You must be signed in to change notification settings - Fork 885
Supported HTML Elements
<a>
<abbr>
<acronym>
<address>
<article>
<aside>
<audio>
<b>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<dd>
<del>
<details>
<dfn>
<div>
<dl>
<dt>
<em>
<figcaption>
<figure>
<font>
<footer>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<ins>
<kbd>
<li>
<main>
<mark>
<math>
<nav>
<noscript>
<ol>
<p>
<pre>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<section>
<small>
<span>
<strike>
<strong>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<tfoot>
<th>
<thead>
<time>
<tr>
<tt>
<u>
<ul>
<var>
<video>
<wbr>
Below are detailed guides for some of the supported HTML elements so you can make better use of available features and debug your app if you encounter problems.
You can use the onLinkTap
callback to receive all interactions with <a>
elements.
Html(
data: '<a href="https://github.com">GitHub</a>',
onLinkTap: (url) {
//Do something with url, e.g. launch(url);
},
),
NOTE:
<audio>
requires that you add the package flutter_html_audio as a dependency.
Support for the <audio>
tag is turned off by default. To enable it, add the flutter_html_audio package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
AudioHtmlExtension(),
],
)
Renders a horizontal bar. <hr>
is styled using the border
property. See https://www.w3schools.com/howto/howto_css_style_hr.asp for more details. Other than only producing solid
-style borders (no dashed
or dotted
), flutter_html
fully supports the code example on that page.
NOTE:
<iframe>
requires that you add the package flutter_html_iframe as a dependency.
Support for the <iframe>
tag is turned off by default. To enable it, add the flutter_html_iframe package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
IframeHtmlExtension(),
],
)
Coming Soon!
NOTE:
<math>
requires that you add the package flutter_html_math as a dependency.
Support for the <math>
tag is turned off by default. To enable it, add the flutter_html_math package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
MathHtmlExtension(),
],
)
Coming Soon!
NOTE:
<svg>
requires that you add the package flutter_html_svg as a dependency.
Support for the <svg>
tag is turned off by default. To enable it, add the flutter_html_svg package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
SvgHtmlExtension(),
],
)
NOTE:
<table>
and related tags require that you add the package flutter_html_table as a dependency.
Support for the <table>
tag and related tags are turned off by default. To enable them, add the flutter_html_table package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
TableHtmlExtension(),
],
)
NOTE:
<video>
requires that you add the package flutter_html_video as a dependency.
Support for the <video>
tag is turned off by default. To enable it, add the flutter_html_video package as a dependency and configure your Html
widget:
Html(
data: ...,
extensions: [
// Add this to your extensions
VideoHtmlExtension(),
],
)