DEV Community

Jennifer Fadriquela
Jennifer Fadriquela

Posted on

1 1

Custom Bootstrap Badges

I recently made a custom badge that has a 'delete' functionality. I used Bootstrap Flex utility layout and its Badge component styles.

Alt Text

<h3>
  <div class="badge badge-dark m-1">
      <div class="d-flex align-items-center justify-content-between">
          <span class="pr-2">Sample</span>
          <i (click)="clickMe()" class="fa fa-times"></i>
      </div>
  </div>
</h3>
Enter fullscreen mode Exit fullscreen mode

The examples on bootstrap's site were limited to a single entity inside a span. Though it endorses links as actionable badges, my requirement wants to have a second entity inside the badge with an isolated action.

I placed the text and close icon inside a d-flex container to properly align them.

Here is the demo.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay