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

@crave/farmblocks-alert

Package Overview
Dependencies
Maintainers
6
Versions
1328
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crave/farmblocks-alert

A React Component for displaying alert bar messages

  • 6.1.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-99.42%
Maintainers
6
Weekly downloads
 
Created
Source

Farmblocks-Alert

A React component for displaying messages on an alert bar.

Installation

npm install @crave/farmblocks-alert

Spec

screen shot 2017-09-24 at 6 13 31 pm

Usage

const React = require("react");
const ReactDOM = require("react-dom");
const Alert = require("@crave/farmblocks-alert").default;
const { AlertTypes } = require("@crave/farmblocks-alert");

const root = document.createElement("div");

ReactDOM.render(
  <Alert
    dismissable
    type={AlertTypes.POSITIVE}
    text="Positive alert!"
    onDismiss={() => {
      console.log("dismiss button clicked");
    }}
  />,
  root
);

document.body.appendChild(root);

API

See it in the source

Props

PropertyDescriptionTypeDefault value
texttext to be displayed at the alert (required)string
typechanges the alert coloroneOf(AlertTypes)AlertTypes.NEWS
dismissableallows the alert to be closed. If false it can't be closed by user action.booleantrue
autoRemoveautomatically closes the alert after the amount of time set in visibleTime propbooleantrue
onDismissfunction to be called when the alert is closedfunction() => null
visibleTimeamount of time that the alert should be visible once autoRemove is true -- in millisecondsnumber2000
zIndexcustom zIndexnumber2500
bottomAlignedalign the alert on the bottom of its container, instead of the default top alignmentbooleanfalse

License

MIT

Keywords

FAQs

Package last updated on 10 Feb 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