Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fylgja/badge

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fylgja/badge

Badges component serves as a small blocks to indicate notifications. Or to highlight an item

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fylgja - Badge

NPM version license

The badges component serves as a small blocks to indicate notifications, or to highlight an item.

Installation

npm install @fylgja/badge

Then include the component in to your code via;

@use "@fylgja/badge";
// Or via PostCSS import
@import "@fylgja/badge";

How to use

To use the badge, create element with the class .badge.

<span class="badge">..</span>

But if you need a badge with a little more complexity, like a badge with 2 sides of data or with a close button.

You can use the .badge-addon as wrapper that binds the 2 badges to one badge.

<div class="badge-addon">
    <span class="badge">New</span>
    <button class="badge -theme">Close</button>
</div>

Badge group (Tag cloud)

To create Badge group (Tag cloud), you need to use custom CSS or the @fylgja/utilpack.

To create a flex-grid with gap via margin or via the gap property (when it is better supported).

<div class="flex flex-wrap">
    <span class="badge m-1">Wolfs</span>
    <span class="badge m-1">Cats</span>
    <span class="badge m-1">Bears</span>
    ...
</div>

Config

As with almost all of our components, CSS variables can be configured to add your own look/style.

Want direct control on the base styles, here are the following SCSS variables can you modify.

$badge-padding: 0.125em 0.75em !default;
$badge-radius: 0.375em !default;
$badge-bg: if($root-fg == #000, #eee, #222) !default;
$badge-color: $color-text !default;
$badge-font-size: 0.75em !default;
$badge-font-weight: 500 !default;

Keywords

FAQs

Package last updated on 05 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc