>(Badge)
+type MemoBadgeComponent = React.NamedExoticComponent
& {
+ Anchor: typeof BadgeAnchor
+}
+type ComponentProps = Partial & Omit & NativeAttrs
-export default withDefaults(MemoBadge, defaultProps)
+Badge.defaultProps = defaultProps
+
+export default React.memo(Badge) as MemoBadgeComponent
diff --git a/components/badge/index.ts b/components/badge/index.ts
index a712806..191d733 100644
--- a/components/badge/index.ts
+++ b/components/badge/index.ts
@@ -1,3 +1,6 @@
import Badge from './badge'
+import BadgeAnchor from './badge-anchor'
+
+Badge.Anchor = BadgeAnchor
export default Badge
diff --git a/pages/en-us/components/badge.mdx b/pages/en-us/components/badge.mdx
index 953380e..38a0fbc 100644
--- a/pages/en-us/components/badge.mdx
+++ b/pages/en-us/components/badge.mdx
@@ -1,5 +1,5 @@
import { Layout, Playground, Attributes } from 'lib/components'
-import { Badge, Spacer } from 'components'
+import { Badge, Spacer, Avatar, Button, Link } from 'components'
export const meta = {
title: 'Badge',
@@ -48,16 +48,78 @@ Display an indicator that requires attention.
>
`} />
+
+
+ 10
+
+
+
+
+ 10
+
+
+
+
+ 99+
+ Action
+
+
+
+
+ ZEIT UI
+
+
+
+
+ Share Link
+
+>
+`} />
Badge.Props
| Attribute | Description | Type | Accepted values | Default
| ---------- | ---------- | ---- | -------------- | ------ |
-| **type** | badge type | `NormalTypes` | `'default', 'secondary', 'success', 'warning', 'error'` | `default` |
-| **size** | badge size | `NormalSizes` | `'mini', 'small', 'medium', 'large'` | `medium` |
+| **type** | badge type | `NormalTypes` | [NormalTypes](#normaltypes) | `default` |
+| **size** | badge size | `NormalSizes` | [NormalSizes](#normalsizes) | `medium` |
+| **dot** | show dot and ignore content | `boolean` | - | `false` |
| ... | native props | `HTMLAttributes` | `'alt', 'id', 'className', ...` | - |
+Badge.Anchor.Props
+
+| Attribute | Description | Type | Accepted values | Default
+| ---------- | ---------- | ---- | -------------- | ------ |
+| **placement** | fixe position of Badge | `AnchorPlacement` | [AnchorPlacement](#anchorplacement) | `topRight` |
+| ... | native props | `HTMLAttributes` | `'alt', 'id', 'className', ...` | - |
+
+NormalTypes
+
+```ts
+type NormalTypes = 'default'
+ | 'secondary'
+ | 'success'
+ | 'warning'
+ | 'error'
+```
+
+NormalSizes
+
+```ts
+type NormalSizes = 'medium' | 'mini' | 'small' | 'large'
+```
+
+AnchorPlacement
+
+```ts
+type AnchorPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'
+```
+
export default ({ children }) => {children}
diff --git a/pages/zh-cn/components/badge.mdx b/pages/zh-cn/components/badge.mdx
index 4ceabbd..b7409f7 100644
--- a/pages/zh-cn/components/badge.mdx
+++ b/pages/zh-cn/components/badge.mdx
@@ -1,5 +1,5 @@
import { Layout, Playground, Attributes } from 'lib/components'
-import { Badge, Spacer } from 'components'
+import { Badge, Spacer, Button, Link, Avatar } from 'components'
export const meta = {
title: '徽章 Badge',
@@ -48,16 +48,78 @@ export const meta = {
>
`} />
+
+
+ 10
+
+
+
+
+ 10
+
+
+
+
+ 99+
+ 按钮
+
+
+
+
+ 组件库
+
+
+
+
+ 分享链接
+
+>
+`} />
Badge.Props
| 属性 | 描述 | 类型 | 推荐值 | 默认
| ---------- | ---------- | ---- | -------------- | ------ |
-| **type** | 徽章的类型 | `NormalTypes` | `'default', 'secondary', 'success', 'warning', 'error'` | `default` |
-| **size** | 徽章的大小 | `NormalSizes` | `'mini', 'small', 'medium', 'large'` | `medium` |
+| **type** | 徽章的类型 | `NormalTypes` | [NormalTypes](#normaltypes) | `default` |
+| **size** | 徽章的大小 | `NormalSizes` | [NormalSizes](#normalsizes) | `medium` |
+| **dot** | 忽略内容并显示圆点 | `boolean` | - | `false` |
| ... | 原生属性 | `HTMLAttributes` | `'alt', 'id', 'className', ...` | - |
+Badge.Anchor.Props
+
+| 属性 | 描述 | 类型 | 推荐值 | 默认
+| ---------- | ---------- | ---- | -------------- | ------ |
+| **placement** | 固定徽章的位置 | `AnchorPlacement` | [AnchorPlacement](#anchorplacement) | `topRight` |
+| ... | 原生属性 | `HTMLAttributes` | `'alt', 'id', 'className', ...` | - |
+
+NormalTypes
+
+```ts
+type NormalTypes = 'default'
+ | 'secondary'
+ | 'success'
+ | 'warning'
+ | 'error'
+```
+
+NormalSizes
+
+```ts
+type NormalSizes = 'medium' | 'mini' | 'small' | 'large'
+```
+
+AnchorPlacement
+
+```ts
+type AnchorPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'
+```
+
export default ({ children }) => {children}