How to use terra-alert - 6 common examples

To help you get started, we’ve selected a few terra-alert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-core / packages / terra-site / src / examples / tag / TagFallbacks.jsx View on Github external
const TagFallbacks = () => (
  <div>
    {alertText}
    <h3 id="fallbacks">Tag with no onClick or href</h3>
    
    } text="Icon &amp; Text - No OnClick/HREF Tag" /&gt;
  </div>
);
github cerner / terra-core / packages / terra-site / src / examples / alert / LongTextExample.jsx View on Github external
const alertEndTagStr = '';
    return (
      <div>
        <div dir="ltr">
          <h3>Alert of type info with custom title and long text with show more/less</h3>
          <br>
          <code>
            {alertStartTagStr}
            <br>
            &nbsp;&nbsp;{alertContentStr}
            <br>
            {alertEndTagStr}
          </code>
        </div>
        <br>
        
          <span>
            Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
            
              <button style="{buttonStyle}">
            
            
                Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
              <br><br>
                But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth.
              <br><br>
              </button><button style="{buttonStyle}">
            
          
        
      </button></span></div>
    );
github cerner / terra-core / packages / terra-site / src / examples / alert / SmallContainerExample.jsx View on Github external
<br>
        } &gt;
          {alertText}
        
        <br>
        <p>Action button has been clicked {this.state.actionButtonClickCount} times.</p>
        <br><br><br>
        <div dir="ltr">
          <h3>Basic Alert of type info in a small container (500px wide) which should be rendered the same as in wide container</h3>
          <br>
          <code>
            {alert2StartTagStr}{alert2Text}{alert2EndTagStr}
          </code>
        </div>
        <br>
        {alert2Text}
      
    );
  }
}
github cerner / terra-core / packages / terra-site / src / examples / alert / ActionAndDismissibleExample.jsx View on Github external
render() {
    const alertStartTagStr = '} &gt;';
    const alertEndTagStr = '';
    const alertText = 'This is a a custom alert with no icon or title. It is configured to be dismissible and with a custom action button. Click on the Dismiss button to dismiss the alert.';
    let alertElem = '';
    if (!this.state.isDismissed) {
      alertElem = (
        } &gt;
          {alertText}
        
      );
    }
    return (
      <div>
        <div dir="ltr">
          <h3>Alert of type custom with no icon or title that is dismissible and has an action button</h3>
          <br>
          <code>
            {alertStartTagStr}
            <br>
            &nbsp;&nbsp;{alertText}
            <br>
            {alertEndTagStr}
          </code></div></div>
github cerner / terra-core / packages / terra-site / src / examples / alert / SmallContainerExample.jsx View on Github external
return (
      <div style="{{">
        <div dir="ltr">
          <h3>Basic Alert of type warning with action button in a small container (500px wide) that will cause the action button section of the alert
              to render below the message instead of beside it.</h3>
          <br>
          <code>
            {alertStartTagStr}
            <br>
            &nbsp;&nbsp;{alertText}.
            <br>
            {alertEndTagStr}
          </code>
        </div>
        <br>
        } &gt;
          {alertText}
        
        <br>
        <p>Action button has been clicked {this.state.actionButtonClickCount} times.</p>
        <br><br><br>
        <div dir="ltr">
          <h3>Basic Alert of type info in a small container (500px wide) which should be rendered the same as in wide container</h3>
          <br>
          <code>
            {alert2StartTagStr}{alert2Text}{alert2EndTagStr}
          </code>
        </div>
        <br>
        {alert2Text}
      </div>
    );
github cerner / terra-core / packages / terra-site / src / examples / alert / ActionExample.jsx View on Github external
const alertText = 'This is a warning. It is configured with a custom Action button.';
    return (
      <div>
        <div dir="ltr">
          <h3>Basic Alert of type warning with action button</h3>
          <br>
          <code>
            {alertStartTagStr}
            <br>
            &nbsp;&nbsp;{alertText}.
            <br>
            {alertEndTagStr}
          </code>
        </div>
        <br>
        } &gt;
          {alertText}
        
        <br>
        <p>Action button has been clicked {this.state.actionButtonClickCount} times.</p>
      </div>
    );
  }
}

terra-alert

The Terra Alert component is a notification banner that can be rendered in your application when there is information that you want to bring to the user's attention. The Alert component supports a number of built-in notification types that render with pre

Apache-2.0
Latest version published 20 days ago

Package Health Score

88 / 100
Full package analysis

Popular terra-alert functions