mCloud Design Mobile

mCloud Design Mobile

  • Docs
  • API
  • Help
  • Blog

›Component

Component

  • Button
  • SegmentedControl
  • SearchBar
  • Radio
  • Checkbox
  • Badge
  • Marquee
  • Switch
  • InputItem
  • NoticeBar
  • Textarea
  • List
  • Card
  • Picker
  • Label
  • EmptyView
  • Stepper
  • Tabs
  • DatePicker
  • Modal
  • Avatar
  • ActionSheet
  • ShareSheet

First Category

  • Button
  • Fifth Document

Badge

Badge

Basic Example:

import React from 'react'
import { View } from 'react-native'
import { Badge } from 'mcloud-mobile'

export default () => (
    <View
        style={{
            flex:1,
            alignItems:'center',
            backgroundColor:'#e6e6e6'
        }}
    >
        <Badge text="文本" style={{ marginBottom:4 }} />
        <Badge text="文本" type="redPoint" style={{ marginBottom:4 }} />
        <Badge text="文本" type="number" count={10} style={{ marginBottom:4 }} />
        <Badge text="文本" type="number" count={100} style={{ marginBottom:4 }} />
        <Badge text="文本" type="new" style={{ marginBottom:4 }} />

    </View>
)

Props:

属性说明类型默认值
typeBadge类型,可选值为redPoint/number/newstringredPoint
text文本string''
textStyle文本样式object无
count未读数,type为number时需要number0
showBadge是否显示红色标记booltrue
style自定义样式Object无
onPress点击按钮的点击回调函数(e: Object): void无
← CheckboxMarquee →
  • Basic Example:
  • Props:
mCloud Design Mobile
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2019 Your Name or Your Company Name