Socket
Socket
Sign inDemoInstall

@highlight-ui/alert

Package Overview
Dependencies
37
Maintainers
10
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @highlight-ui/alert

This is the Alert component used in Personio


Version published
Weekly downloads
2.3K
increased by48.23%
Maintainers
10
Install size
6.49 MB
Created
Weekly downloads
 

Readme

Source

npm personio.design storybook.personio.design

@highlight-ui/alert

Using npm:

npm install @highlight-ui/alert

Using yarn:

yarn add @highlight-ui/alert

Using pnpm:

pnpm install @highlight-ui/alert

In your (S)CSS file:

@import url('@highlight-ui/alert');

Once the package is installed, you can import the library:

import { Alert, InlineAlert } from '@highlight-ui/alert';

Usage

import React, { useState } from 'react';
import { Alert } from '@highlight-ui/alert';

export default function AlertExample() {
  return <Alert status="highlight">This is an alert!</Alert>;
}

⚠️⚠️⚠️⚠️ As of version 7.0.0 on both Alert and InlineAlert the pre-defined typographic style on children are removed. ⚠️⚠️⚠️⚠️ so for the component to work properly use next suggestion as an example In your (S)CSS file:

@import url('@highlight-ui/alert');
@import url('@highlight-ui/typography');

In your TS(X) file:

import React, { useState } from 'react';
import { Body } from '@highlight-ui/typography';
import { Alert } from '@highlight-ui/alert';

export default function AlertExample() {
  return (
    <Alert status="highlight">
      <Body color="text-default">This is an alert!</Body>
    </Alert>
  );
}

Props 📜

PropTypeRequiredDefaultDescription
status'highlight', 'success', 'warning', 'critical'YesDefines which variant of the Alert to render
idstringNoGives the alert an id
actionsReact.ReactNodeNoAllows rendering a ReactNode (a button is intended) below the alert content
enableCloseButtonbooleanNofalseAllows showing a close button
fullWidthbooleanNofalseIf true, uses 100% of its container width
iconColorIconColorTokenNoPasses a color to the icon
iconFamily'regular', 'light', 'solid'NosolidPasses a font family to the icon
iconSizenumberNo16Passes a size to the icon
iconNamestringNoPasses an icon name to the icon
onClickCloseButton() => voidNoPasses a function to onClick() of the close button

Custom types 🔠

TypeValuesDescription
IconColorToken"Icon" and "Icon On" color token namesA type exported by the @highlight-ui/icon package

Contributing 🖌️

Please visit personio.design for usage guidelines and visual examples.

If you're interested in contributing, please visit our contribution page.

FAQs

Last updated on 05 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc