Skip to main content

LanguageTag

A clean, monospace tag component for indicating programming languages and technologies

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

PropTypeDefaultDescription
languagestring-Programming language to display
classstring''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

  1. Use official language names when possible (TypeScript vs TS)
  2. Be consistent with framework vs library naming
  3. Group related technologies logically
  4. Limit to 5-7 tags per grouping for scannability
  5. Order by relevance or alphabetically

Styling Guidelines

  1. Maintain monospace font for technical consistency
  2. Use subtle backgrounds that don’t distract
  3. Follow design system colors for theme compatibility
  4. Test in both light and dark modes
  5. Keep custom styling minimal and purposeful

Accessibility

  1. Use semantic language names (avoid abbreviations)
  2. Maintain sufficient color contrast (4.5:1 minimum)
  3. Group related tags with proper markup
  4. 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