GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.nativebase.io β€” Badge | NativeBase | Universal Components for React and React Native

Badge | NativeBase | Universal Components for React and React Native

NativeBase
3.4.x
πŸŽ‰ Prompt to React Native UI
β†’
Search
⌘
K
Hire us
NativeBase
Introduction
Getting Started
Installation
Setup NativeBase Provider
Migration
Upgrading to v3
Upgrading to 3.2.0 from 3.x
Upgrading to 3.4.0 from 3.3.x
Components Migration
ActionSheet
Badge
Button
Card
Checkbox
DatePicker
DeckSwiper
Drawer
FABs
FooterTab
Form
Header
Icon
Layout
Picker
Radio Button
Searchbar
Segment
Spinner
SwipeList
Tabs
Thumbnail
Toast
Typography
Resources
Contribution
Creating a Universal App with NativeBase and Solito
Core Concepts
Utility First
Utility Props Specificity
Design Tokens
Pseudo Props: Overview
Pseudo Props: Dos & Don'ts
Internal Pseudo Props
Responsive
Features
Utility Props
Color mode (Dark Mode)
NativeBase Factory
SafeAreaView Props
Strict Mode
Accessibility
Theme
Default Theme
Customizing Theme
Customizing Fonts
Customizing Components
Making components dark mode compatible
Breakpoints
Using Theme
TypeScript
Layout
AspectRatio
Box
Center
Container
Flex
HStack / Row
Stack
VStack / Column
ZStack
Forms
Button
Pressable
Checkbox
FormControl
IconButton
Input
Link
Radio
Select
Slider
Switch
TextArea
Data Display
Badge
Divider
Feedback
Alert
Progress
Skeleton
Spinner
Toast
Typography
Text
Heading
Overlay
AlertDialog
Menu
Modal
Popover
Tooltip
Disclosure
ActionSheet
Media and Icons
Avatar
Icon
Image
Transition
PresenceTransition
Slide
Stagger
Others
Fab
Hidden
ReactNative Components
ScrollView
View
KeyboardAvoidingView
StatusBar
FlatList
SectionList
Hooks
useDisclose
useBreakpointValue
useClipboard
useMediaQuery
useTheme
useToken
useColorMode
useColorModeValue
useContrastText
useAccessibleColors
Examples
Todo-List
Kitchen Sink
Recipes
Designs
AppBar
Card
Drawer Navigation
Tab View
Swipe List
Forms
Form with Validation
Login/Signup Forms
SearchBar
Layout
App Drawer
Footer
More
Changelog
Testing
FAQ's
More Props
If you are starting a new project, please try gluestack-ui for better performance and new design.
Badge
Badges allow the highlighting of an item’s status. This provides quick recognition.
Show Code
Playground
function Example() {
return <Badge shadow={2}>NEW FEATURE</Badge>;
}
Import
Copy
import { Badge } from 'native-base';
Examples
Basic
Playground
function Example() {
return <Box alignItems="center">
<Badge>NEW FEATURE</Badge>
</Box>;
}
Color Scheme
Playground
function Example() {
return <HStack space={{
base: 2,
sm: 4
}} mx={{
base: "auto",
md: 0
}}>
<Badge colorScheme="success">SUCCESS</Badge>
<Badge colorScheme="danger">DANGER</Badge>
<Badge colorScheme="info">INFO</Badge>
<Badge colorScheme="coolGray">DARK</Badge>
</HStack>;
}
Variants
Playground
//@ts-nocheck
function Example() {
return <Box alignItems="center">
<HStack space={4} mx={{
base: "auto",
md: "0"
}}>
{["solid", "outline", "subtle"].map(key => <VStack key={key} space={4}>
<Badge variant={key} alignSelf="center">
DEFAULT
</Badge>
<Badge colorScheme="success" alignSelf="center" variant={key}>
SUCCESS
</Badge>
<Badge colorScheme="error" alignSelf="center" variant={key}>
ERROR
</Badge>
<Badge colorScheme="info" alignSelf="center" variant={key}>
INFO
</Badge>
<Badge colorScheme="warning" alignSelf="center" variant={key}>
WARNING
</Badge>
</VStack>)}
</HStack>
</Box>;
}
Composition
Playground
function Example() {
return <Box alignItems="center">
<VStack>
<Badge // bg="red.400"
colorScheme="danger" rounded="full" mb={-4} mr={-4} zIndex={1} variant="solid" alignSelf="flex-end" _text={{
fontSize: 12
}}>
2
</Badge>
<Button mx={{
base: "auto",
md: 0
}} p="2" bg="cyan.500" _text={{
fontSize: 14
}}>
Notifications
</Button>
</VStack>
</Box>;
}
Props
Badge implements
View
,
SafeAreaProps
,
PlatformProps
,
FlexProps
,
ColorProps
,
LayoutProps
,
BorderProps
,
TypographyProps
,
ShadowProps
,
PositionProps
variant
The style variant of the badge.
Type: ResponsiveValue<"subtle" | "solid" | "outline" | (string & {})>
Default: subtle
colorScheme
The color scheme to use for the badge. Must be a key in theme.colors.
Type: ColorSchemeType
rightIcon
The right icon element to use in the button.
Type: Element | Element[]
leftIcon
The left icon element to use in the button.
Type: Element | Element[]
startIcon
The start icon element to use in the button.
Type: Element | Element[]
endIcon
The end icon element to use in the button.
Type: Element | Element[]
_text
Props to style the child text
Type: InterfaceTextProps<ITextProps> & VariantSizeColorScheme<"Text">
_icon
Props to be passed to the Icon used inside of Button.
Type: InterfaceIconProps & Partial<{}> & VariantSizeColorScheme<"Icon">
Styling
NativeBase ships with a default theme for each component. Check out the default theme of the badge
here
.
Info: We can easily extend the badge component theme using extendTheme function as described in the documentation
here
.
Previous
TextArea
Next
Divider
Quick Nav
Import
Examples
Basic
Color Scheme
Variants
Composition
Props
Styling
MadeWithNativeBase
gluestack-ui
You are visitor 01402775 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.