New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@one-platform/opc-header

Package Overview
Dependencies
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@one-platform/opc-header

A web component based on Lit Element for Red Hat One Platform Header

  • 0.0.2-prerelease
  • latest
  • npm
  • Socket score

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

opc-header component 👋

Version Build Status Maintenance

A standardized web component based on Lit Element for Red Hat One Platform Header that uses Patternfly Breadcrumb and Links as button HTML component

Prerequisites

The opc-header component is partially dependent on the Patternfly library for breadcrumbs and links. So to avoid any missing styles, add the patternfly.css file before the component script tags.

Usage

Plain Header

 <opc-header heading="OPC Header"></opc-header>

Header with Breadcrumbs and Links

 <opc-header heading="OPC Header">
  <opc-header-breadcrumb slot="breadcrumb"></opc-header-breadcrumb>
  <opc-header-links slot="links"></opc-header-links>
 </opc-header>

For custom options,

  • use the opcHeaderBreadcrumb setter function to set the header breadcrumb
  • use the opcHeaderLinks setter function to set the header links
  const breadcrumbs = [
    {
      "name":"Section Home",
      "href":"#"
    },
    {
      "name":"Section Landing",
      "href":"#"
    }];

  const links = [
    {
      "name":"Link1",
      "href":"#",
      "icon":"fa-play-circle"
    },
    {
      "name":"Link2",
      "href":"#",
      "icon":"fa-question-circle"
    },
    {
      "name":"Link3",
      "href":"#",
      "icon":"fa-file"
    }];

  document.querySelector("opc-header-breadcrumb").opcHeaderBreadcrumb = breadcrumbs;
  document.querySelector("opc-header-links").opcHeaderLinks = links;

Header with color themes

 <opc-header heading="OPC Header" theme="dark">
  <opc-header-breadcrumb slot="breadcrumb"></opc-header-breadcrumb>
  <opc-header-links slot="links"></opc-header-links>
 </opc-header>

Header with lightDOM

 <opc-header heading="OPC Header" theme="red">
  <div slot="breadcrumb" id="breadcrumb">
    <nav class="pf-c-breadcrumb" aria-label="breadcrumb">
      <ol class="pf-c-breadcrumb__list">
        <li class="pf-c-breadcrumb__item">
          <span class="pf-c-breadcrumb__item-divider">
            <i class="fas fa-angle-right" aria-hidden="true"></i>
          </span>
          <a href="#" class="pf-c-breadcrumb__link">Section home</a>
        </li>
        <li class="pf-c-breadcrumb__item">
          <span class="pf-c-breadcrumb__item-divider">
            <i class="fas fa-angle-right" aria-hidden="true"></i>
          </span>
          <a href="#" class="pf-c-breadcrumb__link pf-m-current" aria-current="page">Section landing</a>
        </li>
      </ol>
    </nav>
  </div>
  <div slot="links">
    <a class="pf-c-button pf-m-link" href="" style="--pf-c-button--m-link--Color: var(--opc-header__Links--Color);--pf-c-button--FontSize: var(--pf-global--FontSize--sm);">
      <span class="pf-c-button__icon pf-m-start">
        <i class="fas fa-play-circle" aria-hidden="true"></i>
      </span>Link1
    </a>
    <a class="pf-c-button pf-m-link" href="" style="--pf-c-button--m-link--Color: var(--opc-header__Links--Color);--pf-c-button--FontSize: var(--pf-global--FontSize--sm);">
      <span class="pf-c-button__icon pf-m-start">
        <i class="fas fa-question-circle-o" aria-hidden="true"></i>
      </span>Link2
    </a>
  </div>
 </opc-header>

Slots

There are two optional slots for header breadcrumb and links.

Default slot

Place the opc-header-breadcrumb and opc-header-links component here.

Attributes

.readme-color-preview { display: inline-block; width: 1em; height: 1em; vertical-align: middle; background-color: var(--bg, #ffffff); border: 1px solid #444444; }

heading Adds a heading to the header component

theme Options include default, dark, red, blue, cyan. Please use css variables provided with the component if you want to add more customizations.

colorhex
default #ffffff
dark #000000
red #be0000
blue #316DC1
cyan #1B8793

Variable hooks

Available hooks for styling header, breadcrumb and link colors include:

Variable nameDefault value
--opc-header--BackgroundColor #ffffff
--opc-header--Color #000000
--opc-header--Width100%
--opc-header__BreadcrumbDivider--Color #000000
--opc-header__BreadcrumbLink--Colorvar(--pf-global--link--Color)
--opc-header__Links--Colorvar(--pf-global--link--Color)

Events

None as of yet

Development server

  • Run development server
npm run dev opc-header

OR

npm run start opc-header

Build

npm run build opc-header

Run tests

npm run test

🤝 Contributors

👤 Diwanshi Pandey

FAQs

Package last updated on 10 Sep 2020

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