proton-native/docs/component_APIs/styledtext.md
Niklas Mischkulnig 06ee92d1f7 Add styled text (#141)
* Proof of concept fonts

* Inheirit font style

* Use style prop

* More font attributes

* Reset demo

* Fixes

* Font example

* Text transforms, integrate FontButton

* Add docs

* Add StyledText

* Update package lock

* Add StyledText to prop checking

* Update documentation for StyledText

* Add markdown prettier

* Change default font size
2018-06-09 14:04:49 -04:00

726 B

Styled

A wrapper around Area.Text without the need to explicitly create an Area component.

import React, { Component } from 'react';

import { render, Window, App, StyledText, Box } from 'proton-native';

class Example extends Component {
  render() {
    return (
      <App>
        <Window title="Test" size={{ w: 400, h: 400 }} margined>
          <Box>
            <StyledText style={{ fontSize: 16 }}>
              This is some text drawn onto an{' '}
              <StyledText style={{ color: 'red' }}>Area!</StyledText>
            </StyledText>
          </Box>
        </Window>
      </App>
    );
  }
}

render(<Example />);

Props

For props, see Area.Text