Border Radius
Design tokens for border radius and corner rounding
Border Radius
Border radius tokens provide consistent corner rounding throughout your interface, from subtle roundings to fully circular elements.
Radius Scale
none0px
none
tokens.radii.none3xs4px
3xs
tokens.radii.3xs2xs5px
2xs
tokens.radii.2xsxs6px
xs
tokens.radii.xssm7px
sm
tokens.radii.smmd8px
md
tokens.radii.mdlg10px
lg
tokens.radii.lgxl12px
xl
tokens.radii.xl2xl14px
2xl
tokens.radii.2xl3xl16px
3xl
tokens.radii.3xl4xl24px
4xl
tokens.radii.4xlround9999px
round
tokens.radii.roundVisual Examples
Cards and Containers
Small Radius (sm)
Subtle rounding for cards
Medium Radius (md)
Standard component rounding
Large Radius (lg)
Pronounced rounding
Buttons and Interactive Elements
Circular Elements
Avatar
Icon
Use round
token for perfect circles
Usage
In CSS
.card {
border-radius: var(--token-radii-md); /* 8px */
}
.button {
border-radius: var(--token-radii-sm); /* 7px */
}
.avatar {
border-radius: var(--token-radii-round); /* 9999px */
}
/* Specific corners */
.dropdown {
border-top-left-radius: var(--token-radii-none);
border-top-right-radius: var(--token-radii-none);
border-bottom-left-radius: var(--token-radii-md);
border-bottom-right-radius: var(--token-radii-md);
}
In JavaScript/TypeScript
import { tokens } from '@vibrant-ui/tokens';
const cardStyle = {
borderRadius: `${tokens.radii.md}px`, // "8px"
};
const avatarStyle = {
borderRadius: '50%', // or tokens.radii.round
};
With Vibrant UI Components
import { Card, Button, Avatar } from '@vibrant-ui/components';
<Card radius="md">
Card content
</Card>
<Button radius="sm">
Click me
</Button>
<Avatar radius="round">
JD
</Avatar>
Guidelines
Consistency
Use consistent radius values throughout your interface:
- none (0px): Sharp corners for technical/data interfaces
- 3xs-xs (4-6px): Subtle rounding for small elements
- sm-md (7-8px): Standard rounding for most components
- lg-xl (10-12px): Friendly, approachable feeling
- 2xl+ (14px+): Playful, modern aesthetic
- round (9999px): Perfect circles and pills
Context
Choose radius values based on:
- Brand personality: More rounded = friendly, less rounded = professional
- Component size: Larger components can handle larger radius values
- Content type: Data tables might use smaller radius, marketing cards larger
Accessibility
- Ensure sufficient contrast at corners
- Test with high contrast mode
- Consider how border radius affects focus indicators
Edit on GitHub
Last updated on