lightdarkdefaultcompact
Getting StartedInstallationChangelogSupportGithubFrameworksAngularVueReactDemosFoundationThemesTypographyIconsPopoversInternationalizationDrag and DropKeyboard NavigationLayoutGetting StartedBlockInlineGridComponentsAccordionAlertAlert GroupBadgeBreadcrumbButtonButton GroupButton ExpandButton HandleButton IconButton ResizeButton SortCardChatCheckboxColorData GridDateDialogDividerDrawerDropdownFileFormat DatetimeFormat NumberFormsForm InteractionsForm ValidationHeaderInputMenuMonthNavPaginationPasswordProgress BarProgress CircleProgress DotRadioRangeRatingSearchSelectStepperSwitchTabsTagTextareaTimeToastToggletipTooltipTreeData GridGetting StartedFooterPlaceholderAsyncResponsiveHeightPaginationBordersHoverLayerRange SelectionCSVColumn AlignmentColumn WidthColumn FixedColumn StickyColumn VisibilityColumn GroupsColumn SpanColumn ResizeDraggable ColumnsDraggable RowsRow HeaderRow Multi SelectRow Single SelectRow HeightRow ActionRow Action BulkRow StickyRow StripeRow FixedRow SortRow Groups

React

Demo React

To use BlueprintUI in React 19+ be sure to follow the getting started guide.

import * as React from 'react';
import '@blueprintui/components/include/alert.js';
import '@blueprintui/components/include/button.js';

export default function App() {
  const [showAlert, setShowAlert] = React.useState(false);

  return (
    <div bp-layout="block gap:md">
      <bp-button onClick={() => setShowAlert(!showAlert)}>hello there</bp-button>

      {showAlert ? (
        <bp-alert-group status="success" hidden={!showAlert}>
          <bp-alert closable onClose={() => setShowAlert(false)}>General Kenobi...</bp-alert>
        </bp-alert-group>
      ) : null}
    </div>
  );
}

TypeScript Support

To add type support for BlueprintUI components in React, you can augment the JSX.IntrinsicElements interface to include custom elements.

// global.d.ts
import type { BpButton } from '@blueprintui/components/button';
import type { BpAlert } from '@blueprintui/components/alert';

type CustomEvents<K extends string> = { [key in K] : (event: CustomEvent) => void };
type CustomElement<T, K extends string = ''> = Partial<T & DOMAttributes<T> & { children: any } & CustomEvents<`on${K}`>>;

declare 'react/jsx-runtime' {
  namespace JSX {
    interface IntrinsicElements {
      ['bp-button']: CustomElement<BpButton>;
      ['bp-alert']: CustomElement<BpAlert, 'close'>;
    }
  }
}