` components | `object` | `{ fontSize: 14 }`
`allowFontScaling` | Specifies whether fonts should scale to respect Text Size accessibility settings | `boolean` | `true`
`textSelectable` | Allow all texts to be selected | `boolean` | `false`
`alterData` | Target some specific texts and change their content, see [altering content](#altering-content) | `function` | Optional
`alterChildren` | Target some specific nested children and change them, see [altering content](#altering-content) | `function` | Optional
`alterNode` | Target a specific node and change it, see [altering content](#altering-content) | `function` | Optional
`ignoredTags` | HTML tags you don't want rendered, see [ignoring HTML content](#ignoring-html-content) | `array` | Optional, `['head', 'scripts', ...]`
`allowedStyles`| Allow render only certain CSS style properties and ignore every other. If you have some property both in `allowedStyles` and `ignoredStyles`, it will be ignored anyway. | `array` | Optional, everything is allowed by default
`ignoredStyles` | CSS styles from the `style` attribute you don't want rendered, see [ignoring HTML content](#ignoring-html-content) | `array` | Optional
`ignoreNodesFunction` | Return true in this custom function to ignore nodes very precisely, see [ignoring HTML content](#ignoring-html-content) | `function` | Optional
`debug` | Prints the parsing result from htmlparser2 and render-html after the initial render | `bool` | Optional, defaults to `false`
## Demo
This component comes with a demo that showcases every feature presented here. It's very useful to keep track of bugs and rendering differences between the different versions of react-native.
**It is mandatory** to refer to an example of the demo or to provide one when submitting an issue or a pull request for a new feature.
Feel free to write more advanced examples and submit a pull-request for it, it will probably be very useful for other users.
## Creating custom renderers
This is very useful if you want to make some very specific styling of your HTML content, or even implement custom HTML tags.
### Custom HTML tags
Just pass an object to the `renderers` prop with the tag name as the key, an a function as its value, like so :
```javascript
renderers: {
hr: () =>
}
```
Here, we have overriden the default `
` renderer and made it a blue line.
You can also create your own tags and use them in your HTML content :
```javascript
const content = ``;
...
renderers: {
bluecircle: () =>
}
```
Your renderers functions receive several arguments that will be very useful to make some very specific rendering.
* `htmlAttribs`: attributes attached to the node, parsed in a react-native way
* `children` : array with the children of the node
* `convertedCSSStyles` : conversion of the `style` attribute from CSS to react-native's stylesheet
* `passProps` : various useful information : your `renderersProps`, `groupInfo`, `parentTagName`, `parentIsText`...
### Making your custom component block or inline
By default, a custom renderer behaves like a block. So if you're rendering it between texts inside a ``, you'll break your line.
If you want it to be inline, you can slightly change the way you declare it, like this :
```javascript
renderers: {
mytag: { renderer: myTagRenderer, wrapper: 'Text' }, // new way, is inline
myothertag: myOtherTagRenderer // old regular way (still valid, behaves like a block)
}
```
> Note : the only values for `wrapper` are `Text` or `View` (default). Those don't represent the `` and `` component of react-native but are instead used in the parser to prevent crashes and properly render every HTML markup.
### Lists prefixes
The default renderer of the `` and `` tags will either render a bullet or the count of your elements. If you wish to change this without having to re-write the whole list rendering implementation, you can use the `listsPrefixesRenderers` prop.
Just like with the `renderers` prop, supply an object with `ul` and/or `ul` as functions that receive the [same arguments as your custom HTML tags](#custom-html-tags). For instance, you can swap the default black bullet of `` with a blue cross :
```javascript
// ... your props
ul: (htmlAttribs, children, convertedCSSStyles, passProps) => {
return (
+
);
}
```
## Styling
In addition to your custom renderers, you can apply specific styles to HTML tags (`tagsStyles`) or HTML classes (`classesStyles`). You can also combine these styles with your custom renderers.
Styling options override themselves, so you might render a custom HTML tag with a [custom renderer](#creating-custom-renderers) like ``, make it green with a class `` or make it red by styling the tag itself.
The default style of your custom renderer will be merged to the one from your `classesStyles` which will also be merged by the `style` attribute.
> **IMPORTANT NOTE : Do NOT use the `StyleSheet` API to create the styles you're going to feed to `tagsStyle` and `classesStyles`. Although it might look like it's working at first, the caching logic of `react-native` makes it impossible for this module to deep check each of your style to properly apply the precedence and priorities of your nested tags' styles.**
Here's a usage example
```javascript
// props
tagsStyles: { i: { textAlign: 'center', fontStyle: 'italic', color: 'grey' } },
classesStyles: { 'last-paragraph': { textAlign: 'right', color: 'teal', fontWeight: '800' } }
const html = `
Here, we have a style set on the "i" tag with the "tagsStyles" prop.
Finally, this paragraph is styled through the classesStyles prop
`;
```

## Images
By default, unstyled images will be rendered with their respective height and width without resizing. You can force their dimensions by using the `style` attribute in your HTML content or [style](#styling) them with a class or through the `
` tag.
If you can't set the dimension of each image in your content, you might find the `imagesMaxWidth` prop useful. It resizes (and keeps proportions) your images to a maximum width, ensuring that your images won't overflow out of your viewport.
A nice trick, demonstrated in the [basic usage of this module](#basic-usage) is to use the `Dimensions` API of react-native : `imagesMaxWidth={Dimensions.get('window').width}`. You could subtract a value to it to make a margin.
Please note that if you set width AND height through any mean of styling, `imagesMaxWidth` will be ignored.
Before their dimensions have been properly retrieved, images will temporarily be rendered in 100px wide squares. You can override this default value with prop `imagesInitialDimensions`.
Images with broken links will render an empty square with a thin border, similar to what safari renders in a webview.
Please note that all of these behaviors are implemented in the default `
` renderer. If you want to provide your own `
` renderer, you'll have to make this happen by yourself. You can use the `img` function in `HTMLRenderers.js` as a starting point.
## Altering content
`alterData` and `alterChildren` props are very useful to make some modifications on the structure of your HTML before it's actually rendered with react components.
They both are functions that receive the parsed `node` as their first and only parameter. You must return your changes: a `string` with `alterData` and an `array` with `alterChildren` or a falsy value if you don't need to change anything.
### alterData
`alterData` allows you to change the text content of your nodes. For instance, you can customize the content of `