Lit Material Components Demo

Buttons

Text Contained Outlined Secondary Error Disabled

Button Groups

Outlined (Horizontal)

One Two Three

Contained (Horizontal)

Left Center Right

Text (Horizontal)

First Second Third

Vertical

Top Middle Bottom

Small Size

Small Buttons

Full Width

Full Width Group

Button Groups

Outlined (Horizontal)

One Two Three

Contained (Horizontal)

Left Center Right

Text (Horizontal)

First Second Third

Vertical

Top Middle Bottom

Small Size

Small Buttons

Full Width

Full Width Group

Badges

Basic Badges

📧
🔔
📁

Dot Badges

📧
🔔
💬

Positioning

TR
TL
BR
BL

Circular Overlap

👤
👤

Color Variants

Max Value & Zero Handling

📧
📧
📧

Avatars

Image Avatars

Letter Avatars

Icon Avatars

Sizes

Variants

With Badges

Avatar Group

Lists

Basic List

List with Icons

List with Avatars

List with Secondary Actions

📷 💼

Dense List

List with Subheader

Selectable List

Floating Action Buttons

Basic FABs

Sizes

Extended FABs

Add Item Edit Save Changes

Extended FAB Sizes

Small Medium Large

Color Variants

Disabled State

Disabled

Positioned FAB (Fixed)

This area demonstrates a positioned FAB. In a real application, you would position FABs using CSS like: position: fixed; bottom: 16px; right: 16px;

Text Fields

Number Fields

Basic Number Fields

With Min/Max Constraints

Different Step Values

Without Steppers

Sizes and States

Full Width

Textarea Autosize

Basic Textarea Autosize

Textarea that automatically adjusts height based on content.

With Helper Text and Validation

Different Sizes

Row Constraints

Resize Options

States

Full Width Example

Pre-filled Content

Toggle Buttons

Basic Toggle Buttons

Toggle Button Groups (Exclusive)

Small Medium Large

Multiple Selection (Non-Exclusive)

Bold Italic Underline

Sizes

1 2 3 1 2 3 1 2 3

Color Variants

A B A B A B A B

Full Width

Option 1 Option 2 Option 3

Disabled State

Disabled A B C

App Bars

Basic App Bar

My App

Color Variants

Primary App Bar Secondary App Bar Default App Bar Transparent App Bar

Dense Variant

Dense App Bar

With Search

Search App

No Elevation

Flat App Bar Login

With Avatar and Menu

Dashboard

Drawers

Temporary Drawer

Open Left Open Right Open Top Open Bottom
Navigation Settings
Account Settings Notifications

Dark Mode

Save Changes
Notifications
You have 3 new notifications
Quick Actions
Share Copy Delete Archive

Persistent Drawer

Toggle Persistent Drawer
A My App
Main Content This is the main content area. The persistent drawer can be toggled to show/hide the navigation. When open, it pushes the content to the right. When closed, the content expands to fill the space.

Permanent Drawer

Always Visible
Main Content This permanent drawer is always visible and cannot be closed. It's useful for primary navigation in desktop applications where screen space is not a concern.

Custom Width Drawer

Open Wide Drawer Wide Navigation (400px)
This drawer has a custom width of 400px, making it wider than the default 240px. This is useful when you need more space for content or longer navigation labels. User Profile
John Doe john.doe@example.com

Bottom Navigation

Basic Bottom Navigation

Content Area

Show Labels

Content Area

With Badges

Content Area

Three Actions

Content Area

With Disabled Action

Content Area

Mobile App Simulation

9:41 100%
My App
Welcome This is a mobile app simulation with bottom navigation.

Transfer List

Basic Transfer List

Dense Transfer List

With Disabled Items

Disabled Transfer List

Checkboxes & Switches

Radio Buttons

Progress Indicators

Linear Progress (Legacy Components)

Circular Progress (Legacy Components)

Unified Progress Component - Linear

Indeterminate

Determinate

Buffer

Query

With Label

Custom Label

Unified Progress Component - Circular

Indeterminate

Determinate

With Labels

Custom Thickness

Color Variants

Skeleton

Text Skeletons

Rectangular Skeletons

Rounded Skeletons

Circular Skeletons

Animation Types

Pulse Animation (Default)

Wave Animation

No Animation

Card Skeleton Example

List Skeleton Example

Custom Dimensions

Snackbar

Basic Snackbars

Show Basic With Action Closable

Severity Variants

Success Info Warning Error

Variants

Standard Filled Outlined

Positioning

Top Left Top Center Top Right Bottom Left Bottom Center Bottom Right

Auto Hide Duration

2 Seconds 4 Seconds 8 Seconds Persistent

Complex Examples

Upload Success Connection Error Update Available

Multiple Snackbars

Show Multiple Hide All

Breadcrumbs

Basic Breadcrumbs

Custom Separators

With Icons

Collapsed Breadcrumbs

Interactive Examples

Navigation Breadcrumbs

Click on any breadcrumb to navigate (simulated)

File System Breadcrumbs

Simulates file system navigation with folder icons

E-commerce Breadcrumbs

Product category navigation example

Disabled Items

Long Breadcrumbs

Links

Basic Links

Basic Link Primary Link Secondary Link Inherit Color

Color Variants

Error Link Warning Link Info Link Success Link Text Primary Text Secondary

Underline Options

No Underline Hover Underline Always Underline

Variants

Text Variant Outlined Variant Contained Variant

Outlined Variants

Primary Secondary Error Warning Info Success

Contained Variants

Primary Secondary Error Warning Info Success

External Links

External Link GitHub MDN Docs

External links automatically show an icon and include proper rel attributes

Button Component

Button Link Outlined Button Contained Button

Use component="button" for links that trigger actions instead of navigation

Disabled Links

Disabled Link Disabled Outlined Disabled Contained

Interactive Examples

Navigation Links

Home About Services Contact

Action Links

Save Changes Delete Item Submit Form

Click any link to see the event in console

In Text Context

This is a paragraph with inline links that demonstrate how links work within text content. You can also have external links and action links mixed in with regular text content.

Menus

Basic Menu

Open Menu

Menu with Icons

Menu with Icons

Selected Menu

Selected Menu

Menu Positioning

Positioned Menu

Menu with Submenus

Submenu Example

Menu with Dividers

Menu with Dividers

Accordions

Basic Accordions

Accordion 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget. Accordion 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget. Disabled Accordion This accordion is disabled and cannot be expanded.

Outlined Variant

General Settings Configure general application settings and preferences. Privacy Settings Manage your privacy settings and data sharing preferences. Notification Settings Control how and when you receive notifications.

With Actions

User Profile Update your profile information and account settings. Cancel Save Security Settings Configure two-factor authentication and password settings. Reset Update

Controlled Accordion

Controlled Panel 1 This accordion's state is controlled by JavaScript. Only one can be open at a time. Controlled Panel 2 When you open this panel, the other one will automatically close. Controlled Panel 3 This demonstrates exclusive accordion behavior.

Complex Content

Form Example
Subscribe to newsletter
List Example

Speed Dial

Basic Speed Dial

Click the floating action button in the bottom-right corner to see the speed dial actions.

Direction Variants

Direction: Up

Direction: Down

Direction: Left

Direction: Right

Color Variants

Default

Primary

Secondary

Custom Icons

Speed dial with custom main icon and open icon.

Controlled Speed Dial

Open Speed Dial Close Speed Dial Toggle Speed Dial

This speed dial is controlled by the buttons above.

Box Layout

Basic Box

Basic box with padding Primary colored box Box with border

Flexbox Layout

Flex Item 1 Flex Item 2 (flex: 2) Flex Item 3

Spacing System

Margin Examples

m="1" m="2" m="3"

Padding Examples

p="1" p="2" p="3" p="4"

Directional Spacing

pt="3" pb="1" px="3" py="1"

Alignment & Justification

Justify Content

Start End

Center Alignment

Centered Content

Flex Direction Column

Item 1 Item 2 Item 3

Colors & Styling

Theme Colors

Primary Secondary Success Error Warning Info

Grey Palette

50 100 200 300 400 500

Custom Colors & Borders

Custom Blue Custom Purple With Shadow

Sizing & Positioning

Width & Height

100x60 150x80 200x100

Min/Max Constraints

Min 150px, Max 200px width Min 80px height

Positioning

Top Left Top Right Bottom Center

Typography & Text

Large Bold Primary Text Medium Weight Secondary Text Small Uppercase Text Centered Text in Box Right-aligned italic text

Complex Layout Example

Card Header Tag 1 Tag 2 This is a complex layout example using only Box components. It demonstrates how you can build sophisticated layouts using the Box component's flexbox and styling properties. Metric 1 1,234 Metric 2 5,678 Metric 3 9,012

Container Layout

Basic Container

Default Container (lg max-width)

Container Sizes

Extra Small (xs) - 444px max

XS Container (444px max)

Small (sm) - 600px max

SM Container (600px max)

Medium (md) - 900px max

MD Container (900px max)

Large (lg) - 1200px max

LG Container (1200px max)

Extra Large (xl) - 1536px max

XL Container (1536px max)

Fluid Container

Fluid Container (no max-width constraint)

Container with Gutters vs No Gutters

Default (with gutters/padding)

Container with default padding (16px mobile, 24px desktop)

Disabled gutters (no padding)

Container without padding (disableGutters)

Fixed Height Container

Fixed Container (min-height: 100vh when not constrained)

Responsive Behavior

Responsive Container
Resize your browser to see the container adapt:
<600px: Full width | 600px+: 600px max | 900px+: 900px max | 1200px+: 1200px max

Real-world Example

Welcome to Our App

Built with Material Design Container

1

Responsive

Adapts to different screen sizes automatically

2

Centered

Content is automatically centered with proper margins

3

Consistent

Provides consistent spacing and layout patterns

Grid Layout

Basic Grid

xs=12 sm=6 md=4
xs=12 sm=6 md=4
xs=12 sm=6 md=4

Responsive Breakpoints

Resize your browser to see the grid adapt:
xs (<600px): All items full width | sm (600px+): 2 columns | md (900px+): 3 columns | lg (1200px+): 4 columns
Item 1
Item 2
Item 3
Item 4

Grid Spacing

No Spacing (spacing="0")

1
2
3

Small Spacing (spacing="1")

1
2
3

Large Spacing (spacing="3")

1
2
3

Auto-sizing and Flexible Widths

Auto width
xs=6
Flexible (xs=true)

Grid Alignment

Justify Content Center

1
2

Space Between

1
2

Align Items Center

Short
Taller content that spans multiple lines
Short

Grid Offsets

xs=4
xs=4 offset=4
xs=3 offset=2
xs=3 offset=4

Nested Grids

Main Content (xs=12 md=8)
Nested 1
Nested 2
Nested Full Width
Sidebar (xs=12 md=4)
This sidebar takes full width on mobile and 1/3 width on desktop.

Real-world Layout Example

Dashboard

Grid-based responsive layout

1,234
Total Users
5,678
Orders
$12,345
Revenue
98.5%
Uptime

Chart Area

Chart placeholder (xs=12 lg=8)

Recent Activity

User John signed up
Order #1234 completed
Payment received

Stack Layout

Basic Stack (Vertical)

Item 1
Item 2
Item 3

Horizontal Stack

Item 1
Item 2
Item 3

Stack Spacing

No Spacing (spacing="0")

Item 1
Item 2
Item 3

Small Spacing (spacing="1")

Item 1
Item 2
Item 3

Large Spacing (spacing="4")

Item 1
Item 2
Item 3

Stack Direction

Row (Horizontal)

1
2
3

Row Reverse

1
2
3

Column (Vertical)

1
2
3

Column Reverse

1
2
3

Stack Alignment

Justify Content Center

Item 1
Item 2

Align Items Center

Short
Taller content that spans multiple lines
Short

Space Between

Left
Center
Right

Stack with Dividers

Vertical Stack with Line Dividers

Item 1
Item 2
Item 3

Horizontal Stack with Line Dividers

Item 1
Item 2
Item 3

Custom Text Dividers

Home
Products
Contact

Real-world Examples

Navigation Bar

My App
Home
About
Contact
Login

Form Layout

Contact Form

Card List

Article Title 1
This is a preview of the article content. It gives readers a quick overview of what to expect...
March 15, 2024
Read More
Article Title 2
Another interesting article with valuable insights and information for our readers...
March 12, 2024
Read More
Article Title 3
The third article in our series, covering advanced topics and best practices...
March 10, 2024
Read More

Image Lists

Standard Image List

Quilted Image List

Woven Image List

Masonry Image List

Image List with Title Bars

Custom Grid Sizing

ClickAway Listener

Basic ClickAway Listener

Click outside the blue box to trigger the clickaway event. Check the console for messages.

Click Away Target

This content is wrapped by a ClickAwayListener. Clicking inside this box will NOT trigger the clickaway event. Clicking outside will trigger it.

Dropdown Menu Example

A practical example showing how to use ClickAwayListener with a dropdown menu.

Open Menu

Modal Dialog Example

Using ClickAwayListener to close a modal when clicking outside.

Open Modal

Different Event Types

ClickAwayListener supports different mouse and touch events.

MouseDown Event

Triggers on mousedown outside

MouseUp Event

Triggers on mouseup outside

Disabled State

ClickAwayListener can be disabled to temporarily stop listening for clicks.

Disabled Listener

This listener is disabled and won't trigger clickaway events.

Enable Listener Disable Listener

CSS Baseline

Global CSS Baseline

CssBaseline provides a consistent CSS reset and normalization for the entire document. It's typically used once at the root of your application.

<mui-css-baseline enableColorScheme></mui-css-baseline>

Note: The global CssBaseline is already active on this page. It provides consistent typography, removes default margins/padding, and sets up Material Design defaults.

Typography Examples

Heading 1 (h1)

Heading 2 (h2)

Heading 3 (h3)

Heading 4 (h4)

Heading 5 (h5)
Heading 6 (h6)

This is a paragraph with bold text and italic text. It demonstrates the default typography styles applied by CssBaseline.

This is a link with the default Material Design styling.

Scoped CSS Baseline

ScopedCssBaseline applies baseline styles only to its children, allowing for localized normalization without affecting the global document styles.

Without Scoped Baseline

Sample Heading

This content uses the global baseline styles.

  • List item 1
  • List item 2

With Scoped Baseline

Sample Heading

This content is wrapped in ScopedCssBaseline and inherits its normalized styles.

  • List item 1
  • List item 2

Color Scheme Support

Both components support automatic dark mode detection when enableColorScheme is true.

Color Scheme Aware Content

This content will automatically adapt to the user's preferred color scheme (light or dark mode) when supported by the browser and operating system.

Links and text emphasis will also adapt to the color scheme.

color-scheme: light dark; is applied to enable automatic adaptation.

Form Elements

CssBaseline normalizes form elements for consistent appearance across browsers.

Contact Information

Code and Preformatted Text

Baseline styles include proper formatting for code elements.

Inline code: const example = 'Hello World';

Code block:

function greet(name) {
  return `Hello, ${name}!`;
}

console.log(greet('World'));
          

Keyboard input: Press Ctrl + C to copy

Accessibility Features

CssBaseline includes accessibility improvements like focus indicators and reduced motion support.

Try tabbing through these focusable elements to see the focus indicators:

Focusable Link

Note: Focus indicators automatically adapt to user preferences and support reduced motion settings for accessibility.

Modal

Basic Modal

Click the button to open a basic modal dialog.

Open Basic Modal

Basic Modal

This is a basic modal dialog. You can close it by clicking the backdrop, pressing the Escape key, or using the close button.

Close Save

Modal with Form

Modal containing a form with proper focus management.

Open Form Modal

Contact Form

Modal Options

Test different modal configuration options.

No Backdrop Click No Escape Key Invisible Backdrop Keep Mounted

No Backdrop Click

This modal cannot be closed by clicking the backdrop. You must use the close button or press Escape.

Close

No Escape Key

This modal cannot be closed with the Escape key. You must click the backdrop or use the close button.

Close

Invisible Backdrop

This modal has no visible backdrop, but you can still click outside to close it or press Escape.

Close

Keep Mounted

This modal stays in the DOM even when closed, which can be useful for performance or maintaining state.

Close

Nested Modals

Test modals that open other modals (stacking).

Open First Modal

First Modal

This is the first modal. You can open another modal on top of this one.

Close Open Second Modal

Second Modal

This is the second modal, stacked on top of the first one.

Close Second Modal

Accessibility Features

Modal with comprehensive accessibility features and focus management.

Open Accessible Modal

Accessible Modal

This modal demonstrates accessibility features including proper ARIA attributes, focus management, and keyboard navigation.

Try these accessibility features:

  • Tab through the focusable elements
  • Press Escape to close
  • Focus is trapped within the modal
  • Focus returns to the trigger button when closed
Close Modal

Programmatic API

Create and control modals programmatically using JavaScript.

Create Modal Create Custom Modal

Chips

Alerts

This is an info alert This is a success alert This is a warning alert This is an error alert with close button

Cards

Basic Card

Card Title This is a basic card component with content and actions. Cards contain content and actions about a single subject. Learn More Action

Card with Media

Beautiful Landscape This impressive paella is a perfect party dish and a fun meal to cook together with your guests. Share Learn More

Card with Header and Avatar

JD This adorable cat is looking for a new home. She's very friendly and loves to play. Learn More

Outlined Card

Outlined Card This card uses the outlined variant instead of elevation for a different visual style. Action

Elevation Variants

Elevation 0 No shadow Elevation 1 Light shadow Elevation 3 Medium shadow Elevation 4 High shadow

Interactive Card

Interactive Card This card has hover effects and can be clicked. Try hovering over it to see the elevation change.

Complex Card Layout

Delicious Pizza
A perfect combination of crispy crust, rich tomato sauce, and melted cheese. This recipe has been passed down through generations. View Recipe Save

Typography

h1. Heading h2. Heading h3. Heading body1. Lorem ipsum dolor sit amet. body2. Secondary text.

Autocomplete

Table

Name Age Email Status John Doe 28 john@example.com Jane Smith 32 jane@example.com Bob Johnson 45 bob@example.com

Tabs

Basic Tabs

Content for Tab One This is the first tab panel. You can put any content here including other components. Content for Tab Two Card in Tab You can embed other components in tab panels. Content for Tab Three
Action Button

Tabs with Icons

Home Welcome to the home section. Favorites Your favorite items appear here. Nearby Find locations near you.

Icon-Only Tabs

Phone contacts and call history. Your favorite contacts. Personal profile and settings.

Full Width Tabs

Full width tabs distribute evenly across the container. Each tab takes equal width regardless of label length. This is useful for mobile layouts or fixed-width containers.

Centered Tabs

Centered tabs are aligned to the center of the container. This is useful when you have fewer tabs and want them centered. The tabs maintain their natural width but are centered as a group.

Scrollable Tabs

Scrollable tabs allow for many tabs in a limited space. Use scroll buttons to navigate through all tabs. This is useful for responsive designs. Fourth tab content here. Fifth tab content here. Sixth tab content here. Seventh tab content here.

Vertical Tabs

Personal Information Manage your personal details and profile information. Account Settings Configure your account preferences and security settings. Privacy Control your privacy settings and data sharing preferences. Notifications Manage your notification preferences and alerts.

Secondary Color Indicator

This tab uses a secondary color indicator (purple). Second tab content. Third tab content.

Disabled Tab

This tab is enabled and clickable. This content won't be shown because the tab is disabled. This tab is also enabled.

Stepper

Basic Horizontal Stepper

Select campaign settings Create an ad group Create an ad
Step 1: Select campaign settings For each ad campaign that you create, you can control how much you're willing to spend on clicks and conversions.
Next

Stepper with Optional Step

Create account Add profile picture Verify email
Create your account Enter your basic information to get started.
Next

Stepper with Error State

Select service Payment information Confirmation
Payment Error There was an error processing your payment information. Please check your details and try again.
Back Retry Payment

Alternative Label Stepper

Order placed Processing Shipped Delivered
Alternative label layout centers the labels below each step icon.
Simulate Progress

Vertical Stepper

Setup project Create a new project and configure the basic settings.
Continue
Configure environment Set up your development environment and install dependencies.
Back Continue
Deploy application Deploy your application to the production environment.
Back Deploy

Non-Linear Stepper

Personal details Address information Review & submit
Non-linear steppers allow users to enter a multi-step flow at any point. Click any step to jump to it.
Personal Address Review

Completed Stepper

Account created Profile setup Email verified
Setup Complete! Your account has been successfully set up. You can now start using the application.
Get Started

Backdrop

Basic Backdrop

Click the button to show a basic backdrop. Click the backdrop or press Escape to close it. Show Backdrop

Backdrop with Content

Backdrop can contain any content, not just loading indicators. Show Content Backdrop Backdrop Content This is a card displayed on top of a backdrop. You can put any content here. Close

Invisible Backdrop

Invisible backdrop provides the overlay functionality without the visual background. Show Invisible Backdrop Invisible Backdrop The backdrop is there but invisible. Notice how the background isn't darkened. Close

Custom Transition Duration

Backdrop with slower transition for demonstration purposes. Show Slow Backdrop Slow Transition This backdrop has a 1-second transition duration. Close

High Z-Index Backdrop

Backdrop with custom z-index for layering above other elements. Show High Z-Index Backdrop High Z-Index This backdrop has z-index: 2000 to appear above other overlays. Close

Loading States

Common use case: showing loading states with different indicators.
Circular Loading Linear Loading Text Loading

Nested Backdrops

Demonstration of multiple backdrop layers with different z-indexes. Show Nested Backdrops First Layer This is the first backdrop layer. Click the button to show another layer on top. Show Second Layer Close All Second Layer This is the second backdrop layer on top of the first one. Close This Layer

Event Handling

Backdrop with custom event handling. Check the console for event logs. Show Event Backdrop Event Handling Click outside this card or press Escape to trigger the backdrop-click event. Check the browser console to see the event logs. Close