|
| 1 | +--- |
| 2 | +title: Badges |
| 3 | +description: Display small labels for status, versions, and metadata inline with your content. |
| 4 | +--- |
| 5 | + |
| 6 | +Use the `Badge` component to display small pieces of information, such as status indicators, categories, versions, or release dates. |
| 7 | + |
| 8 | +To display longer notes, use the [Callouts component](/docs/writing-content/components/callouts) instead. |
| 9 | + |
| 10 | +<Tabs> |
| 11 | +<Tab title="Badge example"> |
| 12 | + |
| 13 | +### Plant Care API <Badge intent="info">v2.1.0</Badge> <Badge intent="launch" minimal>New</Badge> |
| 14 | + |
| 15 | +</Tab> |
| 16 | +<Tab title="Markdown"> |
| 17 | + |
| 18 | +```jsx |
| 19 | +### Plant Care API <Badge intent="success">v2.1.0</Badge> <Badge intent="launch" minimal>New</Badge> |
| 20 | +``` |
| 21 | + |
| 22 | +</Tab> |
| 23 | +</Tabs> |
| 24 | + |
| 25 | +## Badge varieties |
| 26 | + |
| 27 | +### Success |
| 28 | + |
| 29 | +<Badge intent="success">Success</Badge> |
| 30 | + |
| 31 | +```jsx |
| 32 | +<Badge intent="success">Success</Badge> |
| 33 | +``` |
| 34 | + |
| 35 | +### Note |
| 36 | + |
| 37 | +<Badge intent="note">Note</Badge> |
| 38 | + |
| 39 | +```jsx |
| 40 | +<Badge intent="note">Note</Badge> |
| 41 | +``` |
| 42 | + |
| 43 | +### Tip |
| 44 | + |
| 45 | +<Badge intent="tip">Tip</Badge> |
| 46 | + |
| 47 | +```jsx |
| 48 | +<Badge intent="tip">Tip</Badge> |
| 49 | +``` |
| 50 | + |
| 51 | +### Warning |
| 52 | + |
| 53 | +<Badge intent="warning">Warning</Badge> |
| 54 | + |
| 55 | +```jsx |
| 56 | +<Badge intent="warning">Warning</Badge> |
| 57 | +``` |
| 58 | + |
| 59 | +### Error |
| 60 | + |
| 61 | +<Badge intent="error">Error</Badge> |
| 62 | + |
| 63 | +```jsx |
| 64 | +<Badge intent="error">Error</Badge> |
| 65 | +``` |
| 66 | + |
| 67 | +### Info |
| 68 | + |
| 69 | +<Badge intent="info">Info</Badge> |
| 70 | + |
| 71 | +```jsx |
| 72 | +<Badge intent="info">Info</Badge> |
| 73 | +``` |
| 74 | + |
| 75 | +### Launch |
| 76 | + |
| 77 | +<Badge intent="launch">Launch</Badge> |
| 78 | + |
| 79 | +```jsx |
| 80 | +<Badge intent="launch">Launch</Badge> |
| 81 | +``` |
| 82 | + |
| 83 | +### Check |
| 84 | + |
| 85 | +<Badge intent="check">Check</Badge> |
| 86 | + |
| 87 | +```jsx |
| 88 | +<Badge intent="check">Check</Badge> |
| 89 | +``` |
| 90 | + |
| 91 | +## Properties |
| 92 | + |
| 93 | +Customize your Badges using the following properties: |
| 94 | + |
| 95 | +<ParamField path="intent" type="string" required={true}> |
| 96 | + The semantic color of the badge. Available options: `success`, `note`, `tip`, `warning`, `error`, `info`, `launch`, `check` |
| 97 | +</ParamField> |
| 98 | + |
| 99 | +<ParamField path="minimal" type="boolean" required={false} default="false"> |
| 100 | + Displays the badge with a more subtle background style. Can be combined with `outlined`. |
| 101 | +</ParamField> |
| 102 | + |
| 103 | +<ParamField path="outlined" type="boolean" required={false} default="false"> |
| 104 | + Displays the badge with an outlined border style. Can be combined with `minimal`. |
| 105 | +</ParamField> |
| 106 | + |
| 107 | +<br /> |
| 108 | + |
| 109 | +<Tabs> |
| 110 | +<Tab title="Success badge with different styles"> |
| 111 | +<Badge intent="success">Default</Badge> <br /> |
| 112 | +<Badge intent="success" minimal>Minimal</Badge> <br /> |
| 113 | +<Badge intent="success" outlined>Outlined</Badge> <br /> |
| 114 | +<Badge intent="success" minimal outlined>Minimal and outlined</Badge> |
| 115 | +</Tab> |
| 116 | +<Tab title="Markdown"> |
| 117 | +```markdown |
| 118 | +<Badge intent="success">Default</Badge> <br /> |
| 119 | +<Badge intent="success" minimal>Minimal</Badge> <br /> |
| 120 | +<Badge intent="success" outlined>Outlined</Badge> <br /> |
| 121 | +<Badge intent="success" minimal outlined>Minimal and outlined</Badge> |
| 122 | +``` |
| 123 | +</Tab> |
| 124 | +</Tabs> |
0 commit comments