xref: /expo/packages/html-elements/README.md (revision 60ea71b8)
155058f92SEvan Bacon<h1 align="center">@expo/html-elements</h1>
255058f92SEvan Bacon
355058f92SEvan Bacon<img alt="Product: demo" src="https://dev-to-uploads.s3.amazonaws.com/i/xoc3yx7qfqf6e1w6mm2e.png" />
455058f92SEvan Bacon
555058f92SEvan Bacon<p align="center">
655058f92SEvan Bacon  <!-- iOS -->
755058f92SEvan Bacon  <img alt="Supports Expo iOS" longdesc="Supports Expo iOS" src="https://img.shields.io/badge/iOS-4630EB.svg?style=flat-square&logo=APPLE&labelColor=999999&logoColor=fff" />
855058f92SEvan Bacon  <!-- Android -->
955058f92SEvan Bacon  <img alt="Supports Expo Android" longdesc="Supports Expo Android" src="https://img.shields.io/badge/Android-4630EB.svg?style=flat-square&logo=ANDROID&labelColor=A4C639&logoColor=fff" />
1055058f92SEvan Bacon  <!-- Web -->
1155058f92SEvan Bacon  <img alt="Supports Expo Web" longdesc="Supports Expo Web" src="https://img.shields.io/badge/web-4630EB.svg?style=flat-square&logo=GOOGLE-CHROME&labelColor=4285F4&logoColor=fff" />
1255058f92SEvan Bacon  <a aria-label="Circle CI" href="https://circleci.com/gh/expo/expo/tree/master">
1355058f92SEvan Bacon    <img alt="Circle CI" src="https://flat.badgen.net/circleci/github/expo/expo?label=Circle%20CI&labelColor=555555&icon=circleci">
1455058f92SEvan Bacon  </a>
1555058f92SEvan Bacon</p>
1655058f92SEvan Bacon
1755058f92SEvan BaconSimple, light-weight, and well tested, universal semantic HTML elements as React components for iOS, Android, web, and desktop apps!
1855058f92SEvan Bacon
1955058f92SEvan BaconWe at Expo recommend using platform agnostic primitives like `View`, `Image`, and `Text` whenever possible but sometimes that's not easy. Some primitives like Tables, and Footers are native to web only and currently have no way of easily accessing. This package aims to solve that while still being an optimal UI package for iOS, and Android.
2055058f92SEvan Bacon
2155058f92SEvan Bacon### What you get
2255058f92SEvan Bacon
2355058f92SEvan Bacon- Using `@expo/html-elements` will optimize your website for SEO and accessibility. Meaning your websites are indexed more accurately and your native apps better accommodate physically impaired users.
2455058f92SEvan Bacon  - This package takes full advantage of [`react-native-web` a11y rules](https://github.com/necolas/react-native-web/blob/master/packages/docs/src/guides/accessibility.stories.mdx) whenever possible.
2555058f92SEvan Bacon  - For example, the `H1` component will render an `<h1 />` on web, a `UILabel` on iOS, and a `TextView` on Android.
2655058f92SEvan Bacon- Every component can accept styles from the `StyleSheet` API.
2755058f92SEvan Bacon- TypeScript works for iOS, Android, and web, no more having to create monkey patches to use `href` on a `Text` element.
2855058f92SEvan Bacon- Every component is tested render **tested universally** for iOS, Android, and Web using the package [`jest-expo-enzyme`](https://www.npmjs.com/package/jest-expo-enzyme). Each element is also **E2E tested** on iOS with Detox, and web with [`jest-expo-puppeteer`](https://www.npmjs.com/package/jest-expo-puppeteer).
2955058f92SEvan Bacon- This package is completely side-effect free!
3055058f92SEvan Bacon
3155058f92SEvan Bacon## Setup
3255058f92SEvan Bacon
3355058f92SEvan BaconInstall:
3455058f92SEvan Bacon
3555058f92SEvan Bacon```sh
3655058f92SEvan Baconyarn add @expo/html-elements
3755058f92SEvan Bacon```
3855058f92SEvan Bacon
3955058f92SEvan BaconImport and use the package:
4055058f92SEvan Bacon
4155058f92SEvan Bacon```tsx
4255058f92SEvan Baconimport { H1 } from '@expo/html-elements';
4355058f92SEvan Bacon```
4455058f92SEvan Bacon
4555058f92SEvan Bacon# Components
4655058f92SEvan Bacon
4755058f92SEvan BaconHere is a list of all the currently supported elements and the web feature they map to. Not all HTML elements are supported. There are some HTML elements that mostly overlap with some universal modules, you should always try to use the universal modules whenever possible. All supported components are a capitalized variation of the semantic HTML they implement/emulate.
4855058f92SEvan Bacon
4955058f92SEvan Bacon| HTML                                |      `@expo/html-elements`      |
5055058f92SEvan Bacon| ----------------------------------- | :-----------------------------: |
5155058f92SEvan Bacon| [`<a />`][html-a]                   |          [`<A />`](#a)          |
5255058f92SEvan Bacon| [`<article />`][html-article]       |    [`<Article />`](#article)    |
5368675f3eSEvan Bacon| [`<aside />`][html-aside]           |      [`<Aside />`](#aside)      |
5455058f92SEvan Bacon| [`<b />`][html-b]                   |          [`<B />`](#b)          |
5555058f92SEvan Bacon| [`<blockquote />`][html-blockquote] | [`<BlockQuote />`](#blockquote) |
5655058f92SEvan Bacon| [`<br />`][html-br]                 |         [`<BR />`](#br)         |
5755058f92SEvan Bacon| [`<caption />`][html-caption]       |    [`<Caption />`](#caption)    |
5855058f92SEvan Bacon| [`<code />`][html-code]             |       [`<Code />`](#code)       |
5955058f92SEvan Bacon| [`<del />`][html-del]               |        [`<Del />`](#del)        |
6055058f92SEvan Bacon| [`<em />`][html-em]                 |         [`<EM />`](#em)         |
6155058f92SEvan Bacon| [`<footer />`][html-footer]         |     [`<Footer />`](#footer)     |
6255058f92SEvan Bacon| [`<h1 />`][html-h1]                 |         [`<H1 />`](#h1)         |
6355058f92SEvan Bacon| [`<h2 />`][html-h2]                 |         [`<H2 />`](#h2)         |
6455058f92SEvan Bacon| [`<h3 />`][html-h3]                 |         [`<H3 />`](#h3)         |
6555058f92SEvan Bacon| [`<h4 />`][html-h4]                 |         [`<H4 />`](#h4)         |
6655058f92SEvan Bacon| [`<h5 />`][html-h5]                 |         [`<H5 />`](#h5)         |
6755058f92SEvan Bacon| [`<h6 />`][html-h6]                 |         [`<H6 />`](#h6)         |
6855058f92SEvan Bacon| [`<header />`][html-header]         |     [`<Header />`](#header)     |
6955058f92SEvan Bacon| [`<hr />`][html-hr]                 |         [`<HR />`](#hr)         |
7055058f92SEvan Bacon| [`<i />`][html-i]                   |          [`<I />`](#i)          |
7155058f92SEvan Bacon| [`<main />`][html-main]             |       [`<Main />`](#main)       |
7255058f92SEvan Bacon| [`<mark />`][html-mark]             |       [`<Mark />`](#mark)       |
7355058f92SEvan Bacon| [`<nav />`][html-nav]               |        [`<Nav />`](#nav)        |
7455058f92SEvan Bacon| [`<ol />`][html-ol]                 |         [`<OL />`](#ol)         |
7555058f92SEvan Bacon| [`<p />`][html-p]                   |          [`<P />`](#p)          |
7655058f92SEvan Bacon| [`<pre />`][html-pre]               |        [`<Pre />`](#pre)        |
7755058f92SEvan Bacon| [`<q />`][html-q]                   |          [`<Q />`](#q)          |
7855058f92SEvan Bacon| [`<s />`][html-s]                   |          [`<S />`](#s)          |
7955058f92SEvan Bacon| [`<section />`][html-section]       |    [`<Section />`](#section)    |
8055058f92SEvan Bacon| [`<strong />`][html-strong]         |     [`<Strong />`](#strong)     |
8155058f92SEvan Bacon| [`<table />`][html-table]           |      [`<Table />`](#table)      |
8255058f92SEvan Bacon| [`<tbody />`][html-tbody]           |      [`<TBody />`](#tbody)      |
8355058f92SEvan Bacon| [`<td />`][html-td]                 |         [`<TD />`](#td)         |
8455058f92SEvan Bacon| [`<tfoot />`][html-tfoot]           |      [`<TFoot />`](#tfoot)      |
8555058f92SEvan Bacon| [`<th />`][html-th]                 |         [`<TH />`](#th)         |
8655058f92SEvan Bacon| [`<thead />`][html-thead]           |      [`<THead />`](#thead)      |
8755058f92SEvan Bacon| [`<time />`][html-time]             |       [`<Time />`](#time)       |
8855058f92SEvan Bacon| [`<tr />`][html-tr]                 |         [`<TR />`](#tr)         |
8955058f92SEvan Bacon| [`<ul />`][html-ul]                 |         [`<UL />`](#ul)         |
9055058f92SEvan Bacon| [`<li />`][html-li]                 |         [`<LI />`](#li)         |
9155058f92SEvan Bacon| [`<details />`][html-details]       |            ⏱ Pending            |
9255058f92SEvan Bacon| [`<summary />`][html-summary]       |            ⏱ Pending            |
9355058f92SEvan Bacon| [`<progress />`][html-progress]     |            ⏱ Pending            |
9455058f92SEvan Bacon| [`<select />`][html-select]         |            ⏱ Pending            |
9555058f92SEvan Bacon| [`<picture />`][html-picture]       |            ⏱ Pending            |
9655058f92SEvan Bacon| [`<figure />`][html-figure]         |            ⏱ Pending            |
9755058f92SEvan Bacon| [`<figcaption />`][html-figcaption] |            ⏱ Pending            |
9868675f3eSEvan Bacon| [`<form />`][html-form]             |            ⏱ Pending            |
9968675f3eSEvan Bacon| [`<label />`][html-label]           |            ⏱ Pending            |
10055058f92SEvan Bacon
10155058f92SEvan Bacon## External
10255058f92SEvan Bacon
10355058f92SEvan BaconOther features not implemented in this package can be found in different parts of the Expo ecosystem.
10455058f92SEvan Bacon
10555058f92SEvan Bacon| HTML                            |      Universal       |                                                        Package                                                         |
10655058f92SEvan Bacon| ------------------------------- | :------------------: | :--------------------------------------------------------------------------------------------------------------------: |
10755058f92SEvan Bacon| `<audio />`                     |       `Audio`        |                                                 [`expo-av`][ex-audio]                                                  |
10855058f92SEvan Bacon| `<button />`                    |     `<Button />`     |                                                     `react-native`                                                     |
10955058f92SEvan Bacon| `<input type="text" />`         |    `<TextView />`    |                                                     `react-native`                                                     |
11055058f92SEvan Bacon| `<input type="file" />`         |    `ImagePicker`     |                                            [`expo-image-picker`][ex-ipick]                                             |
11155058f92SEvan Bacon| `<input type="file" />`         |   `DocumentPicker`   |                                           [`expo-document-picker`][ex-dpick]                                           |
11255058f92SEvan Bacon| `<canvas />`                    |     `<GLView />`     |                                     [`expo-gl`][ex-gl] & [Expo Canvas][ex-canvas]                                      |
11355058f92SEvan Bacon| `<iframe />`                    |    `<WebView />`     | [`<WebView />`][ex-webview]. `@react-native-community/web-view` is not maintained by Expo and doesn't have web support |
11455058f92SEvan Bacon| [`<link />`][html-link]         |         None         |              Eject the `index.html` with `expo customize:web` and link resources directly with `<link />`              |
11555058f92SEvan Bacon| [`<noscript />`][html-noscript] |         None         |                Eject the `index.html` with `expo customize:web` and use `<noscript />` directly as HTML                |
11655058f92SEvan Bacon| `<div />`                       |      `<View />`      |                                                     `react-native`                                                     |
11755058f92SEvan Bacon| `<img />`                       |     `<Image />`      |                                                     `react-native`                                                     |
11855058f92SEvan Bacon| `<span />`                      |      `<Text />`      |                                                     `react-native`                                                     |
11955058f92SEvan Bacon| `<video />`                     |     `<Video />`      |                                                  [`expo-av`][ex-vid]                                                   |
12055058f92SEvan Bacon| `style="backdrop-filter"`       |    `<BlurView />`    |                                                 [`expo-blur`][ex-blur]                                                 |
12155058f92SEvan Bacon| `style="linear-gradient()"`     | `<LinearGradient />` |                                         [`expo-linear-gradient`][ex-gradient]                                          |
12255058f92SEvan Bacon
12355058f92SEvan Bacon[ex-gradient]: https://docs.expo.io/versions/latest/sdk/linear-gradient/
12455058f92SEvan Bacon[ex-webview]: https://docs.expo.io/versions/latest/sdk/webview/
12555058f92SEvan Bacon[ex-audio]: https://docs.expo.io/versions/latest/sdk/audio
12655058f92SEvan Bacon[ex-gl]: https://docs.expo.io/versions/latest/sdk/gl-view
12755058f92SEvan Bacon[ex-canvas]: https://github.com/expo/expo-2d-context
12855058f92SEvan Bacon[html-noscript]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
12955058f92SEvan Bacon[html-link]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
13055058f92SEvan Bacon[ex-blur]: https://docs.expo.io/versions/latest/sdk/blur-view/
13155058f92SEvan Bacon[ex-vid]: https://docs.expo.io/versions/latest/sdk/video/
13255058f92SEvan Bacon[ex-ipick]: https://docs.expo.io/versions/latest/sdk/imagepicker/
13355058f92SEvan Bacon[ex-dpick]: https://docs.expo.io/versions/latest/sdk/document-picker/
13455058f92SEvan Bacon
13555058f92SEvan Bacon## Headings
13655058f92SEvan Bacon
13755058f92SEvan BaconHeader elements will use the expected [font size and margins from web](http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css) universally. You can see how the native CSS units (rem, and em) are transformed in [css/units](src/css/units.ts).
13855058f92SEvan Bacon
13955058f92SEvan Bacon```tsx
14055058f92SEvan Baconimport { H1, H2, H3, H4, H5, H6 } from '@expo/html-elements';
14155058f92SEvan Bacon```
14255058f92SEvan Bacon
14355058f92SEvan Bacon### `<H1/>`
14455058f92SEvan Bacon
14555058f92SEvan Bacon```tsx
14655058f92SEvan Baconimport { H1 } from '@expo/html-elements';
14755058f92SEvan Baconexport default () => <H1>Example<H1/>
14855058f92SEvan Bacon```
14955058f92SEvan Bacon
15055058f92SEvan Bacon| Platform | Output                                                 |
15155058f92SEvan Bacon| -------- | ------------------------------------------------------ |
15255058f92SEvan Bacon| Web      | `<h1 aria-level="1" dir="auto" role="heading" />`      |
15355058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
15455058f92SEvan Bacon
15555058f92SEvan Bacon### `<H2/>`
15655058f92SEvan Bacon
15755058f92SEvan Bacon```tsx
15855058f92SEvan Baconimport { H2 } from '@expo/html-elements';
15955058f92SEvan Baconexport default () => <H2>Example<H2/>
16055058f92SEvan Bacon```
16155058f92SEvan Bacon
16255058f92SEvan Bacon| Platform | Output                                                 |
16355058f92SEvan Bacon| -------- | ------------------------------------------------------ |
16455058f92SEvan Bacon| Web      | `<h2 aria-level="2" dir="auto" role="heading" />`      |
16555058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
16655058f92SEvan Bacon
16755058f92SEvan Bacon### `<H3/>`
16855058f92SEvan Bacon
16955058f92SEvan Bacon```tsx
17055058f92SEvan Baconimport { H3 } from '@expo/html-elements';
17155058f92SEvan Baconexport default () => <H3>Example<H3/>
17255058f92SEvan Bacon```
17355058f92SEvan Bacon
17455058f92SEvan Bacon| Platform | Output                                                 |
17555058f92SEvan Bacon| -------- | ------------------------------------------------------ |
17655058f92SEvan Bacon| Web      | `<h3 aria-level="3" dir="auto" role="heading" />`      |
17755058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
17855058f92SEvan Bacon
17955058f92SEvan Bacon### `<H4/>`
18055058f92SEvan Bacon
18155058f92SEvan Bacon```tsx
18255058f92SEvan Baconimport { H4 } from '@expo/html-elements';
18355058f92SEvan Baconexport default () => <H4>Example<H4/>
18455058f92SEvan Bacon```
18555058f92SEvan Bacon
18655058f92SEvan Bacon| Platform | Output                                                 |
18755058f92SEvan Bacon| -------- | ------------------------------------------------------ |
18855058f92SEvan Bacon| Web      | `<h4 aria-level="4" dir="auto" role="heading" />`      |
18955058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
19055058f92SEvan Bacon
19155058f92SEvan Bacon### `<H5/>`
19255058f92SEvan Bacon
19355058f92SEvan Bacon```tsx
19455058f92SEvan Baconimport { H5 } from '@expo/html-elements';
19555058f92SEvan Baconexport default () => <H5>Example<H5/>
19655058f92SEvan Bacon```
19755058f92SEvan Bacon
19855058f92SEvan Bacon| Platform | Output                                                 |
19955058f92SEvan Bacon| -------- | ------------------------------------------------------ |
20055058f92SEvan Bacon| Web      | `<h5 aria-level="5" dir="auto" role="heading" />`      |
20155058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
20255058f92SEvan Bacon
20355058f92SEvan Bacon### `<H6/>`
20455058f92SEvan Bacon
20555058f92SEvan Bacon```tsx
20655058f92SEvan Baconimport { H6 } from '@expo/html-elements';
20755058f92SEvan Baconexport default () => <H6>Example<H6/>
20855058f92SEvan Bacon```
20955058f92SEvan Bacon
21055058f92SEvan Bacon| Platform | Output                                                 |
21155058f92SEvan Bacon| -------- | ------------------------------------------------------ |
21255058f92SEvan Bacon| Web      | `<h6 aria-level="6" dir="auto" role="heading" />`      |
21355058f92SEvan Bacon| Native   | `<Text accessibilityRole="header" style={[Custom]} />` |
21455058f92SEvan Bacon
21555058f92SEvan Bacon## Link
21655058f92SEvan Bacon
21755058f92SEvan Bacon### `<A/>`
21855058f92SEvan Bacon
21955058f92SEvan BaconYou can use the anchor element with href prop to open links. On native this will attempt to use the `Linking` API to open the `href`.
22055058f92SEvan Bacon
22155058f92SEvan Bacon- The CSS style is fully normalized to match `<Text />`
22255058f92SEvan Bacon- For pseudo-class effects like hover and focus states check out the package [`react-native-web-hooks`](https://www.npmjs.com/package/react-native-web-hooks) | [tutorial](https://blog.expo.io/css-pseudo-class-effects-in-expo-for-web-56649f88eb6b)
22355058f92SEvan Bacon
22455058f92SEvan Bacon```tsx
22555058f92SEvan Baconimport { A } from '@expo/html-elements';
22655058f92SEvan Bacon
22755058f92SEvan Baconexport default () => <A href="#" target="_blank" />;
22855058f92SEvan Bacon}
22955058f92SEvan Bacon```
23055058f92SEvan Bacon
23155058f92SEvan Bacon| Platform | Output                                                                          |
23255058f92SEvan Bacon| -------- | ------------------------------------------------------------------------------- |
23355058f92SEvan Bacon| Web      | `<a data-focusable="{true}" dir="auto" href="#" role="link" target="_blank" />` |
23455058f92SEvan Bacon| Native   | `<Text accessibilityRole="link" onPress={[Function]} />`                        |
23555058f92SEvan Bacon
23655058f92SEvan Bacon## Layout
23755058f92SEvan Bacon
23855058f92SEvan BaconYou can use layout elements like Header, Main, Footer, Section, Nav, etc. as a drop-in replacement for `View`s in your existing app.
23955058f92SEvan Bacon
24055058f92SEvan Bacon#### Default Layout style
24155058f92SEvan Bacon
24255058f92SEvan BaconAll layout HTML elements inherit the shared style of `<View />` to accommodate the [Yoga layout engine][yoga] which we use on native for iOS, and Android.
24355058f92SEvan Bacon
24455058f92SEvan Bacon- `display` is always `flex`. This is because [Yoga][yoga] only implements `display: flex`.
24555058f92SEvan Bacon- `flex-direction` is always `column` instead of `row`.
24655058f92SEvan Bacon
24755058f92SEvan Bacon#### Why use Layout elements
24855058f92SEvan Bacon
24955058f92SEvan BaconConsider the following: in your app you have a basic element at the top which wraps the buttons and title. A screen reader doesn't understand that this is a header, and mostly neither does a web crawler. But if you replace the encasing view with a `<Header />` the following happens:
25055058f92SEvan Bacon
25155058f92SEvan Bacon- **iOS**: `UIView` uses [`UIAccessibilityTraitHeader`](https://developer.apple.com/documentation/uikit/uiaccessibilitytraitheader?language=objc).
25255058f92SEvan Bacon- **Android**: `View` will use the proper [`AccessibilityNodeInfoCompat.CollectionItemInfoCompat`](https://github.com/facebook/react-native/blob/7428271995adf21b2b31b188ed83b785ce1e9189/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L370-L372) | [docs](https://developer.android.com/reference/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.CollectionItemInfoCompat).
25355058f92SEvan Bacon- **web**: render an HTML 5 [`<header />`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header) with the ARIA `role` set to [`"banner"`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Banner_role).
25455058f92SEvan Bacon
25555058f92SEvan BaconSome elements like `Footer` and `Main` have no iOS, or Android enhancements, but they'll still improve web. Using the proper HTML 5 elements will make your layout compliant with the [HTML5 outline algorithm](https://html.spec.whatwg.org/multipage/sections.html#outlines).
25655058f92SEvan Bacon
25755058f92SEvan Bacon### `<Nav/>`
25855058f92SEvan Bacon
25955058f92SEvan Bacon```tsx
26055058f92SEvan Baconimport { Nav } from '@expo/html-elements';
26155058f92SEvan Bacon
26255058f92SEvan Baconexport default () => <Nav />;
26355058f92SEvan Bacon```
26455058f92SEvan Bacon
26555058f92SEvan Bacon| Platform | Output                         |
26655058f92SEvan Bacon| -------- | ------------------------------ |
26755058f92SEvan Bacon| Web      | `<nav style="display:flex" />` |
26855058f92SEvan Bacon| Native   | `<View />`                     |
26955058f92SEvan Bacon
27055058f92SEvan Bacon### `<Header/>`
27155058f92SEvan Bacon
27255058f92SEvan BaconRenders a `<header />` on web with ARIA set to [`banner`][aria-banner] and a `View` with ARIA set to `header` on mobile.
27355058f92SEvan Bacon
27455058f92SEvan Bacon```tsx
27555058f92SEvan Baconimport { Header } from '@expo/html-elements';
27655058f92SEvan Bacon
27755058f92SEvan Baconexport default () => <Header />;
27855058f92SEvan Bacon```
27955058f92SEvan Bacon
28055058f92SEvan Bacon| Platform | Output                                                                                                              |
28155058f92SEvan Bacon| -------- | ------------------------------------------------------------------------------------------------------------------- |
28255058f92SEvan Bacon| Web      | [`<header role="banner" />`][html-header]                                                                           |
28355058f92SEvan Bacon| Native   | `<View />`                                                                                                          |
28455058f92SEvan Bacon| iOS      | `UIView` uses [`UIAccessibilityTraitHeader`][uiatheader].                                                           |
28555058f92SEvan Bacon| Android  | `View` will use the proper [`AccessibilityNodeInfoCompat.CollectionItemInfoCompat`][anicompat] [docs][anicompatdoc] |
28655058f92SEvan Bacon
28755058f92SEvan Bacon[uiatheader]: https://developer.apple.com/documentation/uikit/uiaccessibilitytraitheader?language=objc
28855058f92SEvan Bacon[anicompat]: https://github.com/facebook/react-native/blob/7428271995adf21b2b31b188ed83b785ce1e9189/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L370-L372
28955058f92SEvan Bacon[anicompatdoc]: https://developer.android.com/reference/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.CollectionItemInfoCompat
29055058f92SEvan Bacon
29155058f92SEvan Bacon### `<Main/>`
29255058f92SEvan Bacon
29355058f92SEvan BaconRenders a `<main />` on web with ARIA `role` set to `main` and a `View` with no ARIA set on mobile.
29455058f92SEvan Bacon
29555058f92SEvan Bacon```tsx
29655058f92SEvan Baconimport { Main } from '@expo/html-elements';
29755058f92SEvan Bacon
29855058f92SEvan Baconexport default () => (
29955058f92SEvan Bacon    <Main>
30055058f92SEvan Bacon      <P>Some content in the main element</P>
30155058f92SEvan Bacon    </Main>
30255058f92SEvan Bacon  );
30355058f92SEvan Bacon)
30455058f92SEvan Bacon```
30555058f92SEvan Bacon
30655058f92SEvan Bacon| Platform | Output                                      |
30755058f92SEvan Bacon| -------- | ------------------------------------------- |
30855058f92SEvan Bacon| Web      | `<main role="main" style="display:flex" />` |
30955058f92SEvan Bacon| Native   | `<View />`                                  |
31055058f92SEvan Bacon
31155058f92SEvan Bacon### `<Section/>`
31255058f92SEvan Bacon
31355058f92SEvan BaconRenders a `<section />` on web with ARIA set to `region` and a `View` with ARIA set to `summary` on mobile.
31455058f92SEvan Bacon
31555058f92SEvan Bacon```tsx
31655058f92SEvan Baconimport { Section } from '@expo/html-elements';
31755058f92SEvan Bacon
31855058f92SEvan Baconexport default () => <Section />;
31955058f92SEvan Bacon```
32055058f92SEvan Bacon
32155058f92SEvan Bacon| Platform | Output                                           |
32255058f92SEvan Bacon| -------- | ------------------------------------------------ |
32355058f92SEvan Bacon| Web      | `<section role="region" style="display:flex" />` |
32455058f92SEvan Bacon| Native   | `<View accessibilityRole="summary" />`           |
32555058f92SEvan Bacon
32655058f92SEvan Bacon### `<Article/>`
32755058f92SEvan Bacon
32855058f92SEvan BaconRenders an `<article />` on web and a `View` everywhere else.
32955058f92SEvan Bacon
33055058f92SEvan Bacon```tsx
33155058f92SEvan Baconimport { Article } from '@expo/html-elements';
33255058f92SEvan Bacon
33355058f92SEvan Baconexport default () => <Article />;
33455058f92SEvan Bacon```
33555058f92SEvan Bacon
33655058f92SEvan Bacon| Platform | Output                       |
33768675f3eSEvan Bacon| -------- | ---------------------------- |
33868675f3eSEvan Bacon| Web      | `<article role="article" />` |
33968675f3eSEvan Bacon| Native   | `<View />`                   |
34068675f3eSEvan Bacon
34168675f3eSEvan Bacon### `<Aside/>`
34268675f3eSEvan Bacon
34368675f3eSEvan Bacon```tsx
34468675f3eSEvan Baconimport { Aside } from '@expo/html-elements';
34568675f3eSEvan Bacon
34668675f3eSEvan Baconexport default () => <Aside />;
34768675f3eSEvan Bacon```
34868675f3eSEvan Bacon
34968675f3eSEvan Bacon| Platform | Output                           |
35068675f3eSEvan Bacon| -------- | -------------------------------- |
35168675f3eSEvan Bacon| Web      | `<aside role="complementary" />` |
35255058f92SEvan Bacon| Native   | `<View />`                       |
35355058f92SEvan Bacon
35455058f92SEvan Bacon### `<Footer/>`
35555058f92SEvan Bacon
35655058f92SEvan BaconRenders an `<footer />` on web and a `View` everywhere else.
35755058f92SEvan Bacon
35855058f92SEvan Bacon```tsx
35955058f92SEvan Baconimport { Footer } from '@expo/html-elements';
36055058f92SEvan Bacon
36155058f92SEvan Baconexport default () => <Footer />;
36255058f92SEvan Bacon```
36355058f92SEvan Bacon
36455058f92SEvan Bacon| Platform | Output                          |
36568675f3eSEvan Bacon| -------- | ------------------------------- |
36668675f3eSEvan Bacon| Web      | `<footer role="contentinfo" />` |
36755058f92SEvan Bacon| Native   | `<View />`                      |
36855058f92SEvan Bacon
36955058f92SEvan Bacon## Text
37055058f92SEvan Bacon
37168675f3eSEvan BaconText elements currently use `Text` universally rendering either a `div` or `span` to emulate Yoga style properly.
37255058f92SEvan Bacon
37368675f3eSEvan Bacon- Style is modified to match web.
37437e143d9SEvan Bacon- All font styles are reset (minus `Code`, and `Pre`).
37555058f92SEvan Bacon- All elements accept styles from `StyleSheet` API.
37655058f92SEvan Bacon
37755058f92SEvan Bacon```tsx
378*60ea71b8SEvan Baconimport { P, B, S, I, BR, Code } from '@expo/html-elements';
37955058f92SEvan Bacon
38055058f92SEvan Baconexport default () => (
38155058f92SEvan Bacon  <>
38255058f92SEvan Bacon    <P>
38355058f92SEvan Bacon      Hello<B>World (in bold)</B>
38455058f92SEvan Bacon    </P>
38555058f92SEvan Bacon    <S>strike text</S>
38655058f92SEvan Bacon    <BR />
38755058f92SEvan Bacon    <I>Italic</I>
38855058f92SEvan Bacon    <Code>const foo = true</Code>
38955058f92SEvan Bacon  </>
39055058f92SEvan Bacon);
39155058f92SEvan Bacon```
39255058f92SEvan Bacon
39355058f92SEvan Bacon### `<P/>`
39455058f92SEvan Bacon
39555058f92SEvan BaconStandard paragraph element.
39655058f92SEvan Bacon
39755058f92SEvan Bacon| Platform  | Output                                                        |
39868675f3eSEvan Bacon| --------- | ------------------------------------------------------------- |
399*60ea71b8SEvan Bacon| Universal | `<Text style={{ fontSize: 14, marginVertical: '1em' }} />` |
40055058f92SEvan Bacon
40155058f92SEvan Bacon### `<B/>`
40255058f92SEvan Bacon
40355058f92SEvan BaconBold text text.
40455058f92SEvan Bacon
40555058f92SEvan Bacon| Platform  | Output                                    |
40668675f3eSEvan Bacon| --------- | ----------------------------------------- |
40768675f3eSEvan Bacon| Universal | `<Text style={{ fontWeight: 'bold' }} />` |
40855058f92SEvan Bacon
40955058f92SEvan Bacon### `<Strong/>`
41055058f92SEvan Bacon
41155058f92SEvan BaconAlternate bold text.
41255058f92SEvan Bacon
41355058f92SEvan Bacon| Platform  | Output                                    |
41468675f3eSEvan Bacon| --------- | ----------------------------------------- |
41568675f3eSEvan Bacon| Universal | `<Text style={{ fontWeight: 'bold' }} />` |
41655058f92SEvan Bacon
41755058f92SEvan Bacon### `<S/>`
41855058f92SEvan Bacon
41955058f92SEvan BaconStrike through text.
42055058f92SEvan Bacon
42155058f92SEvan Bacon| Platform  | Output                                                    |
42268675f3eSEvan Bacon| --------- | --------------------------------------------------------- |
42368675f3eSEvan Bacon| Universal | `<Text style={{ textDecorationLine: 'line-through' }} />` |
42455058f92SEvan Bacon
42555058f92SEvan Bacon### `<Del/>`
42655058f92SEvan Bacon
42755058f92SEvan BaconAlternate strike through text.
42855058f92SEvan Bacon
42955058f92SEvan Bacon| Platform  | Output                                                    |
43068675f3eSEvan Bacon| --------- | --------------------------------------------------------- |
43168675f3eSEvan Bacon| Universal | `<Text style={{ textDecorationLine: 'line-through' }} />` |
43255058f92SEvan Bacon
43355058f92SEvan Bacon### `<I/>`
43455058f92SEvan Bacon
43555058f92SEvan BaconItalic text.
43655058f92SEvan Bacon
43755058f92SEvan Bacon| Platform  | Output                                     |
43868675f3eSEvan Bacon| --------- | ------------------------------------------ |
43968675f3eSEvan Bacon| Universal | `<Text style={{ fontStyle: 'italic' }} />` |
44055058f92SEvan Bacon
44155058f92SEvan Bacon### `<EM/>`
44255058f92SEvan Bacon
44355058f92SEvan BaconAlternate italic text.
44455058f92SEvan Bacon
44555058f92SEvan Bacon| Platform  | Output                                     |
44668675f3eSEvan Bacon| --------- | ------------------------------------------ |
44768675f3eSEvan Bacon| Universal | `<Text style={{ fontStyle: 'italic' }} />` |
44855058f92SEvan Bacon
44955058f92SEvan Bacon### `<Code/>`
45055058f92SEvan Bacon
45137e143d9SEvan BaconInline code block with `fontFamily: 'Courier'`.
45255058f92SEvan Bacon
45355058f92SEvan Bacon| Platform  | Output                      |
45468675f3eSEvan Bacon| --------- | --------------------------- |
45568675f3eSEvan Bacon| Universal | `<Text style={[Custom]} />` |
45655058f92SEvan Bacon
45755058f92SEvan Bacon### `<Pre/>`
45855058f92SEvan Bacon
45937e143d9SEvan BaconRender a preformatted code block with `fontFamily: 'Courier'`.
46055058f92SEvan Bacon
46155058f92SEvan Bacon```jsx
46255058f92SEvan Bacon<Pre>{`
46355058f92SEvan Baconbody {
46455058f92SEvan Bacon  color: red;
46555058f92SEvan Bacon}
46655058f92SEvan Bacon`}</Pre>
46755058f92SEvan Bacon
46855058f92SEvan Bacon// Or pass views
46955058f92SEvan Bacon
47055058f92SEvan Bacon<Pre>
47155058f92SEvan Bacon  <Code>{`const val = true`}</Code>
47255058f92SEvan Bacon</Pre>
47355058f92SEvan Bacon```
47455058f92SEvan Bacon
47555058f92SEvan Bacon| Platform  | Output                                    |
47668675f3eSEvan Bacon| --------- | ----------------------------------------- |
47768675f3eSEvan Bacon| Universal | `<Text style={[Custom]} />` \| `<View />` |
47855058f92SEvan Bacon
47955058f92SEvan Bacon### `<Mark/>`
48055058f92SEvan Bacon
48155058f92SEvan BaconHighlight text.
48255058f92SEvan Bacon
48355058f92SEvan Bacon| Platform  | Output                                                           |
48468675f3eSEvan Bacon| --------- | ---------------------------------------------------------------- |
48568675f3eSEvan Bacon| Universal | `<Text style={{ backgroundColor: 'yellow', color: 'black' }} />` |
48655058f92SEvan Bacon
48755058f92SEvan Bacon### `<Q/>`
48855058f92SEvan Bacon
48955058f92SEvan BaconQuoted text.
49055058f92SEvan Bacon
49155058f92SEvan Bacon| Platform  | Output                                             |
49268675f3eSEvan Bacon| --------- | -------------------------------------------------- |
49368675f3eSEvan Bacon| Universal | `<Text style={[Custom]}>"{props.children}"</Text>` |
49455058f92SEvan Bacon
49555058f92SEvan Bacon### `<BlockQuote/>`
49655058f92SEvan Bacon
49755058f92SEvan Bacon| Platform  | Output                      |
49868675f3eSEvan Bacon| --------- | --------------------------- |
49968675f3eSEvan Bacon| Universal | `<View style={[Custom]} />` |
50055058f92SEvan Bacon
50155058f92SEvan Bacon### `<Time/>`
50255058f92SEvan Bacon
50355058f92SEvan Bacon- `dateTime` prop is supported on web and stripped on native.
50455058f92SEvan Bacon
50555058f92SEvan Bacon| Platform  | Output                      |
50668675f3eSEvan Bacon| --------- | --------------------------- |
50768675f3eSEvan Bacon| Universal | `<Text style={[Custom]} />` |
50855058f92SEvan Bacon
50955058f92SEvan Bacon## Lists
51055058f92SEvan Bacon
51155058f92SEvan BaconLists can be used to create basic bulleted or numbered lists. You should try and use universal `FlatList` or `SectionList` components for long scrolling lists instead of these.
51255058f92SEvan Bacon
51355058f92SEvan Bacon### `<UL/>`
51455058f92SEvan Bacon
51555058f92SEvan BaconCreate an unordered (bulleted) list `<ul />` on web, and emulates the style with a `<View />` on native.
51655058f92SEvan Bacon
51755058f92SEvan Bacon- [x] Resets font styles everywhere.
51855058f92SEvan Bacon- [ ] Supports i18n by reversing format on iOS and Android
51955058f92SEvan Bacon- [ ] Supports custom bullets
52055058f92SEvan Bacon
52155058f92SEvan Bacon```tsx
52255058f92SEvan Baconimport { UL, LI } from '@expo/html-elements';
52355058f92SEvan Bacon
52455058f92SEvan Baconexport default () => (
52555058f92SEvan Bacon  <UL>
52655058f92SEvan Bacon    <LI>oranges</LI>
52755058f92SEvan Bacon    <LI>apples</LI>
52855058f92SEvan Bacon    <UL>
52955058f92SEvan Bacon      <LI>green</LI>
53055058f92SEvan Bacon      <LI>red</LI>
53155058f92SEvan Bacon    </UL>
53255058f92SEvan Bacon  </UL>
53355058f92SEvan Bacon);
53455058f92SEvan Bacon```
53555058f92SEvan Bacon
53655058f92SEvan Bacon| Platform | Output                      |
53755058f92SEvan Bacon| -------- | --------------------------- |
53855058f92SEvan Bacon| Web      | `<ul />`                    |
53955058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
54055058f92SEvan Bacon
54155058f92SEvan Bacon### `<OL/>`
54255058f92SEvan Bacon
54355058f92SEvan BaconCreate an ordered (numbered) list `<ol />` on web, and emulates the style with a `<View />` on native.
54455058f92SEvan Bacon
54555058f92SEvan Bacon- [x] Resets font styles everywhere.
54655058f92SEvan Bacon- [ ] Supports i18n by reversing format on iOS and Android
54755058f92SEvan Bacon- [ ] Supports i18n bullets on iOS and Android
54855058f92SEvan Bacon- [ ] Supports custom bullets
54955058f92SEvan Bacon
55055058f92SEvan Bacon```tsx
55155058f92SEvan Baconimport { OL, LI } from '@expo/html-elements';
55255058f92SEvan Bacon
55355058f92SEvan Baconexport default () =>  {
55455058f92SEvan Bacon  return (
55555058f92SEvan Bacon    <OL>
55655058f92SEvan Bacon      <LI>oranges</LI>
55755058f92SEvan Bacon      <LI>apples</LI>
55855058f92SEvan Bacon      <OL>
55955058f92SEvan Bacon        <LI>green</LI>
56055058f92SEvan Bacon        <LI>red</LI>
56155058f92SEvan Bacon      </OL>
56255058f92SEvan Bacon    </OL>
56355058f92SEvan Bacon);
56455058f92SEvan Bacon```
56555058f92SEvan Bacon
56655058f92SEvan Bacon| Platform | Output                      |
56755058f92SEvan Bacon| -------- | --------------------------- |
56855058f92SEvan Bacon| Web      | `<ol />`                    |
56955058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
57055058f92SEvan Bacon
57155058f92SEvan Bacon### `<LI/>`
57255058f92SEvan Bacon
57355058f92SEvan BaconCreate a standard list item `<li />` on web and a native view on mobile which can render text or views inside it.
57455058f92SEvan Bacon
57555058f92SEvan Bacon| Platform | Output                                                     |
57655058f92SEvan Bacon| -------- | ---------------------------------------------------------- |
57755058f92SEvan Bacon| Web      | `<li />`                                                   |
57855058f92SEvan Bacon| Native   | `<Text style={[Custom]} />` \| `<View style={[Custom]} />` |
57955058f92SEvan Bacon
58055058f92SEvan Bacon## Rules
58155058f92SEvan Bacon
58255058f92SEvan Bacon### `<HR/>`
58355058f92SEvan Bacon
58455058f92SEvan BaconRenders a `<View>` everywhere. Style is modified to match web.
58555058f92SEvan Bacon
58655058f92SEvan Bacon```tsx
58755058f92SEvan Baconimport { HR } from '@expo/html-elements';
58855058f92SEvan Bacon
58955058f92SEvan Baconexport default () => <HR />;
59055058f92SEvan Bacon```
59155058f92SEvan Bacon
59255058f92SEvan Bacon| Platform | Output                      |
59355058f92SEvan Bacon| -------- | --------------------------- |
59455058f92SEvan Bacon| Web      | `<hr />`                    |
59555058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
59655058f92SEvan Bacon
59755058f92SEvan Bacon### `<BR/>`
59855058f92SEvan Bacon
59955058f92SEvan BaconCreate a line break.
60055058f92SEvan Bacon
60155058f92SEvan Bacon| Platform | Output                                   |
60255058f92SEvan Bacon| -------- | ---------------------------------------- |
60355058f92SEvan Bacon| Web      | `<br />`                                 |
60455058f92SEvan Bacon| Native   | `<View style={{height: 8, width: 0}} />` |
60555058f92SEvan Bacon
60655058f92SEvan Bacon## Tables
60755058f92SEvan Bacon
60855058f92SEvan BaconCreate tables universally.
60955058f92SEvan Bacon
61055058f92SEvan Bacon- Each element renders to the expected type on web.
61155058f92SEvan Bacon- `padding` is removed from all table elements.
61255058f92SEvan Bacon- Text **can only** be rendered in `TH` and `TD` on mobile.
61355058f92SEvan Bacon- `colSpan` and `rowSpan` are currently web-only (PRs welcome).
61455058f92SEvan Bacon
61555058f92SEvan Bacon```tsx
61655058f92SEvan Baconimport { Table, THead, TH, TBody, TFoot, TR, TD, Caption } from '@expo/html-elements';
61755058f92SEvan Baconimport { Text } from 'react-native';
61855058f92SEvan Bacon
61955058f92SEvan Baconexport default () => (
62055058f92SEvan Bacon  <Table>
62155058f92SEvan Bacon    <Caption>Caption</Caption>
62255058f92SEvan Bacon    <THead>
62355058f92SEvan Bacon      <TR>
62455058f92SEvan Bacon        <TH colSpan="2">The table header</TH>
62555058f92SEvan Bacon      </TR>
62655058f92SEvan Bacon    </THead>
62755058f92SEvan Bacon    <TBody>
62855058f92SEvan Bacon      <TR>
62955058f92SEvan Bacon        <TD>The table body</TD>
63055058f92SEvan Bacon        <TD>with two columns</TD>
63155058f92SEvan Bacon      </TR>
63255058f92SEvan Bacon    </TBody>
63355058f92SEvan Bacon    <TFoot>
63455058f92SEvan Bacon      <TR>
63555058f92SEvan Bacon        <TD>
63655058f92SEvan Bacon          <Text>This is the table footer</Text>
63755058f92SEvan Bacon        </TD>
63855058f92SEvan Bacon      </TR>
63955058f92SEvan Bacon    </TFoot>
64055058f92SEvan Bacon  </Table>
64155058f92SEvan Bacon);
64255058f92SEvan Bacon```
64355058f92SEvan Bacon
64455058f92SEvan Bacon#### Table example output web
64555058f92SEvan Bacon
64655058f92SEvan Bacon```html
64755058f92SEvan Bacon<table>
64855058f92SEvan Bacon  <caption>
64955058f92SEvan Bacon    Caption
65055058f92SEvan Bacon  </caption>
65155058f92SEvan Bacon  <thead>
65255058f92SEvan Bacon    <tr>
65355058f92SEvan Bacon      <th colspan="2">The table header</th>
65455058f92SEvan Bacon    </tr>
65555058f92SEvan Bacon  </thead>
65655058f92SEvan Bacon  <tbody>
65755058f92SEvan Bacon    <tr>
65855058f92SEvan Bacon      <td>The table body</td>
65955058f92SEvan Bacon      <td>with two columns</td>
66055058f92SEvan Bacon    </tr>
66155058f92SEvan Bacon  </tbody>
66255058f92SEvan Bacon  <tfoot>
66355058f92SEvan Bacon    <tr>
66455058f92SEvan Bacon      <td><div>The table body</div></td>
66555058f92SEvan Bacon    </tr>
66655058f92SEvan Bacon  </tfoot>
66755058f92SEvan Bacon</table>
66855058f92SEvan Bacon```
66955058f92SEvan Bacon
67055058f92SEvan Bacon### `<Table/>`
67155058f92SEvan Bacon
67255058f92SEvan BaconBase element for creating a Table.
67355058f92SEvan Bacon
67455058f92SEvan Bacon| Platform | Output                      |
67555058f92SEvan Bacon| -------- | --------------------------- |
67655058f92SEvan Bacon| Web      | `<table />`                 |
67755058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
67855058f92SEvan Bacon
67955058f92SEvan Bacon### `<THead/>`
68055058f92SEvan Bacon
68155058f92SEvan BaconHeader element in a Table.
68255058f92SEvan Bacon
68355058f92SEvan Bacon| Platform | Output                      |
68455058f92SEvan Bacon| -------- | --------------------------- |
68555058f92SEvan Bacon| Web      | `<thead />`                 |
68655058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
68755058f92SEvan Bacon
68855058f92SEvan Bacon### `<TBody/>`
68955058f92SEvan Bacon
69055058f92SEvan BaconBody element in a Table.
69155058f92SEvan Bacon
69255058f92SEvan Bacon| Platform | Output                      |
69355058f92SEvan Bacon| -------- | --------------------------- |
69455058f92SEvan Bacon| Web      | `<tbody />`                 |
69555058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
69655058f92SEvan Bacon
69755058f92SEvan Bacon### `<TFoot/>`
69855058f92SEvan Bacon
69955058f92SEvan BaconFooter element in a Table.
70055058f92SEvan Bacon
70155058f92SEvan Bacon| Platform | Output                      |
70255058f92SEvan Bacon| -------- | --------------------------- |
70355058f92SEvan Bacon| Web      | `<tfoot />`                 |
70455058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
70555058f92SEvan Bacon
70655058f92SEvan Bacon### `<TH/>`
70755058f92SEvan Bacon
70855058f92SEvan BaconUsed to display text in the Header.
70955058f92SEvan Bacon
71055058f92SEvan Bacon- `colSpan` and `rowSpan` are currently web-only.
71155058f92SEvan Bacon
71255058f92SEvan Bacon| Platform | Output                      |
71355058f92SEvan Bacon| -------- | --------------------------- |
71455058f92SEvan Bacon| Web      | `<th />`                    |
71555058f92SEvan Bacon| Native   | `<Text style={[Custom]} />` |
71655058f92SEvan Bacon
71755058f92SEvan Bacon### `<TR/>`
71855058f92SEvan Bacon
71955058f92SEvan BaconUsed to create a Row in a Table.
72055058f92SEvan Bacon
72155058f92SEvan Bacon| Platform | Output                      |
72255058f92SEvan Bacon| -------- | --------------------------- |
72355058f92SEvan Bacon| Web      | `<tr />`                    |
72455058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
72555058f92SEvan Bacon
72655058f92SEvan Bacon### `<TD/>`
72755058f92SEvan Bacon
72855058f92SEvan BaconCreate a cell in a Table.
72955058f92SEvan Bacon
73055058f92SEvan Bacon- `colSpan` and `rowSpan` are currently web-only.
73155058f92SEvan Bacon
73255058f92SEvan Bacon| Platform | Output                      |
73355058f92SEvan Bacon| -------- | --------------------------- |
73455058f92SEvan Bacon| Web      | `<td />`                    |
73555058f92SEvan Bacon| Native   | `<View style={[Custom]} />` |
73655058f92SEvan Bacon
73755058f92SEvan Bacon### `<Caption/>`
73855058f92SEvan Bacon
73955058f92SEvan BaconUsed to caption your table. Excepts text as a child.
74055058f92SEvan Bacon
74155058f92SEvan Bacon| Platform | Output                      |
74255058f92SEvan Bacon| -------- | --------------------------- |
74355058f92SEvan Bacon| Web      | `<caption />`               |
74455058f92SEvan Bacon| Native   | `<Text style={[Custom]} />` |
74555058f92SEvan Bacon
74655058f92SEvan Bacon## TODO
74755058f92SEvan Bacon
74855058f92SEvan Bacon- Improve relative imports for better tree-shaking.
74955058f92SEvan Bacon
75055058f92SEvan Bacon## Contributing
75155058f92SEvan Bacon
75255058f92SEvan BaconContributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
75355058f92SEvan Bacon
75455058f92SEvan Bacon[yoga]: https://yogalayout.com/
75555058f92SEvan Bacon
75655058f92SEvan Bacon<!-- HTML element links -->
75755058f92SEvan Bacon
75855058f92SEvan Bacon[html-a]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
75955058f92SEvan Bacon[html-article]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
76068675f3eSEvan Bacon[html-aside]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside
76155058f92SEvan Bacon[html-b]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
76255058f92SEvan Bacon[html-blockquote]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote
76355058f92SEvan Bacon[html-br]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br
76455058f92SEvan Bacon[html-caption]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption
76555058f92SEvan Bacon[html-code]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code
76655058f92SEvan Bacon[html-del]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
76755058f92SEvan Bacon[html-em]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
76855058f92SEvan Bacon[html-footer]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer
76968675f3eSEvan Bacon[html-form]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form
77055058f92SEvan Bacon[html-h1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h1
77155058f92SEvan Bacon[html-h2]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h2
77255058f92SEvan Bacon[html-h3]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h3
77355058f92SEvan Bacon[html-h4]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h4
77455058f92SEvan Bacon[html-h5]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h5
77555058f92SEvan Bacon[html-h6]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h6
77655058f92SEvan Bacon[html-header]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
77755058f92SEvan Bacon[html-hr]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr
77855058f92SEvan Bacon[html-i]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i
77955058f92SEvan Bacon[html-main]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main
78055058f92SEvan Bacon[html-mark]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
78155058f92SEvan Bacon[html-nav]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav
78255058f92SEvan Bacon[html-ol]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
78355058f92SEvan Bacon[html-p]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p
78455058f92SEvan Bacon[html-pre]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
78555058f92SEvan Bacon[html-q]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q
78655058f92SEvan Bacon[html-s]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s
78755058f92SEvan Bacon[html-section]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section
78855058f92SEvan Bacon[html-small]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small
78955058f92SEvan Bacon[html-strong]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
79055058f92SEvan Bacon[html-table]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
79155058f92SEvan Bacon[html-tbody]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
79255058f92SEvan Bacon[html-td]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
79355058f92SEvan Bacon[html-tfoot]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
79455058f92SEvan Bacon[html-th]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th
79555058f92SEvan Bacon[html-thead]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead
79655058f92SEvan Bacon[html-time]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
79755058f92SEvan Bacon[html-tr]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
79855058f92SEvan Bacon[html-ul]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
79955058f92SEvan Bacon[html-li]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li
80068675f3eSEvan Bacon[html-label]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
80155058f92SEvan Bacon[html-details]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
80255058f92SEvan Bacon[html-summary]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary
80355058f92SEvan Bacon[html-progress]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
80455058f92SEvan Bacon[html-select]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
80555058f92SEvan Bacon[html-picture]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture
80655058f92SEvan Bacon[html-figure]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
80755058f92SEvan Bacon[html-figcaption]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
80855058f92SEvan Bacon[aria-banner]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Banner_role
809