close-button/BaseAlertCloseButton.tsx

aksel · @navikt/core/react/src/utils/components/base-alert/close-button/BaseAlertCloseButton.tsx · typescript · MIT
ui

BaseAlertCloseButton.tsx from navikt/aksel

// Source: https://github.com/navikt/aksel | License: MIT | Copyright 2025 Nav (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration
// Provided via justclaw.it.com; keep this notice with the code.
import React, { forwardRef } from "react";
import { XMarkIcon } from "@navikt/aksel-icons";
import { Button } from "../../../../button";
import { cl } from "../../../helpers";
import { useI18n } from "../../../i18n/i18n.hooks";

type BaseAlertCloseButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;

/**
 * @see 🏷️ {@link BaseAlertCloseButtonProps}
 * @example
 * ```jsx
 *  <BaseAlert>
 *    <BaseAlert.Header>
 *      <BaseAlert.Title>Info title</BaseAlert.Title>
 *      <BaseAlert.CloseButton onClick={...} />
 *    </BaseAlert.Header>
 *  </BaseAlert>
 * `

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key