rokle

Personality

20
40
70
15

Active brand: Meridian

Adjust sliders to see every component on the page respond in real time.

Alert

Contextual feedback messages for user actions. Info, success, warning, error variants.

Examples

Info

Informational alert for neutral messages.

Success

Confirms a successful operation.

Warning

Flags something that may need attention.

Error

Communicates a failure or blocking issue.

With title and action

Rich alert combining a title, body text, and a call-to-action.

Installation

pnpm add @rokle/components @rokle/tokens

Installs with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.

Usage

import { Alert } from "@rokle/components";
import { Alert } from "@rokle/components";

export function Example() {
  return (
    <div className="flex flex-col gap-3">
      <Alert variant="info">This is an informational message.</Alert>
      <Alert variant="success">Operation completed successfully.</Alert>
      <Alert variant="warning">Please review before proceeding.</Alert>
      <Alert variant="error">Something went wrong.</Alert>
    </div>
  );
}

Source

The implementation source for this component. Copy it into your project and customise.

API Reference

PropTypeDefaultDescription
variant"info" | "success" | "warning" | "error""info"Visual style variant.
childrenReactNode-Alert content.