🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@lightspeed/cirrus-flag

Package Overview
Dependencies
Maintainers
9
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightspeed/cirrus-flag

Cirrus Flag Component

latest
npmnpm
Version
4.0.0
Version published
Maintainers
9
Created
Source

Flag

A set of small and readable flags.

Installation

First, make sure you have been through the Getting Started steps of adding Cirrus in your application.

If using Yarn:

yarn add @lightspeed/cirrus-flag

Or using npm:

npm i -S @lightspeed/cirrus-flag

Contributing

Flags as React components are automatically generated with a build script. To see changes when adding/updating a flag, add your .svg in the svg folder, navigate to this directory in the terminal, and run this command to re-generate the build:

yarn prepublish

This script will generate the React components and the Flag sprite.

Note that this command will be run automatically when in local development and when we publish to npm.

Usage

Import required styles in your .scss:

@import '@lightspeed/cirrus-flag/Flag.scss';

React Component

Props

Color properties can be any Cirrus color token, ex green-100 or any CSS value.

PropTypeDescription
codestringISO 3166-2 Country code (case is insensitive)
namestringCountry / Region / Other name (case is insensitive)
sizestringDefault 16 by 12, can be set to any custom value, the height will scale to be 75%

Example

import React from 'react';
import Icon from '@lightspeed/cirrus-flag';

const MyComponent = () => (
  <div>
    <Flag code="CA" />
    <Flag name="Canada" />
    <Flag code="CA-QC" />
    <Flag name="Quebec" />
    <Flag code="nl" size="1.75rem" />
  </div>
);

export default MyComponent;

FAQs

Package last updated on 10 Jan 2019

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