material-design – skill Thiết kế & UI cho agent AI
Hướng dẫn triển khai Material Design cho Web và ứng dụng. Kích hoạt khi người dùng muốn phong cách thẩm mỹ, độ nổi (elevation), chuyển động và các thành phần nhất quán của Google.
Cài skill material-design bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/material-design-1837c.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /material-design – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/material-design-1837c.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $material-design – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/material-design-1837c.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /material-design – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/material-design-1837c.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /material-design – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Material Design
> "Digital paper and ink. Interfaces built on the physical properties of stacked material."
When to Use
Use this sub-style when the user's request matches the aesthetic described above. This is a child reference of the design-it skill and is not meant to be triggered directly.
Core Principles
1. Z-Axis Elevation: Everything exists on a specific layer. Shadows communicate hierarchy and state.
2. Meaningful Motion: Animations are continuous, guiding the user's focus from one state to the next (e.g., ripple effects, shared element transitions).
3. Structured Layout: Strict adherence to an 8dp baseline grid and specific component anatomies (cards, FABs, app bars).
Visual DNA
- Colors: Works excellently with Desert Mirage or Minimalist Slate. Utilize primary, secondary, surface, and error semantic mapping.
- Typography:
RobotoorGoogle Sans(or equivalent clean geometric sans). Choose one Material generation: M2 uses H1–H6 and related roles; M3 uses display, headline, title, body and label roles. Do not mix the scales. - Shapes: Moderately rounded corners (4px to 16px).
Web Implementation
- Do not reinvent the wheel: mimic standard Material elevations.
- CSS Example:
.material-card {
background: var(--bg-surface);
border-radius: 8px;
padding: 16px;
/* Material Elevation 2 */
box-shadow: 0 3px 1px -2px rgba(0,0,0,0.2),
0 2px 2px 0 rgba(0,0,0,0.14),
0 1px 5px 0 rgba(0,0,0,0.12);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.material-btn {
text-transform: uppercase;
font-weight: 500;
letter-spacing: 1.25px;
padding: 0 16px;
height: 36px;
border-radius: 4px;
background: var(--cta-highlight);
color: #fff;
border: none;
/* Ripple effect is usually handled via JS, but structure is key */
}App Implementation
SwiftUI
struct MaterialCard: View {
var body: some View {
VStack(alignment: .leading, spacing: 12) {
Text("Material Card")
.font(.system(size: 20, weight: .medium))
Text("Digital paper and ink. Shadows communicate where this surface sits.")
.font(.system(size: 14))
.foregroundColor(.secondary)
HStack {
Spacer()
Button("ACTION") {}
.font(.system(size: 14, weight: .medium))
.foregroundColor(.accentColor)
.padding(.horizontal, 12)
.padding(.vertical, 8)
}
}
.padding(16)
.background(Color(.systemBackground))
.cornerRadius(8)
// Material Elevation 2 equivalent
.shadow(color: Color.black.opacity(0.12), radius: 3, x: 0, y: 1)
.shadow(color: Color.black.opacity(0.08), radius: 2, x: 0, y: 2)
}
}
// Material FAB
struct MaterialFAB: View {
var body: some View {
Button(action: {}) {
Image(systemName: "plus")
.font(.system(size: 24))
.foregroundColor(.white)
.frame(width: 56, height: 56)
.background(Color.accentColor)
.cornerRadius(16)
.shadow(color: Color.black.opacity(0.2), radius: 6, x: 0, y: 3)
.shadow(color: Color.black.opacity(0.14), radius: 4, x: 0, y: 2)
}
}
}- Emulate Material elevation levels by stacking multiple
.shadow()modifiers at different blur/offset values. - Use
.cornerRadius(8...16)— Material Design 3 uses more rounded shapes than M2. - Animate shadow changes using
.animation(.easeInOut(duration: 0.28))— Material uses 280ms transitions.
Flutter
// Flutter IS Material Design — use it natively
class MaterialScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF6750A4), // Material You seed
// Map your universal palette here
),
home: Scaffold(
appBar: AppBar(
title: const Text('Material Design'),
// M3 appbar elevation is 0 by default, scrolled = 3
),
body: Padding(
padding: const EdgeInsets.all(16),
child: Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text('Material Card',
style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: 8),
Text('Digital paper and ink.',
style: Theme.of(context).textTheme.bodyMedium),
const SizedBox(height: 16),
Align(
alignment: Alignment.centerRight,
child: TextButton(
onPressed: () {},
child: const Text('ACTION'),
),
),
],
),
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
// M3 FAB automatically gets correct elevation & shape
),
),
);
}
}- Flutter offers Material components. Use
MaterialApp,ThemeData(useMaterial3: true), and standard widgets. - Map the universal palette via
colorSchemeSeedor manually build aColorScheme. - Use the Material type scale via
Theme.of(context).textTheme. - Ripple effects come free with
InkWellandElevatedButton.
React Native
import { Provider as PaperProvider, MD3LightTheme as DefaultTheme, Card, Button, Text } from 'react-native-paper';
const materialTheme = {
...DefaultTheme,
roundness: 8,
colors: {
...DefaultTheme.colors,
primary: '#6750A4', // Material You purple
surface: '#FFFBFE',
background: '#FFFBFE',
},
};
const MaterialScreen = () => (
<PaperProvider theme={materialTheme}>
<ScrollView style={{ flex: 1, padding: 16 }}>
<Card style={{ marginBottom: 16 }} elevation={2}>
<Card.Content>
<Text variant="titleLarge">Material Card</Text>
<Text variant="bodyMedium">Digital paper and ink. Shadows communicate hierarchy.</Text>
</Card.Content>
<Card.Actions>
<Button mode="text" onPress={() => {}}>ACTION</Button>
</Card.Actions>
</Card>
{/* Filled button — Material M3 style */}
<Button
mode="contained"
onPress={() => {}}
style={{ alignSelf: 'flex-start', borderRadius: 20 }}
labelStyle={{ fontWeight: '500', letterSpacing: 1.25 }}
>
Filled Button
</Button>
</ScrollView>
</PaperProvider>
);- Use
react-native-paper— it implements Material Design 3 natively for React Native. - Configure the theme to map your universal palettes to Material semantic colors.
- Use
Card(withelevationprop),Button(withmodeprop), andTextInputfor correct Material behavior. - Core Pressable needs its
android_rippleconfigured; for themed feedback usereact-native-paper'sTouchableRipple.
Jetpack Compose
// Jetpack Compose IS Material Design — use it natively
@Composable
fun MaterialScreen() {
MaterialTheme(
colorScheme = lightColorScheme(
primary = Color(0xFF6750A4),
onPrimary = Color.White,
surface = Color(0xFFFFFBFE),
),
typography = Typography(
titleLarge = TextStyle(fontSize = 22.sp, fontWeight = FontWeight.Medium),
bodyMedium = TextStyle(fontSize = 14.sp, lineHeight = 20.sp),
),
) {
Scaffold(
topBar = {
TopAppBar(title = { Text("Material Design") })
},
floatingActionButton = {
FloatingActionButton(onClick = {}) {
Icon(Icons.Default.Add, contentDescription = "Add")
}
},
) { padding ->
Column(modifier = Modifier.padding(padding).padding(16.dp)) {
Card(
modifier = Modifier.fillMaxWidth(),
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp),
shape = RoundedCornerShape(12.dp),
) {
Column(modifier = Modifier.padding(16.dp)) {
Text("Material Card",
style = MaterialTheme.typography.titleLarge)
Spacer(Modifier.height(8.dp))
Text("Digital paper and ink.",
style = MaterialTh… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- mermaid-expert – Tạo sơ đồ Mermaid cho flowchart, sequence, ERD và kiến trúc hệ thống. Thành thạo cú pháp…
- meta-tag-generator – Công cụ tạo Meta Tag. Dùng khi làm việc với tóm tắt trang, URL và ảnh thương hiệu hoặc…
- minimalism – Hướng dẫn triển khai web và app theo phong cách thiết kế Minimalism. Kích hoạt khi người…
- minimalist-ui – Dùng khi tạo giao diện biên tập gọn gàng với bảng màu đơn sắc ấm, viền rõ nét, chuyển…
- mobile-design – Thiết kế và review giao diện iOS, Android, React Native hoặc Flutter về thao tác cảm…
- monochromatic-ui – Hướng dẫn triển khai Monochromatic UI cho web và ứng dụng. Kích hoạt khi người dùng muốn…
- monopoly – MONOPOLY là kỹ năng của kỹ sư thiết kế hệ thống cấp cao để kiến trúc, đánh giá và mở…
- multi-tenant-llm-hosting – Thiết kế nền tảng hosting LLM đa tenant an toàn, với cách ly tenant, quota, phân bổ chi…