
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
react-js-banner
Advanced tools
Simple React JS line banner Component with fade in and fade out animation.
It is a simple line text banner component (like warning, error, success). Styles (font and background) can be customized. By default the banner has a fade in and fade out animation of 2s. This can be used in two ways, banner can be shown for a specific amount of time using visibleTime prop, or can be handled manually by making the title text null or changing the string.
How to thank me? Just click on ⭐️ button or buy me a tea using the donation button below :)
Install it from npm and include it in your React build process (using Webpack, Browserify, etc).
npm i react-js-banner
Import Banner
in your react component.
import Banner from 'react-js-banner';
Example:
<Banner
id="banner1"
title="This is an example Banner Title"
css={{ color: "#000", backgroundColor: "grey", fontFamily: "arial" }}
/>
If you want the banner to be available for a specific amount of time, visibleTime prop can be passed:
<Banner
id="banner2"
title="This is an example banner with CSS"
css={{color: "#FFF", backgroundColor: "red", fontSize: 20 }}
visibleTime={3000}
/>
For instance, you can define the background color, font color, font family, size, etc.
{
banner1Css: { color: "#FFF", backgroundColor: "green" },
banner2Css: { color: "#000", backgroundColor: "grey", fontFamily: "arial" },
banner3Css: { color: "#FFF", backgroundColor: "red", fontSize: 20 }
}
Example of banner with image:
import logo from './logo.svg';
<Banner
id="banner3"
title="This is an example banner with CSS and Image"
image={logo}
imageClass="App-logo"
css={this.state.banner2Css}
/>
New! Now the banner accepts a list of children to display all content data to make it more extensible!
<Banner id="banner4">
<div>
<h1>h1</h1>
<h2>h2</h2>
<h3>h3</h3>
</div>
</Banner>
Name | Type | Mandatory | Description |
---|---|---|---|
id | String | Y | Banner Id you want to use |
title | String | N | Adding some text will make the banner appear |
css | object | N | CSS customizations |
visibleTime | number | N | time in seconds you want the banner to be visible |
image | String | N | image to appear at the left of text |
imageClass | String | N | image css class e.g "image-customized-class" |
transitionAppearTime | number | N | time for the banner to appear |
transitionTime | number | N | time for the transition to take |
showBanner | bool | N | force the banner to show or hide, this will override the visibleTime variable |
onHideCallback | function | N | callback when the popup hides (to be used with visible time prop in manage state, will pass as param the banner id) |
If you think that any information you obtained here is useful and worth of some money and are willing to pay for it, feel free to send any amount through Paypal :)
You can also follow me on Patreon: https://patreon.com/Jacware
<Banner
id="banner4"
title="This is an example banner with CSS and 3 Seconds of Visibility"
css={this.state.banner3Css}
visibleTime={3000}
showBanner={true}
onHideCallback={(bannerId) => alert('This is an example banner with CSS and 3 Seconds of Visibility Hidden')}
/>
showBanner prop is under revision and will be deprecated in a future version
e.g
<Banner showBanner={true}>
<div>
<h1>h1</h1>
<h2>h2</h2>
<h3>h3</h3>
</div>
</Banner>
Licensed under the MIT License © jciccio
FAQs
Did you know?
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.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.