Reusable UI components: naming, variants, and layout rules
Set clear naming, variants, and layout rules for reusable UI components so teams build consistent screens fast in any visual builder.

Why screen consistency breaks in visual builders
Visual builders make it easy to ship screens fast. That speed can also hide a slow drift in how the UI looks and behaves. When several people build at once, small choices stack up: one person adds 12px padding, another uses 16px, and a third copies an older button from a different screen.
You usually notice the symptoms early: near-duplicate components, spacing that shifts between screens, and slightly different words for the same action (Save, Submit, Confirm). States often diverge too. One form shows a clear loading state, another doesnât. Error messages vary, and âquick fixesâ appear on one page but never make it back into the shared pattern.
Thatâs how UI debt starts. Each inconsistency feels minor, but over time it makes the product feel less trustworthy. It also slows teams down because people spend more time hunting for the ârightâ version, comparing screens, and fixing tiny differences late in review.
A component library in a visual builder is a shared set of building blocks (buttons, fields, cards, headers, empty states) that everyone pulls from instead of recreating. In a platform like AppMaster, that typically means creating reusable UI pieces inside the visual UI builders, then agreeing on how theyâre named, configured, and placed so screens stay consistent even when different people build them.
The goal isnât to remove creativity. Itâs to make the everyday parts predictable so choices are intentional. The four levers that prevent drift are: clear naming, sensible variants, basic layout rules (spacing, alignment, grids), and team habits that keep the library healthy as the app grows.
What should be a reusable component (and what should not)
Not every nice-looking element deserves to become a component. If you turn everything into a component, people waste time digging through a library and tweaking options that shouldnât exist.
A good reusable component is something you expect to see across many screens, or something that must look and behave the same every time. Think of patterns users recognize instantly: a primary button, a text input with help text, a card that previews a record.
A small starter set usually covers most screens: buttons, inputs, cards, page headers, and a couple of modal types (confirm and form).
A practical extraction rule keeps decisions simple: if you use the same UI 2 to 3 times, or itâs critical to your brand and needs to be identical, extract it. If it shows up once, keep it local.
What should stay one-off? Highly specific layouts tied to a single screen, experimental sections youâre changing daily, and anything thatâs mostly content. For example, a one-time onboarding banner with custom text and illustration is rarely worth componentizing.
Keep each component focused. One component should do one job. A âUser Cardâ that also handles permissions, billing status, and admin actions becomes hard to reuse. A cleaner approach is a display-focused âUser Cardâ plus separate action buttons and status chips.
Naming conventions that stay readable under pressure
When a team ships fast, names are the first thing to break. Someone duplicates âButton2,â another creates âCTA Button,â and a third uses âBlueButton.â A week later, nobody knows which one to reuse, so they make a new one. Thatâs how a library becomes a pile of near duplicates.
A simple pattern helps you stay consistent even when youâre tired: Component - Part - State. Most components donât need all three, but the order stays the same.
Use words people actually say. If your team says âCustomer card,â donât name it âCRM Tile.â If the product calls it a âPlan,â donât call it âSubscriptionBox.â Plain language wins because itâs searchable.
One rule prevents a lot of confusion: donât mix âwhat it looks likeâ and âwhat itâs forâ at the same layer. Pick one approach. If you name by purpose, avoid color words. If you name by visuals, avoid business meaning. Purpose-based naming usually scales better.
Examples that are easy to scan in a component list:
- Button - Primary
- Button - Secondary - Disabled
- Input - WithLabel
- Card - Compact
- Modal - ConfirmDelete
Decide formatting once and write it down: Title Case or sentence case, spaces around hyphens, and no abbreviations unless theyâre universal (like âURLâ). In visual builders where many people contribute, these small choices keep the library readable as the list grows.
Variants: how to offer choice without creating chaos
Variants let a team reuse one component in many places without making a new copy each time. The trick is deciding upfront which differences matter and locking everything else down.
Start with a few variant dimensions that cover real needs. For many components, three are enough: size (S/M/L), intent (primary/secondary/danger), and state (default/hover/active). If a new option doesnât fit those dimensions, treat it as a new component, not âone more variant.â
Defaults matter more than people think. New screens should look correct even when someone drags in a component and changes nothing. Set safe defaults (like size=M, intent=primary, state=default) so speed doesnât turn into random styling.
For each component that has variants, write down and enforce:
- Supported dimensions and allowed values (keep it short)
- Default values
- What never changes across variants (padding, font, corner radius, icon spacing)
- Required states like disabled and loading, plus error when failure is possible
- When to create a new component instead of adding a variant
Example: you have a âSubmitâ button across a customer portal. If one person makes a âWide Submit Buttonâ and another makes a âRounded Submit Button,â drift shows up fast. With rules, you keep one Button component. You allow size and intent, forbid custom padding and corner radius, and define âLoadingâ once (show a spinner, lock clicks) so it behaves the same everywhere.
When someone asks for âjust one more style,â ask what user problem it solves. If the answer is unclear, itâs probably chaos in disguise.
Layout rules: spacing, alignment, and grids everyone follows
If layout rules are vague, every screen slowly turns into a one-off. The fastest way to keep components consistent is to make spacing and alignment boring: a few allowed choices, used the same way every time.
Start with a spacing scale and ban everything else. Pick a small set (for example 4, 8, 12, 16, 24) and treat it like a keyboard: you can play many songs, but only with those keys. If someone needs â18px,â it usually means the component or grid is off.
Be explicit about what spacing means:
- Padding is inside a component and stays consistent across screens.
- Gap is between items inside a container (form rows, toolbar items).
- Margin is outside a component and should be used sparingly.
- Prefer gap over stacked margins so spacing doesnât double by accident.
Alignment rules remove endless ânudge it a bitâ edits. A simple default works well: left-align text, line up labels and inputs on the same vertical line, and keep primary actions consistent (for example, bottom-right in a modal and right-aligned in a form footer). Use baseline alignment for text-heavy rows. Reserve centered alignment for icon-only rows.
Grids donât need to be fancy, but they do need to exist. Decide columns and gutters, and define what happens on smaller screens (even a basic â12 columns on desktop, single column on mobileâ helps). Set container widths and breakpoints once, then build screens inside those rails.
Common traps to watch for: nested containers that each add padding, inconsistent page margins, mixing fixed widths with responsive columns, and âmagic numbersâ that only fix one screen.
Style tokens: fonts, colors, and accessibility basics
Style tokens are the shared choices everyone uses. When tokens are clear, reusable UI components stay consistent even when different people build screens.
Start with typography as a single source of truth. Pick a small scale for font size, weight, and line height, then stop. Most teams only need a few steps (for example: body, small, caption, title, and page heading). Put these choices in one place so new text starts from the same defaults.
Colors work best when named by meaning, not by paint codes. âPrimaryâ signals a main action. âSuccessâ means âit worked,â and âwarningâ means âcheck this.â Avoid names like âblue-500â unless your team already thinks in palettes.
Accessibility basics that prevent problems later:
- Ensure text has enough contrast against its background.
- Make tap targets large enough for thumbs, not mouse pointers.
- Write error messages that say what happened and what to do next.
- Donât rely on color alone to communicate status.
Tokens should connect directly to component variants. A Button variant like Primary, Secondary, or Danger should swap approved tokens (color, border, text style), not introduce new one-off styling.
Keep the token list short enough that people actually use it. A good test: can someone pick the right token in 5 seconds? If not, merge or delete.
A simple starter set might include typography (text.body, text.small, text.title), color (color.primary, color.success, color.warning, color.danger), spacing (space.8, space.16, space.24), radius (radius.sm, radius.md), and focus (focus.ring).
Step by step: set up a component library in a visual builder
A component library is less about âdesign perfectionâ and more about removing daily micro-decisions. When everyone picks the same building blocks, screens stay consistent even when different people build them.
A practical 5-step rollout
-
Audit what you already have. Pick 5 to 10 real screens and note duplicates you see repeatedly: buttons, text inputs, section headers, cards, and empty states.
-
Choose a small first wave to standardize. Aim for the top 10 pieces that appear everywhere and cause the most mismatch. For many teams that means buttons, inputs, dropdowns, modal dialogs, table headers, and cards.
-
Write the rules down before you build. Keep it short: component name, when to use it, allowed variants, and the layout rules around it (spacing, alignment, width).
-
Rebuild once, then replace gradually. Create the new components in your visual builder and lock in the variants you agreed on. Replace old copies screen by screen. Donât try to refactor everything in one sprint.
-
Add a lightweight review gate. One person (rotating weekly) checks new components and new variants. The goal isnât policing. Itâs preventing accidental forks.
What âgood enoughâ looks like
Youâll know itâs working when a designer or PM can say, âUse the standard card with the compact header,â and two builders produce the same result. Thatâs the payoff: fewer one-off choices, fewer subtle inconsistencies, and faster screen building.
Keep your library small on purpose. If someone requests a new variant, ask one question first: is this a real new need, or can an existing variant cover it with different content?
Common mistakes that cause slow, inconsistent UI
Most inconsistency isnât caused by bad taste. It happens because copying is easy, tweaks are quick, and nobody circles back. The result is a set of almost-the-same screens that are hard to update.
One common trap is creating near-duplicates instead of adding a variant. Someone needs a âprimary button, but slightly tallerâ and duplicates the component. A week later, another person duplicates that. Now you have three buttons that look close but behave differently, and every change becomes a hunt.
Another slowdown is the over-configurable component: one mega component with dozens of toggles. It feels flexible, then becomes unpredictable. People stop trusting it and create âjust for this caseâ versions, which defeats the point.
Layout mistakes cause just as much damage. The biggest one is mixing responsibilities: a component controls its own outer margins while the screen also adds spacing. You get random gaps that vary by page. A simple rule helps: components define internal padding, screens control spacing between components.
Problems that usually show up first: naming rules break when rushed, states get added late (loading, empty, error), one-off tweaks become permanent, and different people solve the same layout in different ways.
Quick consistency checklist for every new screen
Before you add anything new, pause for 60 seconds and check the basics. A screen can look fine while quietly breaking the system, and those small breaks add up quickly when several people build in parallel.
- Naming: Every component follows the agreed pattern (for example,
Form/Input,Form/Input.HelperText,Table/RowActions). If the name wonât help someone search and place it quickly, rename it now. - Owner + purpose: Each shared component has an owner (a person or team) and a one-sentence description of when to use it.
- Spacing scale only: All padding, gaps, and margins use approved spacing steps. If youâre typing a new number âbecause it looks right,â stop and pick the closest step.
- States included: Key interactive pieces include loading and error states, not just the happy path. Think disabled button, input error, empty list, retry.
- No new styles invented: Build the screen using existing tokens and components. If you want a new color, font size, radius, or shadow, treat it as a system request, not a screen-level fix.
Example: two people build the same feature, with and without rules
Maya and Leon are on a customer support team. They need two screens: a ticket list (to scan quickly) and a ticket details screen (to act on one ticket). They split the work and build in a visual builder.
Without rules, each person makes âa cardâ differently. Maya uses a white card with a thin border and a shadow. Leon uses a gray card with no border but extra padding. One screen has a rounded primary button, the other uses a square button and a text link. Status appears as a colored dot on one screen and a pill on the other. On the details page, fields donât line up because labels are different widths, so the whole form feels wobbly.
The review meeting turns into a styling debate, and a simple update (like adding âPriorityâ) means touching multiple one-off layouts.
With rules, they start from shared, reusable UI components in a small library: a TicketCard for structure and spacing, a StatusBadge for status styles and contrast, and an ActionBar for consistent primary actions.
Now the list screen uses a compact TicketCard variant for key fields and a preview line. The details screen uses a detailed variant for the full description, timeline, and extra fields. The structure stays the same; the variant controls what appears.
The best part is what you donât see: fewer review comments, fewer âwhy is this different?â questions, and faster updates later. When the team renames âClosedâ to âResolvedâ and adjusts its color, they change StatusBadge once and both screens update together.
Keeping it consistent over time (and next steps)
Consistency isnât a one-time setup. As soon as more people build screens, small âjust for this pageâ choices multiply, and the library starts to drift.
A simple change process keeps the team moving without turning every button tweak into a debate:
- Propose: what changes and why (new component, new variant, rename, deprecate)
- Review: a designer or UI owner checks naming, spacing rules, and accessibility basics
- Approve: a clear yes/no, with a short note if itâs limited to a single workflow
- Release: update the shared library and announce the change in one place
Decisions need a home. A short âUI rulesâ doc is enough if it includes naming conventions, the official variant list (what exists and what doesnât), and a do-not-do list (for example: âDonât create a second âPrimary Buttonâ with different paddingâ).
Schedule a monthly cleanup slot. Use it to merge duplicates, remove unused pieces, and mark older components as deprecated so people stop grabbing the wrong one.
Refactor when you see the same pattern twice (for example, two teams build slightly different empty states). Live with a one-off when itâs truly unique, time-sensitive, and unlikely to repeat.
If youâre building in AppMaster, one practical next step is to standardize a single workflow first (like âCreate ticketâ or âCheckoutâ), then expand. The UI builders make it easy to share the same components across screens, and appmaster.io is a useful reference point if your team wants a no-code approach that still supports full applications, not just page layouts.
FAQ
Start by standardizing the pieces you touch on almost every screen: buttons, inputs, cards, headers, and one or two modal types. Build those as reusable components first, set sensible defaults, then replace old copies screen by screen instead of trying to refactor everything at once.
A good default is to extract it when youâve used the same UI two or three times, or when it must look and behave identically every time (like primary actions or form fields). If itâs truly one-off, tied to a single screen, or changing daily, keep it local so the library stays easy to use.
Use one simple naming pattern and keep it consistent, such as "Component - Part - State". Prefer words your team actually uses in conversations, and avoid names based on colors like "BlueButton" because they become misleading when styles change.
Keep variants limited to differences that matter repeatedly, like size, intent (primary/secondary/danger), and state. Everything else should stay locked so people donât "tune" components per screen and create drift. If a new request doesnât fit your existing variant dimensions, itâs usually a new component, not âone more option.â
Pick a small spacing scale and use only those values across the app, then treat anything else as a signal that the grid or component is off. Prefer spacing handled by containers (gaps) instead of stacked margins so you donât get accidental double-spacing when components are nested.
Use tokens that are named by meaning, not by raw color values, so teams choose "primary" and "danger" instead of inventing new shades. Then ensure component variants map to those tokens, so creating a âPrimary Buttonâ always pulls the same typography and colors everywhere.
Make sure every shared interactive component has at least a disabled and loading state, and add error states when failure is possible (like forms and network actions). If states arenât standardized, youâll get screens that feel inconsistent even if they look similar, which hurts trust and increases review cycles.
Over-configurable components feel flexible at first, but people stop trusting them because behavior becomes unpredictable. Keep components focused on one job, and compose bigger UI from smaller pieces so reuse stays simple and changes donât create side effects.
Use a lightweight gate: one rotating owner checks new components and new variants for naming, spacing rules, and required states. The goal is to prevent accidental forks early, because merging near-duplicates later is slow and usually breaks screens.
In AppMaster, create reusable UI pieces inside the web and mobile UI builders, then standardize how theyâre named, configured, and placed so others can reuse them confidently. A practical approach is to standardize one workflow first (like âCreate ticketâ), get the components and variants right there, then expand the library as more screens adopt the same patterns.


