Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 1.45 KB

view.md

File metadata and controls

39 lines (34 loc) · 1.45 KB

View

Properties

Property Type Description
background string Sets the background color of a component.
height number Sets the height of a component.
hidden bool Sets the visibility of a component.
horizontalAlignment string Sets the horizontal alignment of the component's content
Property value "left", "center", "right"
layout string Sets the direction of the content.
Property value "horizontal", "vertical"
margin string Sets the outer margin of a component.
E.G. "30px 20px"
padding string Sets the padding inside a component.
E.G. "30px 20px"
verticalAlignment string Sets the vertical alignment of the component's content.
Property value "top", "center", "bottom"
width number Sets the width of a component.

Examples

import React, { Component } from 'react';
import { View, Text } from 'react-desktop/macOs';

export default class extends Component {
  render() {
    return (
      <View
        background="black"
        padding="20px"
        horizontalAlignment="center"
        verticalAlignment="center"
        width="200px"
        height="100px"
      >
        <Text color="white">Hello World</Text>
      </View>
    );
  }
}