🫧 Bubble Basics
Bubble là no-code platform mạnh nhất. Học cách sử dụng từ cơ bản.
Bubble Interface
Main Sections
Text
1┌─────────────────────────────────────────┐2│ [Design] [Workflow] [Data] [Styles] │3├─────────────────────────────────────────┤4│ Elements │ │5│ ────────│ │6│ Visual │ CANVAS │7│ Input │ (Your app) │8│ Container│ │9│ ... │ │10├─────────────────────────────────────────┤11│ Properties Panel (right side) │12└─────────────────────────────────────────┘Tabs Explained
| Tab | Purpose |
|---|---|
| Design | Build UI, layout |
| Workflow | Add logic, actions |
| Data | Database structure |
| Styles | Reusable styles |
| Plugins | Add functionality |
| Settings | App configuration |
Design Elements
Visual Elements
Text
1Text - Display text2Image - Show images3Shape - Rectangles, circles4Icon - Icon library5Video - Embed videos6Map - Google MapsInput Elements
Text
1Input - Text input field2Multiline Input - Textarea3Dropdown - Select options4Checkbox - Yes/no5Date/Time Picker - Date selection6File Uploader - Upload filesContainers
Text
1Group - Group elements together2Repeating Group - Lists, grids3Popup - Modal dialogs4Floating Group - Fixed positionBuilding First Page
Step 1: Add Elements
Text
11. Drag "Text" to canvas22. Double-click to edit33. Set font, size, color in Properties4 54. Drag "Input" below text65. Set placeholder text76. Set input type (text, email, password)8 97. Drag "Button"108. Set button text119. Set style (colors, rounded)Step 2: Responsive Design
Text
1Bubble uses "Flexbox" responsive:2 3Container settings:4- Row vs Column layout5- Gap between elements6- Alignment (left, center, right)7- Min/Max width8 9Element settings:10- Fixed vs Fit width11- Min/Max constraintsWorkflows
What is a Workflow?
Text
1Workflow = When [Event] → Do [Actions]2 3Example:4When: Button is clicked5Do: 6 1. Create new thing in database7 2. Show success message8 3. Reset inputsCreating Workflow
Text
11. Click on Button22. Click "Start/Edit Workflow"33. Define trigger (Button clicked)44. Add Action 1 (e.g., Create thing)55. Add Action 2 (e.g., Show message)Common Actions
Text
1Data:2- Create a new thing3- Make changes to thing4- Delete a thing5 6Navigation:7- Go to page8- Show popup9- Hide popup10 11Element:12- Set state13- Display data14- Reset inputs15 16Account:17- Sign user up18- Log user in19- Log user outDatabase (Data Tab)
Data Types
Text
1Create "Data Types" = Tables2 3Example - Blog App:4- User (built-in)5- Post6- Comment7- CategoryFields
Text
1Post Data Type:2- title (text)3- content (text)4- author (User)5- created_date (date)6- image (image)7- category (Category)8- is_published (yes/no)Relationships
Text
1One-to-Many:2User → Posts (một user có nhiều posts)3 4Many-to-Many:5Post ↔ Categories (list of Categories)Display Data
Dynamic Data
Text
1Text element showing username:2 3Content: "Hello, Current User's name"4 5Syntax: Current User's name6(Select from dropdown, not typed)Repeating Groups
Text
1Display list of Posts:2 31. Add Repeating Group42. Type of content: Post53. Data source: Search for Posts64. Inside RG: Add elements75. Use "Current cell's Post's title"Search & Filter
Text
1Data source options:2 3Search for Posts:4- Created by = Current User5- Is_published = yes6- Created date > 7 days ago7- :sorted by Created date (descending)States
Custom States
Text
1Store temporary data:2 31. Select element (or page)42. Add custom state53. Name: "selected_tab"64. Type: text75. Default: "home"8 9Use in conditionals:10When Page's selected_tab is "home" → Show home contentElement States
Text
1Built-in states:2- Input's value3- Dropdown's value4- Checkbox is checked5- Group is visibleFirst Mini App
Todo App
Text
1Data Type: Task2Fields:3- title (text)4- is_done (yes/no)5- user (User)6 7Page Elements:8- Input (task title)9- Button (Add)10- Repeating Group (tasks)11 - Text (title)12 - Checkbox (done)13 - Icon (delete)14 15Workflows:16- Button click → Create Task17- Checkbox change → Update Task18- Delete click → Delete TaskBest Practices
Bubble Tips
- Name everything - Elements, workflows
- Use groups - Organize layout
- Reusable elements - Headers, footers
- Keep workflows simple - One purpose each
- Test often - Preview mode
- Version control - Save versions before big changes
Bài Tập
Practice
- Create new Bubble app
- Build Todo app:
- Add task input + button
- Display tasks in list
- Mark as done
- Delete task
- Test in Preview mode
Tiếp theo: Bài 3 - Glide Intro
