Material ui

From oyi77/1ai-skills · View interactive version

Material ui is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when material UI (MUI) React components — theming, styled engine, data grid, date pickers, icons.

How to use this skill

Skill file

Overview

Material UI (MUI) is a comprehensive React component library implementing Google's Material Design. Includes components, icons, date pickers, data grid, and a powerful theming system with styled-engine.

Capabilities

When to Use

Trigger phrases:

When NOT to Use

Pseudo Code

The material-ui workflow follows a standard pipeline pattern.

Core flow:

# material-ui primary flow
input = prepare(raw_data)
result = process(input, config={components, data, date, engine, grid})
validate(result)
deliver(result)

Error handling:

on error:
  log(error_details)
  retry_with_backoff(max=3)
  if still_failing: alert_and_escalate()

Core Workflow

# material-ui primary flow
input = prepare(raw_data)
result = process(input, config={components, data, date, engine, grid})
validate(result)
deliver(result)

Error Handling

on error:
  log(error_details)
  retry_with_backoff(max=3)
  if still_failing: alert_and_escalate()

Installation

npm install @mui/material @emotion/react @emotion/styled @mui/icons-material
# Optional: DataGrid, DatePicker
npm install @mui/x-data-grid @mui/x-date-pickers

Theme Setup

import { ThemeProvider, createTheme, CssBaseline } from "@mui/material"

const theme = createTheme({
  palette: {
    primary: { main: "#1976d2" },
    secondary: { main: "#9c27b0" },
    mode: "light",
  },
  typography: { fontFamily: "Inter, Roboto, sans-serif" },
  shape: { borderRadius: 8 },
})

function App() {
  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <YourApp />
    </ThemeProvider>
  )
}

sx Prop Styling

import { Box, Typography, Button } from "@mui/material"

export function Dashboard() {
  return (
    <Box sx={{ p: 4, display: "flex", gap: 2, bgcolor: "background.paper" }}>
      <Typography variant="h4" sx={{ fontWeight: 600 }}>
        Dashboard
      </Typography>
      <Button variant="contained" sx={{ ml: "auto" }}>
        Export
      </Button>
    </Box>
  )
}

DataGrid

import { DataGrid } from "@mui/x-data-grid"

const columns = [
  { field: "id", headerName: "ID", width: 90 },
  { field: "name", headerName: "Name", flex: 1 },
  { field: "status", headerName: "Status", width: 120 },
]

export function DataTable({ rows }) {
  return (
    <DataGrid
      rows={rows}
      columns={columns}
      pageSize={25}
      checkboxSelection
      disableRowSelectionOnClick
    />
  )
}

Common Patterns

How to Use

  1. Define content goal (traffic, engagement, conversion, brand awareness)
  2. Research target audience pain points and search intent
  3. Generate content using appropriate AI tools
  4. Edit and humanize output for authenticity
  5. Optimize for target platform (SEO, hashtags, format)
  6. Schedule and distribute across channels
  7. Measure performance and iterate

Red Flags

Verification

Process

  1. Analyze the task requirements
  2. Apply domain expertise
  3. Verify output quality

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "Good enough content works" | Quality content drives engagement. Mediocre content gets ignored. |

| "I will optimize later" | SEO and distribution need optimization from the start. |

| "Templates are good enough" | Templates are a starting point. Custom content outperforms generic. |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.