DEV Community

Emma Mooreq
Emma Mooreq

Posted on

Make Your App Feel Better: 10 UI Tips for Beginner/Mid-Level Developers

Hey, devs! šŸ‘‹

As a beginner or mid-level developer, you've probably focused a lot on making your app functional. But have you considered how it feels to use? In this post, we'll explore 9 often-overlooked aspects of UI design that can significantly improve your app's user experience.

Note: The examples use ReactJS and TailwindCSS for example but these principles can be applied anywhere.

  1. Mind Your Margins and Padding Uneven margins and padding are a dead giveaway that someoneā€™s still getting the hang of design. Consistent spacing makes everything look cleaner and more professional.

Quick Fix:
Stick to multiples of 4 for margins and padding (think 4px, 8px, 12px, 16px). It gives your layout a nice rhythm and looks way more polished.

.container {
padding: 16px;
}

.button {
padding: 8px 12px;
}
You donā€™t need to reinvent the wheelā€”just keep things even, and itā€™ll instantly look better.

Tip #1

2. Handle Empty States Like a Boss

Ever opened an app and been met with a blank screen? Yeah, thatā€™s what happens when devs forget to design for the empty state. When thereā€™s no data to show, donā€™t leave users hanging.

Pro Tip:
Add helpful messages or call-to-action (CTA) buttons to guide users on what to do next.

function TodoList({ todos }) {
if (todos.length === 0) {
return (


Nothing here yet! Why not add your first task?




Add Todo


);
}

// Render todo list
}
Turn an empty screen into an opportunity to engage your users!

Tip #2

  1. Always Show Loading States If your app is doing something in the background, let your users know. Nothing is worse than wondering if a button click even worked or if the app crashed.

Pro Tip:
Use a delayed loading spinner for quick operations, so it doesnā€™t flash too quickly. Hereā€™s a little trick to add a delay:

function useDelayedLoading(isLoading, delay = 200) {
const [showLoading, setShowLoading] = useState(false);

useEffect(() => {
if (isLoading) {
const timer = setTimeout(() => setShowLoading(true), delay);
return () => clearTimeout(timer);
}
setShowLoading(false);
}, [isLoading, delay]);

return showLoading;
}

// Usage
const showLoading = useDelayedLoading(isLoading);
That way, users donā€™t see the spinner for super quick tasks, but theyā€™ll get feedback when itā€™s needed.

Image description

  1. Keep a Clear Visual Hierarchy Not everything on your screen has the same importance, right? Make sure your UI reflects that. Use different font sizes, colors, and weights to guide users through the content.

Pro Tip:
Stick to 2-3 font sizes for your main content, and use color sparingly to emphasize key points.

.primary-text {
font-size: 18px;
color: #333;
font-weight: bold;
}

.secondary-text {
font-size: 16px;
color: #666;
}

.tertiary-text {
font-size: 14px;
color: #999;
}
Donā€™t overcomplicate thingsā€”just make sure the user knows whatā€™s important at first glance.

Tip #4

  1. Embrace Whitespace, Donā€™t Fear It You donā€™t have to fill every inch of the screen with something. Whitespace (aka negative space) is your friend! It helps your app breathe and makes it easier for users to focus.

Pro Tip:
Increase space between unrelated elements and decrease it between related ones. Itā€™s all about balance.

.section {
margin-bottom: 32px; /* Big gap between sections */
}

.section-title {
margin-bottom: 16px; /* Smaller gap within a section */
}

.list-item {
margin-bottom: 8px; /* Tight gap between list items */
}
Whitespace isnā€™t wasted spaceā€”itā€™s part of the design!

Tip #5

  1. Handle Errors Gracefully No one likes errors, but they happen. When they do, be helpful. Instead of just saying ā€œError 404,ā€ give the user context and offer ways to fix it or try again.

Pro Tip:
Make your error messages friendly, clear, and actionable.

function ErrorMessage() {
return (


Oops! Page Not Found



We couldn't find the page you're looking for.




Retry



Go Back



);
}
Help users feel like theyā€™re not stuck when things go wrong.

Tip #6

  1. Add Tooltips for Long Text & Disabled States Ever tried to read something in an app that was cut off or tried to interact with a disabled button, only to be left guessing why? This can be frustrating for users, and itā€™s easily avoidable. Add tooltips (title attribute) to long text or for disabled elements to provide more context.

Pro Tip:
When text is truncated or a button is disabled, a tooltip can offer users additional information, like what the full text is or why the button is inactive. This keeps the experience smooth and informative.

// Long text tooltip example



className="w-48 truncate"
title="This is a very long text that gets cut off but has a helpful tooltip"
>
This is a very long text that gets cut off but has a helpful tooltip




This is a very long text that gets cut off but has a helpful tooltip





// Disabled button tooltip example

Submit

Adding these tooltips makes your app feel more thoughtful and polished. Small touches like this show you care about the userā€™s experience.

Tip #7

  1. Use Contextual Colors for Feedback Colors play a crucial role in guiding users through your app. Using the right color for the right situation makes the interface more intuitive and easier to understand. For example, reddish tones for errors, greenish for success, yellowish for warnings, and blueish for informational messages.

Pro Tip:
Stick to established color conventions to avoid confusing your users. Most people recognize red as an error or danger indicator and green as a success marker, so leverage that!

// Example of contextual colors in action



Error: Something went wrong!





Success: Operation completed!



By following these color conventions, you make it much easier for users to quickly understand what's happening in your app without over-explaining.

This small detail not only helps in making your UI more intuitive but also enhances the visual hierarchy by linking colors with actions and outcomes.

Tip #8

  1. Icons Should Enhance, Not Distract Donā€™t overload your UI with icons for the sake of it. Every icon should have a clear purpose and enhance the user experience.

Pro Tip:
Keep icons simple, and recognizable, and ensure they match the action they represent.



Use icons to clarify actions, not clutter your UI.

  1. Donā€™t Reinvent the Wheel ā€” Use Solid UI Libraries Itā€™s easy to fall into the trap of thinking you have to code everything from scratch. But guess what? You donā€™t! There are fantastic UI libraries out there like Ant Design, Shadcn UI, Material UI, and Chakra UI that can save you a ton of time and effort. These libraries provide well-tested, accessible, and consistent components, so you can focus on what makes your app unique instead of redoing the basics.

Pro Tip:
If youā€™re trying to move fast or youā€™re working on a project with tight deadlines, leverage these libraries. But if youā€™re building something purely for learning, feel free to dive into the details and build your own components.

import { Button } from 'antd';

function MyApp() {
return Click Me;
}
Tip #10

Using these libraries helps ensure that your app looks polished, functions well, and remains consistent, all while saving you time. You can always customize things later, but starting with a solid foundation helps you move faster.

No need to code a button from scratch when thereā€™s already a beautifully styled, responsive one you can drop right in!

Conclusion
The key to a great UI is attention to detail. These small tweaksā€”consistent spacing, clear hierarchy, thoughtful empty/loading/error states, and balanced use of whitespaceā€”make a world of difference. Whether youā€™re working on your first app or your 50th, take the time to polish these areas, and your users will thank you.

Got any thoughts or questions? Let me know, Iā€™m happy to expand on these topics or chat more. Happy coding, and may your apps always feel amazing! āœØ

Top comments (0)