Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)48k · #5150

makepad-layout

Skill này làm gì

Công cụ này giúp sắp xếp các phần tử trực quan trong giao diện bằng hệ thống bố cục của Makepad. Bạn có thể định nghĩa cách các mục căn chỉnh, khoảng cách giữa chúng và cách chúng lấp đầy màn hình.

Khi nào nên dùng

  • ✓Khi bạn cần sắp xếp các nút bấm thành một hàng.
  • ✓Khi bạn muốn căn giữa văn bản trên màn hình.
  • ✓Khi bạn muốn tiêu đề chiếm toàn bộ chiều rộng và phần nội dung chiếm phần còn lại.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-layout/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-layout/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để căn giữa một nút bấm trên màn hình bằng Makepad?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Makepad sắp xếp các phần tử theo bố cục trực quan. Bạn đặt các thuộc tính như 'flow' (hướng), 'align' (căn lề) và 'padding' (khoảng đệm bên trong) để kiểm soát vị trí và kích thước các mục trên màn hình.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • ./references/layout-system.md
  • ./references/core-types.md

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Makepad Layout Skill

Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19

Check for updates: https://crates.io/crates/makepad-widgets

You are an expert at Makepad layout system. Help users by:

  • Writing code: Generate layout code following the patterns below
  • Answering questions: Explain layout concepts, sizing, flow directions

When to Use

  • You need to size, align, or position widgets in a Makepad UI.
  • The task involves Walk, Align, Fit, Fill, padding, spacing, or container flow configuration.
  • You want Makepad-specific layout solutions for centering, responsiveness, or composition.

Documentation

Refer to the local files for detailed documentation:

  • ./references/layout-system.md - Complete layout reference
  • ./references/core-types.md - Walk, Align, Margin, Padding types

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. If file read fails or file is empty:
    • Inform user: "本地文档不完整,建议运行 /sync-crate-skills makepad --force 更新文档"
    • Still answer based on SKILL.md patterns + built-in knowledge
  3. If reference file exists, incorporate its content into the answer

Key Patterns

1. Basic Layout Container

<View> {
    width: Fill
    height: Fill
    flow: Down
    padding: 16.0
    spacing: 8.0

    <Label> { text: "Item 1" }
    <Label> { text: "Item 2" }
}

2. Centering Content

<View> {
    width: Fill
    height: Fill
    align: { x: 0.5, y: 0.5 }

    <Label> { text: "Centered" }
}

3. Horizontal Row Layout

<View> {
    width: Fill
    height: Fit
    flow: Right
    spacing: 10.0
    align: { y: 0.5 }  // Vertically center items

    <Button> { text: "Left" }
    <View> { width: Fill }  // Spacer
    <Button> { text: "Right" }
}

4. Fixed + Flexible Layout

<View> {
    width: Fill
    height: Fill
    flow: Down

    // Fixed header
    <View> {
        width: Fill
        height: 60.0
    }

    // Flexible content
    <View> {
        width: Fill
        height: Fill  // Takes remaining space
    }
}

Layout Properties Reference

Property Type Description
width Size Width of element
height Size Height of element
padding Padding Inner spacing
margin Margin Outer spacing
flow Flow Child layout direction
spacing f64 Gap between children
align Align Child alignment
clip_x bool Clip horizontal overflow
clip_y bool Clip vertical overflow

Size Values

Value Description
Fit Size to fit content
Fill Fill available space
100.0 Fixed size in pixels
Fixed(100.0) Explicit fixed size

Flow Directions

Value Description
Down Top to bottom (column)
Right Left to right (row)
Overlay Stack on top

Align Values

Value Position
{ x: 0.0, y: 0.0 } Top-left
{ x: 0.5, y: 0.0 } Top-center
{ x: 1.0, y: 0.0 } Top-right
{ x: 0.0, y: 0.5 } Middle-left
{ x: 0.5, y: 0.5 } Center
{ x: 1.0, y: 0.5 } Middle-right
{ x: 0.0, y: 1.0 } Bottom-left
{ x: 0.5, y: 1.0 } Bottom-center
{ x: 1.0, y: 1.0 } Bottom-right

Box Model

+---------------------------+
|         margin            |
|  +---------------------+  |
|  |      padding        |  |

…
Câu hỏi thường gặp

“Fill” và “Fit” nghĩa là gì?

'Fill' làm phần tử chiếm toàn bộ không gian còn trống, còn 'Fit' làm phần tử điều chỉnh theo kích thước nội dung của nó.

Làm sao để tạo khoảng cách giữa các phần tử?

Bạn có thể dùng thuộc tính 'spacing' để đặt khoảng trống giữa các mục khi chúng được xếp thành hàng ('flow: Right') hoặc cột ('flow: Down').

“Overlay” là gì?

'Overlay' là hướng bố cục mà các phần tử được xếp chồng lên nhau, như các lớp.

Chi tiết

Mô tả gốc của tác giả

CRITICAL: Use for Makepad layout system. Triggers on: makepad layout, makepad width, makepad height, makepad flex, makepad padding, makepad margin, makepad flow, makepad align, Fit, Fill, Size, Walk, "how to center in makepad", makepad 布局, makepad 宽度, makepad 对齐, makepad 居中

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5150
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự