2.0.0-rc.4 • Published 9 months ago

@asphalt-react/badge v2.0.0-rc.4

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
9 months ago

Badge

npm

A Badge nudges users to notify them of any action that took place or status of an element or feature. It accepts content to show a value, for example number of notifications, or text like "new" or "coming soon". You can choose to display text content in uppercase. Badges have different intents and defaults to "neutral".

Usage

import { Badge } from "@asphalt-react/badge"

<Badge />

<Badge>25</Badge>

Intents

Badge supports 6 intents:

  • neutral (default): demands less user attention
  • brand: brand related nudges
  • danger: denotes an element of risk like deletion
  • success: nudges to denote successful actions
  • info: an informative nudge
  • warning: demands more attention than info

Props

children

Content for Badge.

typerequireddefault
nodefalsenull

neutral

Applies neutral intent.

typerequireddefault
boolfalsefalse

brand

Applies brand intent.

typerequireddefault
boolfalsefalse

danger

Applies danger intent.

typerequireddefault
boolfalsefalse

warning

Applies warning intent.

typerequireddefault
boolfalsefalse

info

Applies info intent.

typerequireddefault
boolfalsefalse

success

Applies success intent.

typerequireddefault
boolfalsefalse

uppercase

Transforms the text to uppercase.

typerequireddefault
boolfalsefalse