Font Awesome Build Awesome
Search ⌘KCtrl+K
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Start Components Docs Help
Web Awesome Font Awesome Build Awesome
Search this site… /
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Components

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Input
  • Known Date
  • Number Input
  • OTP Input
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Tag Input
  • Textarea
  • Time Input

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel
  • Timeline
    • Timeline Item

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Pagination
  • Stepper
    • Step
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Toast
    • Toast Item
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Code Highlighter
  • Comparison
  • Icon
  • Lightbox
    • Lightbox Item
  • Markdown
  • QR Code
  • Zoomable Frame

Data Viz

  • Advanced Usage

Helpers

  • Animation
  • Counter
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Number Ticker
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Cluster

  • Examples
  • Align Items
  • Gap
On This Page...
  • Examples
  • Align Items
  • Gap
CSS Utilities Cluster

Cluster

A cluster arranges its children inline with even spacing and wraps them onto a new line whenever the container runs out of room. Reach for it whenever you have a horizontal group of items of varying widths, like tag lists, button rows, inline metadata, or breadcrumb-style trails, and want the layout to stay tidy on every screen size without writing any media queries.

By default, cluster children are centered vertically. Pair wa-cluster with a wa-gap-* class to change the spacing and a wa-align-items-* class to change how items align on the cross axis.

<div class="wa-cluster">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>

<!-- We'll vary the div sizes to show the flow of cluster elements -->
<style>
  .wa-cluster div:empty:nth-child(3n) {
    min-inline-size: 6rem;
  }
  .wa-cluster div:empty:nth-child(3n + 2) {
    min-inline-size: 8rem;
  }
</style>

Examples

Link to This Section

Clusters are great for inline lists and aligning items of varying sizes.

Components Layout Patterns Theming
<div class="wa-cluster">
  <wa-icon name="web-awesome"></wa-icon>
  <a href="#">Components</a>
  <a href="#">Layout</a>
  <a href="#">Patterns</a>
  <a href="#">Theming</a>
</div>

Withywindle Pub and Eatery

4.6 (419 reviews)
• Comfort Food Gastropub Cocktail Bar Vegetarian Gluten Free
<div class="wa-stack">
  <h3 class="wa-heading-2xl">Withywindle Pub and Eatery</h3>
  <div class="wa-cluster wa-gap-xs">
    <wa-rating value="4.6" readonly></wa-rating>
    <strong>4.6</strong>
    <span>(419 reviews)</span>
  </div>
  <div class="wa-cluster wa-gap-xs">
    <div class="wa-cluster wa-gap-3xs">
      <wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
      <wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
      <wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
    </div>
    <span class="wa-caption-s">&bull;</span>
    <wa-tag size="s">Comfort Food</wa-tag>
    <wa-tag size="s">Gastropub</wa-tag>
    <wa-tag size="s">Cocktail Bar</wa-tag>
    <wa-tag size="s">Vegetarian</wa-tag>
    <wa-tag size="s">Gluten Free</wa-tag>
  </div>
</div>

Align Items

Link to This Section

By default, items are centered in the block direction of the wa-cluster container. Add any wa-align-items-* class to change how items line up in the block direction.

<div class="wa-stack">
  <div class="wa-cluster wa-align-items-start" style="min-height: 8rem;">
    <div></div>
    <div></div>
    <div></div>
  </div>
  <div class="wa-cluster wa-align-items-end" style="min-height: 8rem;">
    <div></div>
    <div></div>
    <div></div>
  </div>
  <div class="wa-cluster wa-align-items-center" style="min-height: 8rem;">
    <div></div>
    <div></div>
    <div></div>
  </div>
  <div class="wa-cluster wa-align-items-stretch" style="min-height: 8rem;">
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>

Gap

Link to This Section

By default, the gap between cluster items uses --wa-space-m from your theme. Add any wa-gap-* class to change the spacing between items.

<div class="wa-stack">
  <div class="wa-cluster wa-gap-2xs">
    <div></div>
    <div></div>
    <div></div>
  </div>
  <div class="wa-cluster wa-gap-2xl">
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>
Go Make Something Awesome
Version 3.15.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc