Skip to main content Skip to docs navigation

Retro Sticky

Windows 98-style sticky notes that demonstrate Bootstrap component patterns

About

The Retro Sticky component brings back the charm of Windows 98's sticky notes while demonstrating Bootstrap best practices. This example component shows how to properly extend Bootstrap using semantic colors, SCSS variables, and modifier patterns.

Learning Example: This component demonstrates Bootstrap patterns including contextual colors, size modifiers, and SCSS variable usage. Study the source code to learn how to build Bootstrap-friendly components.

Examples

Basic sticky note

A classic yellow sticky note with Windows 98 styling, using Bootstrap's default card structure.

๐Ÿ“ Sticky Note
Remember to:
โ€ข Buy milk ๐Ÿฅ›
โ€ข Call mom
โ€ข Water the plants ๐ŸŒฑ
โ€ข Defrag hard drive (j/k!)
html
<div class="retro-sticky">
<div class="retro-sticky-titlebar">
  <span class="retro-sticky-title">๐Ÿ“ Sticky Note</span>
  <div class="retro-sticky-controls">
    <button class="minimize"></button>
    <button class="maximize"></button>
    <button class="close"></button>
  </div>
</div>
<div class="retro-sticky-body">
  Remember to:
  <br>โ€ข Buy milk ๐Ÿฅ›
  <br>โ€ข Call mom
  <br>โ€ข Water the plants ๐ŸŒฑ
  <br>โ€ข Defrag hard drive (j/k!)
</div>
</div>

Contextual colors

Following Bootstrap's semantic color system, use contextual variants instead of color names.

Primary
Using $primary color
.retro-sticky-primary
Success
Using $success color
.retro-sticky-success
Info
Using $info color
.retro-sticky-info
Warning
Using $warning color
.retro-sticky-warning
Danger
Using $danger color
.retro-sticky-danger
html
<div class="d-flex gap-3 flex-wrap">
<div class="retro-sticky retro-sticky-primary">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Primary</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Using $primary color
    <br>.retro-sticky-primary
  </div>
</div>

<div class="retro-sticky retro-sticky-success">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Success</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Using $success color
    <br>.retro-sticky-success
  </div>
</div>

<div class="retro-sticky retro-sticky-info">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Info</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Using $info color
    <br>.retro-sticky-info
  </div>
</div>

<div class="retro-sticky retro-sticky-warning">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Warning</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Using $warning color
    <br>.retro-sticky-warning
  </div>
</div>

<div class="retro-sticky retro-sticky-danger">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Danger</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Using $danger color
    <br>.retro-sticky-danger
  </div>
</div>
</div>

Size modifiers

Following Bootstrap's sizing pattern (like .btn-sm, .btn-lg), the retro sticky supports size variants.

Small
Compact sticky
.retro-sticky-sm
Default
Regular size sticky
(no modifier needed)
Large
Extra large sticky for longer notes
.retro-sticky-lg

Plenty of room for your thoughts!
html
<div class="d-flex gap-3 flex-wrap align-items-start">
<div class="retro-sticky retro-sticky-sm">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Small</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Compact sticky
    <br>.retro-sticky-sm
  </div>
</div>

<div class="retro-sticky">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Default</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Regular size sticky
    <br>(no modifier needed)
  </div>
</div>

<div class="retro-sticky retro-sticky-lg">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">Large</span>
    <div class="retro-sticky-controls">
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Extra large sticky for longer notes
    <br>.retro-sticky-lg
    <br>
    <br>Plenty of room for your thoughts!
  </div>
</div>
</div>

Practical examples

Task reminders with semantic colors

Use contextual colors to convey meaning, not just decoration.

โš ๏ธ Deadline
Project presentation
Tomorrow at 2 PM!

Don't forget slides
โœ… Done
Completed tasks:
โœ“ Email client
โœ“ Fix bug #42
โœ“ Coffee break โ˜•
โ„น๏ธ FYI
WiFi password:
Coffee4Life!

(It's always coffee)
html
<div class="d-flex gap-3 flex-wrap">
<div class="retro-sticky retro-sticky-warning retro-sticky-tilted">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">โš ๏ธ Deadline</span>
    <div class="retro-sticky-controls">
      <button class="minimize"></button>
      <button class="maximize"></button>
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Project presentation
    <br>Tomorrow at 2 PM!
    <br>
    <br>Don't forget slides
  </div>
</div>

<div class="retro-sticky retro-sticky-success retro-sticky-tilted">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">โœ… Done</span>
    <div class="retro-sticky-controls">
      <button class="minimize"></button>
      <button class="maximize"></button>
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    Completed tasks:
    <br>โœ“ Email client
    <br>โœ“ Fix bug #42
    <br>โœ“ Coffee break โ˜•
  </div>
</div>

<div class="retro-sticky retro-sticky-info retro-sticky-tilted">
  <div class="retro-sticky-titlebar">
    <span class="retro-sticky-title">โ„น๏ธ FYI</span>
    <div class="retro-sticky-controls">
      <button class="minimize"></button>
      <button class="maximize"></button>
      <button class="close"></button>
    </div>
  </div>
  <div class="retro-sticky-body">
    WiFi password:
    <br>Coffee4Life!
    <br>
    <br>(It's always coffee)
  </div>
</div>
</div>

Bootstrap patterns demonstrated

1. Contextual colors

The component uses Bootstrap's semantic color system:

// Instead of: .retro-sticky-blue
.retro-sticky-primary {
  background: lighten($primary, 40%);
}

2. SCSS variables

All colors reference Bootstrap variables for consistency:

// Uses Bootstrap's color variables
background: $gray-400;
border-color: $white $gray-600 $gray-600 $white;
color: $black;

3. Size modifiers

Follows Bootstrap's sizing convention:

.retro-sticky-sm { /* Small variant */ }
.retro-sticky-lg { /* Large variant */ }
// Just like: .btn-sm, .btn-lg

4. Component extension

Extends Bootstrap's card component:

.retro-sticky {
  @extend .card;
  // Custom styles...
}

CSS Classes

ClassDescriptionBootstrap Pattern
.retro-stickyBase classExtends .card
.retro-sticky-smSmall sizeLike .btn-sm
.retro-sticky-lgLarge sizeLike .btn-lg
.retro-sticky-primaryPrimary colorUses $primary
.retro-sticky-successSuccess colorUses $success
.retro-sticky-infoInfo colorUses $info
.retro-sticky-warningWarning colorUses $warning
.retro-sticky-dangerDanger colorUses $danger
.retro-sticky-inactiveInactive stateUses $gray-600
.retro-sticky-tiltedRotated look-

Key takeaways

This component demonstrates important Bootstrap principles:

  1. Use semantic colors - primary, success, danger instead of blue, green, red
  2. Follow naming patterns - Size modifiers like -sm and -lg
  3. Leverage SCSS variables - Colors automatically update with theme changes
  4. Extend existing components - Build on Bootstrap's foundation
  5. Maintain consistency - Components that feel native to Bootstrap

When building your own components, follow these patterns to ensure they integrate seamlessly with Bootstrap and are maintainable as the framework evolves.

Accessibility

  • Semantic HTML structure maintained
  • Color contrast follows Bootstrap's standards
  • Respects prefers-reduced-motion for animations
  • Focus states inherited from Bootstrap's button styles