Yuan's Blog

Frontend Design Language Basics

1. Tabs vs Headings: Structure vs Interaction

In web design, Tabs and Headings are often confused, but they represent two completely different concepts:

TypeAnalogyFeatures
TabsLike the “section dividers” at the top of a magazineNo fixed HTML semantics; require JavaScript for state control; used to switch content blocks.
HeadingsLike section titles in an articleStructural elements (<h1> ~ <h6>) that define content hierarchy.

👉 In one sentence: Tabs focus on interaction switching, while Headings focus on document structure.


2. Icon vs Badge: Visual Expression of Function vs Status

🔹 Icon

Icons represent functions or objects. For example:

IconNameMeaning
🔍Search IconSearch function
⚙️Settings IconSettings function
🔔Notification IconNotification center

Icons emphasize recognition of an action or object — they’re entry points for operations.


🔸 Badge

A badge is a visual indicator of state or quantity. There are four common types:

TypeExampleMeaning
🔢 Count Badge99+Shows quantity, such as messages or notifications
🟢 Status BadgeOnline / NewIndicates current state
🔴 Dot BadgeRed dotSignals new content, no number
🏷️ Label BadgeBeta / ProDisplays version or label

👉 In one sentence: An Icon shows what it is, while a Badge shows what state it’s in.


3. Sidebar Navigation vs Vertical Navigation

Both are vertical (column-based) navigation structures, but they differ in position and purpose:

TypeDefinitionUse Case
Sidebar NavigationFixed navigation area on the page edge (left or right)Admin dashboards, app main interfaces
Vertical NavigationA vertical list of navigation links appearing anywhereInside content areas or card sections

👉 You can think of it this way: Every Sidebar is a Vertical Navigation, but not every Vertical Navigation is a Sidebar.


4. Command Palette vs Action Panel

TypeCore LogicUser Intent
Command PaletteUser actively types a command to perform an action (e.g. VS Code’s ⌘+Shift+P)“I know what I want—just let me do it.”
Action PanelDisplays all possible actions related to the current object“I’m looking at something—what can I do with it?”

5. Alert, Modal Dialog, and Notification: Key Differences

TypePurposeUser Action
AlertProvides informationRead-only, no interaction needed
Modal DialogRequires immediate decisionMust interact, e.g. “Confirm Delete”
NotificationInforms user of background eventsCan ignore, doesn’t interrupt workflow

6. Pill Badge Style Comparison

TypeFeatureVisual Style
Small Flat Pill BadgeSmall, solid background, rounded edgesLightweight but noticeable
Pill with BorderHollow, outlined, no backgroundClean and minimal look

7. Button Types: Primary / Secondary / Soft

TypeBackground StyleUse Case
Primary ButtonSolid backgroundMain actions like “Submit” or “Save”
Secondary ButtonBordered + transparent backgroundSupporting actions like “Cancel” or “Back”
Soft (Ghost) ButtonAlmost transparent or lightly shadedNon-critical, unobtrusive actions

👉 In one sentence: The primary button executes the main action, the secondary offers alternatives, and the soft button handles minor functions.


8. Container and Layout Control

A Container defines the maximum content width and centers it on the page.

TypeFeaturePurpose
Full-widthStretches across the entire viewportDashboards, showcase pages
ConstrainedMax width limited (e.g. 1280px) and centeredArticle or blog content
BreakpointAdjusts width based on deviceResponsive layouts
Padded ContentAdds inner spacing (padding)Improves readability
NarrowSpecially narrow containerLong-form reading or blog text

9. Card and Responsive Behavior

“Well, edge-to-edge on mobile”

A Card is a backgrounded information block.

  • On mobile (📱): usually full-width (edge-to-edge) for immersion and space efficiency.
  • On desktop (💻): typically centered (constrained) for readability and visual balance.

10. Media Object Layout Pattern

A Media Object is a classic UI layout pattern:

Media (avatar, image, or icon) on the left or right, with text (title, description, actions) beside it.

Common use cases include:

  • Comment lists (avatar + text)
  • News cards (thumbnail + content)
  • Chat messages (avatar + speech bubble)

Conclusion

Understanding these basic UI components and layout principles is like mastering the grammar of web interfaces. Once you can clearly distinguish Tabs vs Headings, Icons vs Badges, and Primary vs Soft Buttons, your design and code will become more consistent, readable, and semantically meaningful.

🧩 “Design language” isn’t just about style—it’s about the semantic logic behind every element in the interface.