Skip to content

Latest commit

History

History
42 lines (28 loc) 路 745 Bytes

badge.md

File metadata and controls

42 lines (28 loc) 路 745 Bytes

Badge

Badge can be used to indicate a status of a certain item, usually positioned nearby the element it's related to.

Theme | Example code

Usage

import React from 'react';
import {render, Box} from 'ink';
import {Badge} from '@inkjs/ui';

function Example() {
	return (
		<Box gap={2}>
			<Badge color="green">Pass</Badge>
			<Badge color="red">Fail</Badge>
			<Badge color="yellow">Warn</Badge>
			<Badge color="blue">Todo</Badge>
		</Box>
	);
}

render(<Example />);

Props

children

Type: ReactNode

Label.

color

Type: TextProps['color']

Color.