{"id":25478472,"url":"https://github.com/isamrish/flex-banner","last_synced_at":"2025-07-18T04:37:37.624Z","repository":{"id":57238161,"uuid":"235169821","full_name":"isamrish/flex-banner","owner":"isamrish","description":"Fully responsive react banner for websites","archived":false,"fork":false,"pushed_at":"2020-08-20T15:30:10.000Z","size":1372,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T16:42:48.785Z","etag":null,"topics":["banner","create-react-library","flex-banner","javascript","react","top-bar","typescript"],"latest_commit_sha":null,"homepage":"https://flex-banner-example.now.sh/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isamrish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-20T18:30:10.000Z","updated_at":"2023-11-15T10:41:55.000Z","dependencies_parsed_at":"2022-08-26T14:04:39.524Z","dependency_job_id":null,"html_url":"https://github.com/isamrish/flex-banner","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/isamrish/flex-banner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isamrish%2Fflex-banner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isamrish%2Fflex-banner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isamrish%2Fflex-banner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isamrish%2Fflex-banner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isamrish","download_url":"https://codeload.github.com/isamrish/flex-banner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isamrish%2Fflex-banner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265701428,"owners_count":23813751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banner","create-react-library","flex-banner","javascript","react","top-bar","typescript"],"created_at":"2025-02-18T14:34:08.871Z","updated_at":"2025-07-18T04:37:37.594Z","avatar_url":"https://github.com/isamrish.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./media/flex-banner.png\" alt=\"flex-banner\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  Fully responsive react banner for websites. It is useful when you want to show important message to your website visitors such as product updates announcement, upcoming event announcement etc.\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![NPM](https://img.shields.io/npm/v/flex-banner.svg)](https://www.npmjs.com/package/flex-banner) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.com/IsAmrish/flex-banner.svg?branch=master)](https://travis-ci.com/IsAmrish/flex-banner)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eA small react component `FlexBanner` to help you . Built with ❤︎ by\n  \u003ca href=\"https://github.com/isamrish\"\u003eAmrish Kushwaha\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/flex-banner.gif\" alt=\"flexBanner example video\"\u003e\n\u003c/p\u003e\n\n## Install\n\n```bash\nnpm install --save flex-banner\n```\n\nor\n\n```bash\nyarn add flex-banner\n```\n\n## Usage\n\n```tsx\nimport * as React from \"react\";\n\nimport FlexBanner from \"flex-banner\";\n\nclass Example extends React.Component {\n  render() {\n    return (\n      \u003cFlexBanner\n        title=\"Fully responsive react banner for websites\"\n        ctaLink=\"https://github.com/IsAmrish/flex-banner\"\n        ctaTitle=\"Learn More\"\n        isCenter={true}\n      /\u003e\n    );\n  }\n}\n```\n\n### Usage with Optional Properties\n\nThis example includes optional property in the component:\n\n**ctaTitle** - Title of Call To Action (CTA).\n\n**isCenter** - To make banner title and link center aligned.\n\n**crossIconSize** - To define, font size of cross Icons.\n\n**animationTime** - To define, sliding { SlideDown and SlideUp } time of banner.\n\n**delayToShowBanner** - Delay in showing up banner.\n\n**daysToLive** - No of days cookie will live before banner is shown up.\n\n**wrapperStyle** - style object for styling of the wrapper\n\n**mainStyleTitle** - style object for styling of the title of banner. If `ctaTitle` property is not defined, then this will defined the styling of link.\n\n**mainStyleLink** - style object for styling of the CTA of banner.\n\n**crossStyle** - style object for styling of the crossIcon. The font size of cross icon can only be defined by `crossIconSize` property.\n\n**hidePermanentlyOnDate** - To hide banner permanently on a specific date / datetime\n\n## Properties\n\n| Property          | Type    | Required | Default value | Description                                                                                                                                                                                                             |\n| ----------------- | ------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| title             | string  | yes      |               | the title of the banner                                                                                                                                                                                                 |\n| ctaLink           | string  | yes      |               | url for the call to action                                                                                                                                                                                              |\n| ctaTitle          | string  | no       |               | The title for call to action. It is not required if you want to use `title` as `title of call to action`                                                                                                                |\n| isCenter          | boolean | no       | true          | Make center aligned the banner with value `true` otherwise left aligned using value `false`                                                                                                                             |\n| crossIconSize     | number  | no       | 22            | size of crossIcon in px. Set its value to `0` if you don't want to add crossIcon.                                                                                                                                       |\n| animationTime     | number  | no       | 1             | animationTime is in `seconds`. It's sliding time for banner. For no animation, set value to `0`.                                                                                                                        |\n| delayToShowBanner | number  | no       | 2             | delayToShowBanner is in `seconds`. It's the time a user has to keep the page open before the banner is shown. For no delay, set value to `0`                                                                            |\n| daysToLive        | number  | no       | 0             | A property specifying the `number of days` the cookie will live before the banner is shown again to a user. The default is `0`, it means that banner will show up every time user refresh the page or hit the page url. |\n| wrapperStyle      | object  | no       |               | style object for styling of the wrapper                                                                                                                                                                                 |\n| mainStyleTitle    | object  | no       |               | style object for styling of title                                                                                                                                                                                       |\n| mainStyleLink     | object  | no       |               | style object for styling of Call To Action link                                                                                                                                                                         |\n| crossStyle        | object  | no       |               | style object for styling cross Icon - such as color etc. **Note** - font size property will be set only by `crossIconSize` property.                                                                                    |\n\n| hidePermanentlyOnDate        | Date  | no       |               | To hide banner permanently on a specific date / datetime property.                                                                                    |\n\n### Example with CTA title\n\n```tsx\nimport * as React from \"react\";\n\nimport FlexBanner from \"flex-banner\";\n\nclass Example extends React.Component {\n  render() {\n    return (\n      \u003cFlexBanner\n        title=\"Fully responsive react banner for websites\"\n        ctaLink=\"https://github.com/IsAmrish/flex-banner\"\n        ctaTitle=\"Learn More\"\n        isCenter={false}\n        crossIconSize={24}\n        animationTime={1.5}\n        delayToShowBanner={0}\n        daysToLive={5}\n        wrapperStyle={{ backgroundColor: \"lightblue\" }}\n        mainStyleTitle={{ color: \"black\" }}\n        mainStyleLink={{ color: \"red\" }}\n        crossStyle={{ color: \"red\" }}\n      /\u003e\n    );\n  }\n}\n```\n\n#### Results\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/flex-banner-optional-values.png\" alt=\"flex-banner optional values\" /\u003e\n\u003c/p\u003e\n\n### Example without CTA title\n\n```tsx\nimport * as React from \"react\";\n\nimport FlexBanner from \"flex-banner\";\n\nclass Example extends React.Component {\n  render() {\n    return (\n      \u003cFlexBanner\n        title=\"Fully responsive react banner for websites\"\n        ctaLink=\"https://github.com/IsAmrish/flex-banner\"\n        isCenter={false}\n        crossIconSize={24}\n        animationTime={1.5}\n        delayToShowBanner={0}\n        daysToLive={5}\n        wrapperStyle={{ backgroundColor: \"lightblue\" }}\n        mainStyleTitle={{ color: \"green\" }}\n        mainStyleLink={{ color: \"blue\" }} // this will not work\n        crossStyle={{ color: \"red\" }}\n      /\u003e\n    );\n  }\n}\n```\n\n#### Results\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/flex-banner-optional-value-without-cta-title.png\" alt=\"flex-banner optional value without cta title\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Responsive View of FlexBanner\n\nThe banner will be shown top regardless of screen.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/flex-banner-mobile.gif\" alt=\"flexBanner example video\"\u003e\n\u003c/p\u003e\n\n## License\n\nMIT © [isamrish](https://github.com/isamrish)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisamrish%2Fflex-banner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisamrish%2Fflex-banner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisamrish%2Fflex-banner/lists"}