List of react-native StyleSheet properties and options

前端 未结 2 933
难免孤独
难免孤独 2020-12-28 20:35

I\'ve been searching the web for a list of all the possible react-native StyleSheet options and their values. Not to be found, does anyone have a link to such a documentatio

相关标签:
2条回答
  • 2020-12-28 20:58

    Here they are, separated by component type:

    View

    Image

    Text

    Flexbox

    Transform

    Where you see enum in the documentation, for example on the Text style documentation page:

    fontStyle enum('normal', 'italic')
    fontWeight enum("normal", 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900')
    

    These usually closely resemble css properties you would find on the web.


    UPDATE

    As answered below by @muhammad-hannan, you can also find the full layout properties list there.

    0 讨论(0)
  • 2020-12-28 21:12

    I know this has been answered but since last updates things have been changed. The updated stylesheet properties can be found below, which are now called layout props now:

    https://facebook.github.io/react-native/docs/layout-props.html

    Layout Props List:

    marginHorizontal
    alignContent
    alignSelf
    aspectRatio
    borderBottomWidth
    borderEndWidth
    borderLeftWidth
    borderRightWidth
    borderStartWidth
    borderTopWidth
    borderWidth
    bottom
    display
    end
    flex
    flexBasis
    flexDirection
    flexGrow
    flexShrink
    flexWrap
    height
    justifyContent
    left
    margin
    marginBottom
    marginEnd
    alignItems
    marginLeft
    marginRight
    marginStart
    marginTop
    marginVertical
    maxHeight
    maxWidth
    minHeight
    minWidth
    overflow
    padding
    paddingBottom
    paddingEnd
    paddingHorizontal
    paddingLeft
    paddingRight
    paddingStart
    paddingTop
    paddingVertical
    position
    right
    start
    top
    width
    zIndex
    direction
    
    0 讨论(0)
提交回复
热议问题