Font Awesome Build Awesome
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Search this website ⌘KCtrl+K Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme View Project on GitHub Star Project on GitHub
Start Components Docs Help
Web Awesome Font Awesome Build Awesome
Search this site… /
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme

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
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Textarea
  • Time Input
  • Data Grid Planned A Web Awesome Kickstarter stretch goal!

Layout

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

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

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

Media

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

Data Viz

  • Advanced Usage

Helpers

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

Astro

  • Installation
  • Usage
  • Server-Side Rendering
  • Install the Adapter
  • Register the Plugin
  • Register Components
  • See It in Action
  • Next Steps
On This Page...
  • Installation
  • Usage
  • Server-Side Rendering
  • Install the Adapter
  • Register the Plugin
  • Register Components
  • See It in Action
  • Next Steps
Frameworks Astro

Astro

Installation

Link to This Section

To add Web Awesome to your Astro app, install the package from npm.

npm install @awesome.me/webawesome

Usage

Link to This Section

Web Awesome components render on the client. Import the ones you need as client scripts, and add the global stylesheet in your frontmatter:

---
import "@awesome.me/webawesome/dist/styles/webawesome.css";
---

<script>
import "@awesome.me/webawesome/dist/components/button/button.js"
</script>

<wa-button>Hello World</wa-button>

Web Awesome is ready to use.
Want server-side rendering too?

Add SSR

Server-Side Rendering

Link to This Section

With server-side rendering, your Web Awesome components render to HTML on the server, so pages display fully styled before client-side JavaScript loads. Learn more in the SSR docs.

To add SSR support to Astro, follow the steps below.

Install the Adapter

Link to This Section

The Web Awesome team maintains an Astro adapter to help you set up SSR. Install it from npm:

npm install @awesome.me/astro-lit

Register the Plugin

Link to This Section

Once installed, you can register the plugin in your astro.config.mjs file.

// astro.config.mjs
import { defineConfig } from 'astro/config';

import lit from '@awesome.me/astro-lit';

// https://astro.build/config
export default defineConfig({
  // ...
  integrations: [lit()],
});

Register Components

Link to This Section

With the plugin in place, register your components in two places — once on the server and once on the client — and make sure the hydration scripts run before any client components.

Import the hydration scripts before any client components.
Otherwise components hydrate more than once and the page breaks.

Here's the previous example updated:

---
// Global CSS
import "@awesome.me/webawesome/dist/styles/webawesome.css";

// server imports
import "@awesome.me/webawesome/dist/components/button/button.js"
---

<script>
// Must run before any client component imports
import "@awesome.me/astro-lit/dsd-polyfill.js"
import "@awesome.me/astro-lit/hydration-support.js"

// client imports
import "@awesome.me/webawesome/dist/components/button/button.js"
</script>

<wa-button>Hello World</wa-button>
That's it! You're set up to use Web Awesome with SSR.

See It in Action

Link to This Section

Need an example of a complete Astro SSR project using Web Awesome?

Example Repository

A complete Astro SSR project using Web Awesome.

Live Demo

See the Astro SSR example deployed and running.

Next Steps

Link to This Section
Components

Start building your interface.

CSS Utilities

Lay out and style without custom CSS.

Theming

Match Web Awesome to your brand.

Astro Docs

The official Astro documentation.

Using Web Awesome with Astro?
Found a bug or have a suggestion? Help make things more awesome!

Share feedback
Go Make Something Awesome
Version 3.10.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