UI Guide
How to properly use forge-ui
This is a short reference guide on how to use @forge-ui
most effectively.
Colors
Colors used by forge-ui are defined in your global.css
file. You can find more information here. Do not use
hardcoded colors, sich as <span className='text-red-500' />
, or <div style={{ color: 'red' }}>
in your code, if you want to keep your components
consistent with the rest of the UI, in both light and dark mode. Instead be sure to use the provided color variables.
Layout
When working with layout, it can be tempting to use margins and paddings to create space between elements. However, this can lead to inconsistent spacing between elements. Instead, a components' parent should be responsible for the spacing between elements. This way, the spacing is consistent across the entire application, and if you choose to reuse the component elsewhere, you don't have conflicting margins and paddings.
Shared components
This issue becomes even more apparent when you have shared components. If you have a component that is used in multiple places, and you have margins and paddings on the component itself, you can end up with conflicting margins and paddings between the shared component and its parent.
Shared components should only style within themselves, and have no knowledge of the layout they are placed in.
Responsive layout
Don't (always) fill the entire screen
It's no surprise that when most of us open our design tool of choice on our high resolution displays, we give ourselves at least 1200-1400px of space to fill. But just because you have the space, doesn't mean you need to use it.
Notifications
You have 3 unread messages.
Push Notifications
Send notifications to device.
Your call has been confirmed.
1 hour ago
You have a new message!
1 hour ago
Your subscription is expiring soon!
2 hours ago
Notifications
You have 3 unread messages.
Push Notifications
Send notifications to device.
Your call has been confirmed.
1 hour ago
You have a new message!
1 hour ago
Your subscription is expiring soon!
2 hours ago
Hierarchy over semantics
Semantics are an important part of button design, but that doesn't mean you can forget about hierarchy. Every action on a page sits somewhere in a pyramid of importance. Most pages only have one true primary action, a couple of less important secondary actions, and a few seldom used tertiary actions. When designing these actions, it's important to communicate their place in the hierarchy.
- Primary actions should be obvious. Solid, high contrast background colors work great here.
- Secondary actions should be clear but not prominent. Outline styles or lower contrast background colors are great options.
- Tertiary actions should be discoverable but unobtrusive. Styling these actions like links is usually the best approach.
Are you absolutely sure?
This action cannot be undone. This will permanently delete your account and remove your data from our servers.
Are you absolutely sure?
This action cannot be undone. This will permanently delete your account and remove your data from our servers.