Skip to content

Commit ead616b

Browse files
authored
(docs) Document badge component (#1050)
1 parent 774138e commit ead616b

File tree

3 files changed

+130
-1
lines changed

3 files changed

+130
-1
lines changed

fern/products/docs/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ navigation:
4444
- page: Aside
4545
path: ./pages/component-library/default-components/aside.mdx
4646
icon: fa-regular fa-comment-dots
47+
- page: Badges
48+
path: ./pages/component-library/default-components/badges.mdx
49+
icon: fa-regular fa-ribbon
4750
- page: Button
4851
path: ./pages/component-library/default-components/button.mdx
4952
icon: fa-duotone fa-arrow-pointer
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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>

fern/products/docs/pages/component-library/default-components/callouts.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ title: 'Callouts'
33
description: 'Highlight important information, warnings, or tips in your documentation.'
44
---
55

6-
Callouts help highlight important information, warnings, or tips in your documentation. They provide visual emphasis through distinct styling and icons to make key messages stand out to readers.
6+
Callouts help highlight important information, warnings, or tips in your documentation. They provide visual emphasis through distinct styling and icons to make key messages stand out to readers.
7+
8+
To display very short pieces of information like status indicators and version numbers, use the [Badges component](/docs/writing-content/components/badges)
79

810
## Callout varieties
911

0 commit comments

Comments
 (0)