LanguageTag
The LanguageTag component provides a clean, consistent way to display programming language indicators. Using monospace typography and design system tokens, it integrates seamlessly with code documentation, project portfolios, and technical content.
Basic Usage
Simple language tags for content identification
TypeScript
Code
<LanguageTag language="TypeScript" /> Multiple Languages
Display multiple technologies in flexible layouts
TypeScriptJavaScriptPythonRustGoSvelte
Code
<LanguageTag TypeScript />
<LanguageTag JavaScript />
<LanguageTag Python />
<LanguageTag Rust />
<LanguageTag Go />
<LanguageTag Svelte />
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
language | string | - | Programming language to display |
class | string | '' | Additional CSS classes |
Design Specifications
- Font Family: Monospace (var(–font-mono))
- Typography: Caption size with design system tokens
- Padding: 4px vertical, 8px horizontal
- Border Radius: 4px for subtle rounding
- Background: Surface secondary with border
Design Philosophy
Developer-Friendly Typography
The component uses monospace fonts to:
- Match code context where tags typically appear
- Provide consistent character width for alignment
- Create familiar feel for technical audiences
- Maintain readability at small sizes
Subtle Visual Design
Clean, minimal aesthetics that:
- Don’t compete with content for attention
- Integrate with existing layouts seamlessly
- Follow design system patterns consistently
- Work in both light and dark themes
Usage Examples
Basic Usage
<script>
import LanguageTag from '$lib/shared/components/layout/LanguageTag.svelte';
</script>
<LanguageTag language="TypeScript" />
<LanguageTag language="Python" />
<LanguageTag language="Rust" /> With Custom Styling
<LanguageTag language="JavaScript" class="highlight-tag" />
<style>
:global(.highlight-tag) {
background: color-mix(in oklch, var(--primary) 15%, var(--surface-secondary));
border-color: var(--primary);
}
</style> In Code Documentation
<div class="code-block">
<div class="code-header">
<LanguageTag language="TypeScript" />
<span class="filename">components/Button.ts</span>
</div>
<pre><code><!-- Your code here --></code></pre>
</div> In Project Cards
<div class="project-card">
<h3>Design System</h3>
<p>Component library with modern tooling</p>
<div class="tech-stack">
<LanguageTag language="Svelte" />
<LanguageTag language="TypeScript" />
<LanguageTag language="CSS" />
</div>
</div> Common Patterns
Code Documentation
Perfect for indicating language context in:
- Code block headers with syntax highlighting
- Tutorial sections showing different languages
- API documentation with language-specific examples
- README files listing supported languages
Project Portfolios
Ideal for showcasing technology stacks:
- Frontend technologies (React, Vue, Svelte)
- Backend languages (Node.js, Python, Go)
- Databases (PostgreSQL, MongoDB, Redis)
- Tools & frameworks (Docker, Kubernetes, etc.)
Blog & Articles
Great for technical content:
- Article metadata showing covered technologies
- Tutorial prerequisites listing required knowledge
- Series navigation grouped by language
- Tag filtering for content discovery
Best Practices
Content Guidelines
- Use official language names when possible (TypeScript vs TS)
- Be consistent with framework vs library naming
- Group related technologies logically
- Limit to 5-7 tags per grouping for scannability
- Order by relevance or alphabetically
Styling Guidelines
- Maintain monospace font for technical consistency
- Use subtle backgrounds that don’t distract
- Follow design system colors for theme compatibility
- Test in both light and dark modes
- Keep custom styling minimal and purposeful
Accessibility
- Use semantic language names (avoid abbreviations)
- Maintain sufficient color contrast (4.5:1 minimum)
- Group related tags with proper markup
- Consider screen reader experience with meaningful content
Integration Examples
With Other Components
Works seamlessly with:
- Card components for project showcases
- Code blocks for syntax highlighting context
- Navigation for filtering and categorization
- Tooltips for additional language information
Responsive Behavior
The component automatically:
- Wraps appropriately in flex containers
- Maintains consistent height regardless of content
- Scales with design system typography settings
- Adapts to theme changes through CSS custom properties