import icons from 'badgen-icons' export default function HomeIntro ({ isFlat }) { return (
{explainCode(isFlat)}

Builtin color names

{colorExamples()}

Builtin icons

{iconExamples()}

Options

Advanced usage

)} const colorExamples = () => { const colors = ['blue', 'cyan', 'green', 'yellow', 'orange', 'red', 'pink', 'purple', 'grey', 'black'] return colors.map(c => ( )) } const iconExamples = () => { return Object.keys(icons).map(icon => { const url = `/badge/icon/${icon}?icon=${icon}&label` return ( ) }) } const explainCode = (isFlat) => { const text = ` https://badgen.net/badge/:subject/:status/:color?icon=github ──┬── ───┬─── ──┬─── ──┬── ────┬────── │ │ │ │ └─ Options (label, list, icon, color) │ │ │ │ │ TEXT TEXT RGB / COLOR_NAME ( optional ) │ "badge" - default (static) badge generator` if (isFlat) { return text .replace('badgen.net', 'flat.badgen.net') .replace(/\n/g, '\n ') .trim() } else { return text.trim() } }