Skip to content

Latest commit

 

History

History
executable file
·
104 lines (98 loc) · 2.92 KB

Badge.md

File metadata and controls

executable file
·
104 lines (98 loc) · 2.92 KB

Badge

Preview ios Badge Preview android Badge

Syntax

import React, { Component } from 'react';
import { Container, Content, Badge, Text } from 'native-base';
export default class BadgeExample extends Component {
    render() {
        return (
            <Container>
                <Content>
                    <Badge>
                        <Text>2</Text>
                    </Badge>
                    <Badge primary>
                        <Text>2</Text>
                    </Badge>
                    <Badge success>
                        <Text>2</Text>
                    </Badge>
                    <Badge info>
                        <Text>2</Text>
                    </Badge>
                    <Badge warning>
                        <Text>2</Text>
                    </Badge>
                    <Badge danger>
                        <Text>2</Text>
                    </Badge>
                    <Badge primary>
                      <Icon name="star" />
                  </Badge>
                    <Badge
                      style={{ backgroundColor: 'black' }}>
                        <Text style={{ color: 'white' }}>1866</Text>
                    </Badge>
                </Content>
            </Container>
        );
    }
}

Configuration

Property Default Option Description
primary - true,false Add a blue background color to your component
success - true,false Add a green background color to your component
info - true,false Add a light blue background color to your component as shown
warning - true,false Add a yellow warning background color to your component
danger - true,false Add a red background color to your component