mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Description Two duplicated-word typos in shipped content: - `apps/design-system/content/docs/components/badge.mdx:7`: "should **be be** self-evident" (rendered by the design-system docs) - `apps/www/_blog/2024-08-12-postgres-new.mdx:230`: "a number **of of** other things" (rendered blog post) ## I have read the CONTRIBUTING.md YES <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Corrected a duplicated word in the Badge component documentation. * Fixed a typo in the PGlite deep-dive blog post. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
---
|
|
title: Badge
|
|
description: Add contextual metadata to another item.
|
|
component: true
|
|
---
|
|
|
|
Badge displays contextual information such as surrounding state or product category. Its purpose should be self-evident based on surrounding context.
|
|
|
|
<ComponentPreview name="badge-demo" peekCode />
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { Badge } from '@/components/ui/badge'
|
|
```
|
|
|
|
```tsx
|
|
<Badge variant="default">Default</Badge>
|
|
```
|
|
|
|
Avoid altering the Badge style, such as text case or roundedness. Consistent implementation makes Badge immediately recognizable throughout Supabase for denoting state or category. Use or create another component for other use cases, such as compute size and status.
|
|
|
|
Keep Badge text to one or two words as it is designed to support other elements, not as a primary communication aid.
|
|
|
|
Badge is designed to stand out, so should be used sparingly.
|
|
|
|
## Examples
|
|
|
|
### States
|
|
|
|
<ComponentPreview name="badge-state" peekCode />
|
|
|
|
### Secondary
|
|
|
|
A content-only variant similar to the `text` variant of [Button](../components/button#types).
|
|
|
|
<ComponentPreview name="badge-secondary" peekCode />
|