Overview
TheStamp component creates a visually distinctive postage stamp design with perforated edges. It displays an emoji or icon in the center and a text label below, automatically adapting size for mobile devices.
Import
Usage
Basic Stamp
Achievement Badges
Status Stamps
Custom Styling
Stamp Collection
Props
Emoji or single character to display in the center.Rendered with Text type “d1” for large display. Works best with:
- Emojis: 🎉 🏆 ⭐ 💎 ✅
- Single characters: A, 1, ✓
- Unicode symbols: ★, ♥, ⚡
Text label displayed below the icon.Automatically truncates with ellipsis if too long:
- Font: DM Mono, 13px
- Max width: Container width minus padding
- Display: Single line, no wrapping
Background color for the icon area.Creates the colored square behind the icon. Use soft/light colors for best visual effect.
Custom inline styles for the stamp container.Common use cases:
- Rotation:
transform: 'rotate(-5deg)' - Margin:
margin: 16 - Positioning:
position: 'absolute' - Cursor:
cursor: 'pointer'for clickable stamps
Design Specifications
Desktop (> 450px)
- Container: 108px × 132px
- Icon area: 96px × 96px
- Border: White, 2px
- Perforations: Circular cutouts around all edges
- Title: 13px, DM Mono font, centered
- Shadow: Drop shadow for depth effect
Mobile (≤ 450px)
- Container: 96px × 120px
- Icon area: 84px × 84px
- Border: White, 2px
- Perforations: Same pattern, scaled down
- Title: 13px, DM Mono font, centered
- Shadow: Same drop shadow
Visual Structure
Features
- Authentic stamp design: Perforated edges using SVG patterns
- Responsive sizing: Automatically scales down on mobile devices
- Icon-first: Large, prominent emoji or character display
- Text truncation: Long titles automatically ellipsize
- Custom colors: Full background color control
- Drop shadow: Subtle depth effect
- Monospace title: DM Mono font for stamp-like appearance
SVG Perforation Pattern
The component uses inline SVG to create the perforated edge effect:- Generated dynamically based on screen size
- Circular cutouts on all four sides
- 12px spacing between perforations
- White fill color for stamp base
- Filter effect for realistic shadow
Best Practices
- Choose appropriate emojis: Large, clear icons work best
- Use soft background colors: Light tints provide nice contrast without overwhelming
- Keep titles short: Aim for 1-2 words to avoid truncation
- Group meaningfully: Display multiple stamps for collections or achievements
- Add rotation: Slight rotation (
rotate(-5deg)) adds authenticity - Make clickable: Add click handlers for interactive stamp collections
- Consider context: Stamps work well for achievements, awards, status, certifications
Use Cases
- Achievement systems: Unlock badges, milestones
- User profiles: Display earned awards or certifications
- Status indicators: Premium, verified, certified badges
- Gamification: Collect-them-all stamp books
- Rewards programs: Loyalty stamps, punch cards
- Educational platforms: Course completion, skill badges
- Social proof: Ratings, endorsements, testimonials
- Event participation: Attended, speaker, sponsor badges
Styling Ideas
Rotated Stamps
Overlapping Stamps
Accessibility
- Uses
role="stamp"for semantic identification - Icon renders as visible text (emojis are accessible)
- Title provides text alternative
- Consider adding aria-label for screen readers:
Browser Support
- Modern browsers with SVG support
- Responsive design uses
window.innerWidth - Flexbox layout for alignment
- Text ellipsis for overflow handling
Dependencies
- styled-components - Styling and responsive design
- Text component - Title rendering
- Inline SVG - Perforation pattern