Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)48k · #4397

floating-ui

Skill này làm gì

Phong cách thiết kế này làm các phần tử trên màn hình trông như đang lơ lửng, như treo trong không khí. Chúng không chạm vào mép màn hình và có bóng đổ mềm cùng góc bo tròn, tạo cảm giác nhẹ và thoáng.

Khi nào nên dùng

  • ✓Khi bạn muốn nút hoặc thẻ trông như lơ lửng.
  • ✓Khi bạn muốn tạo điều hướng nằm giữa màn hình, không chạm mép.
  • ✓Khi bạn muốn một diện mạo gọn gàng, hiện đại với cảm giác không gian.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/design-it/floating-ui/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/design-it/floating-ui/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

“Tạo thiết kế cho một ứng dụng mà các thẻ nội dung và thanh điều hướng dưới cùng trông như đang lơ lửng.”

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

Cách hoạt động

Điều này đạt được bằng cách thêm khoảng trống (lề) quanh các phần tử và dùng bóng lớn, mờ. Góc bo rất tròn, như hình viên thuốc, cũng giúp tạo cảm giác 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.

Floating UI

"Defying gravity. Elements that hover effortlessly above the surface."

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. Detachment: UI elements (like nav bars, sidebars, or main content cards) do not touch the edges of the screen. They float with margins on all sides.
  2. Soft, Diffuse Shadows: Large, highly blurred shadows directly beneath elements.
  3. Pill Shapes & Rounds: Fully rounded corners (pill shapes) enhance the floating, bubble-like aesthetic.

Visual DNA

  • Colors: Earth-Grounded Elegance or Minimalist Slate. Use a slightly tinted background (off-white or very light gray) so the floating white elements pop.
  • Typography: Clean, airy sans-serifs with generous line height.
  • Layout: The "floating island" pattern for navigation (a pill-shaped nav bar centered at the bottom or top of the screen).

Web Implementation

  • Focus on large margins and specific shadow styles.
  • CSS Example:
body {
  background-color: var(--bg-primary); /* e.g., #F4F4F9 */
  padding: 24px; /* Ensure nothing touches the edge */
}

.floating-nav {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 50px; /* Pill shape */
  padding: 12px 32px;
  
  /* Large, soft shadow */
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  
  display: flex;
  gap: 24px;
}

.floating-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

App Implementation

SwiftUI

struct FloatingUIView: View {
    var body: some View {
        ZStack {
            // Very light background
            Color(red: 0.95, green: 0.95, blue: 0.97).ignoresSafeArea()
            
            ScrollView {
                VStack(spacing: 24) {
                    // Floating Content Card
                    VStack(alignment: .leading, spacing: 12) {
                        Text("Floating Card")
                            .font(.title2).fontWeight(.bold)
                        Text("This card hovers above the background, with massive soft shadows and completely rounded corners.")
                            .foregroundColor(.secondary)
                    }
                    .padding(32)
                    .frame(maxWidth: .infinity, alignment: .leading)
                    .background(Color.white)
                    .cornerRadius(32) // Very large radius
                    // Large, highly blurred shadow
                    .shadow(color: Color.black.opacity(0.05), radius: 30, x: 0, y: 15)
                    .padding(.horizontal, 24) // Keeps it detached from edges
                }
                .padding(.top, 40)
            }
            
            // Floating Pill Navigation
            VStack {
                Spacer()
                HStack(spacing: 40) {
                    Image(systemName: "house.fill").foregroundColor(.blue)
                    Image(systemName: "magnifyingglass").foregroundColor(.gray)
                    Image(systemName: "bell.fill").foregroundColor(.gray)
                    Image(systemName: "person.fill").foregroundColor(.gray)
                }
                .padding(.vertical, 16)
                .padding(.horizontal, 32)
                .background(Color.white)
                .clipShape(Capsule()) // Pill shape
                .shadow(color: Color.black.opacity(0.1), radius: 25, x: 0, y: 10)
                .padding(.bottom, 32) // Detached from bottom edge
            }
        }
    }
}
  • A .clipShape(Capsule()) with a massive .shadow() creates the perfect floating pill navigation bar.
  • Push the .shadow(radius: ...) up to 25 or 30 with a very low opacity (0.05) to get the soft, diffuse hover effect.

Flutter

class FloatingUIScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFF4F4F9),
      body: Stack(
        children: [
          ListView(
            padding: const EdgeInsets.all(24),
            children: [
              // Floating Content Card
              Container(
                margin: const EdgeInsets.only(bottom: 24),
                padding: const EdgeInsets.all(32),
                decoration: BoxDecoration(

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

“Những phần tử không chạm mép” là gì?

Nghĩa là nút, menu hoặc thẻ không dính vào viền màn hình. Có khoảng trống nhìn thấy giữa chúng và mép, như thể đang lơ lửng ở giữa.

Làm thế nào để có hiệu ứng “bóng mềm, khuếch tán”?

Dùng bóng có độ mờ lớn và độ đậm thấp. Điều này khiến bóng giống một vầng sáng mềm hơn là một bóng tối sắc nét.

Vì sao dùng góc bo kiểu “viên thuốc”?

Góc bo rất tròn tạo cảm giác mềm mại và hữu cơ, củng cố ý tưởng rằng phần tử nhẹ và “lơ lửng” như bong bóng.

Chi tiết

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

Web and App implementation guide for Floating UI. Trigger when user wants detached cards, elevated components, and a light, airy feel.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4397
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ự