blokhaus

Data & Presets

Default data constants for colors, fonts, callouts, and emojis.

Blokhaus ships with sensible defaults for colors, fonts, callouts, and emojis. All defaults can be overridden via props on their respective plugins and components.

Import

import {
  DEFAULT_COLOR_PALETTE,
  DEFAULT_FONT_FAMILIES,
  DEFAULT_CALLOUT_PRESETS,
  DEFAULT_EMOJIS,
} from "@blokhaus/core";

import type {
  ColorPalette,
  ColorEntry,
  FontFamilyEntry,
  CalloutPreset,
  EmojiItem,
} from "@blokhaus/core";

DEFAULT_COLOR_PALETTE

The default color palette used by the ColorPlugin and ColorPicker components. Contains text colors and highlight (background) colors.

Type: ColorPalette

interface ColorPalette {
  text: ColorEntry[];
  highlight: ColorEntry[];
}

interface ColorEntry {
  label: string; // Human-readable label
  value: string; // CSS value (var() reference) or empty string for default
  swatch: string; // Raw color for rendering the picker dot
}

Text colors

LabelCSS VariableSwatch
Default"" (empty, resets to default)currentColor
Grayvar(--blokhaus-text-gray)#9b9a97
Brownvar(--blokhaus-text-brown)#64473a
Orangevar(--blokhaus-text-orange)#d9730d
Yellowvar(--blokhaus-text-yellow)#dfab01
Greenvar(--blokhaus-text-green)#0f7b6c
Bluevar(--blokhaus-text-blue)#0b6e99
Purplevar(--blokhaus-text-purple)#6940a5
Pinkvar(--blokhaus-text-pink)#ad1a72
Redvar(--blokhaus-text-red)#e03e3e

Highlight colors

LabelCSS VariableSwatch
Default"" (empty, removes highlight)transparent
Grayvar(--blokhaus-highlight-gray)#ebeced
Brownvar(--blokhaus-highlight-brown)#e9e5e3
Orangevar(--blokhaus-highlight-orange)#faebdd
Yellowvar(--blokhaus-highlight-yellow)#fbf3db
Greenvar(--blokhaus-highlight-green)#ddedea
Bluevar(--blokhaus-highlight-blue)#ddebf1
Purplevar(--blokhaus-highlight-purple)#eae4f2
Pinkvar(--blokhaus-highlight-pink)#f4dfeb
Redvar(--blokhaus-highlight-red)#fbe4e4

Customizing

Override the palette by defining the CSS variables in your tokens.css file:

:root {
  --blokhaus-text-red: hsl(0 70% 50%);
  --blokhaus-highlight-red: hsl(0 70% 95%);
}

Or provide a completely custom palette to the ColorPicker component:

import { ColorPicker } from "@blokhaus/core";
import type { ColorPalette } from "@blokhaus/core";

const customPalette: ColorPalette = {
  text: [
    { label: "Default", value: "", swatch: "currentColor" },
    { label: "Brand", value: "var(--brand-color)", swatch: "#ff6600" },
  ],
  highlight: [
    { label: "Default", value: "", swatch: "transparent" },
    { label: "Brand Light", value: "var(--brand-bg)", swatch: "#fff3e6" },
  ],
};

<ColorPicker palette={customPalette} />;

DEFAULT_FONT_FAMILIES

The default font families available in the FontPicker dropdown. Contains four entries.

Type: FontFamilyEntry[]

interface FontFamilyEntry {
  label: string; // Human-readable label
  value: string; // CSS font-family value or empty string for default
  preview: string; // Font stack for rendering the preview text
}

Entries

LabelCSS ValuePreview Font
Default"" (empty, resets to default)var(--blokhaus-font-sans)
Serifvar(--blokhaus-font-serif)var(--blokhaus-font-serif)
Monovar(--blokhaus-font-mono)var(--blokhaus-font-mono)
Handvar(--blokhaus-font-hand)var(--blokhaus-font-hand)

Customizing

Define the font CSS variables in your tokens.css:

:root {
  --blokhaus-font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --blokhaus-font-serif: "Merriweather", ui-serif, Georgia, serif;
  --blokhaus-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --blokhaus-font-hand: "Caveat", cursive;
}

Or provide a custom list to the FontPicker:

import { FontPicker, DEFAULT_FONT_FAMILIES } from "@blokhaus/core";

const fonts = [
  ...DEFAULT_FONT_FAMILIES,
  {
    label: "Comic",
    value: '"Comic Sans MS", cursive',
    preview: '"Comic Sans MS", cursive',
  },
];

<FontPicker fonts={fonts} />;

DEFAULT_CALLOUT_PRESETS

The default callout color presets used by the CalloutPlugin. Contains six presets.

Type: CalloutPreset[]

interface CalloutPreset {
  id: string; // Unique ID for CSS classes and serialization
  label: string; // Human-readable label
  emoji: string; // Default emoji
  bgSwatch: string; // Background color for the picker dot
  borderSwatch: string; // Border color for the picker dot
}

Presets

IDLabelEmojiBackgroundBorder
defaultDefault💡#f1f1ef#d4d4d4
infoInfoℹ️#ddebf1#0b6e99
warningWarning⚠️#fbf3db#dfab01
errorError🚫#fbe4e4#e03e3e
successSuccess#ddedea#0f7b6c
purpleNote📝#eae4f2#6940a5

CSS variables

Each preset maps to CSS variables in tokens.css following the pattern:

:root {
  --blokhaus-callout-{id}-bg: {background};
  --blokhaus-callout-{id}-border: {border};
}

For example:

:root {
  --blokhaus-callout-info-bg: #ddebf1;
  --blokhaus-callout-info-border: #0b6e99;
  --blokhaus-callout-warning-bg: #fbf3db;
  --blokhaus-callout-warning-border: #dfab01;
}

Customizing

Override presets via the presets prop on CalloutPlugin:

import { CalloutPlugin, DEFAULT_CALLOUT_PRESETS } from "@blokhaus/core";
import type { CalloutPreset } from "@blokhaus/core";

const customPresets: CalloutPreset[] = [
  ...DEFAULT_CALLOUT_PRESETS,
  {
    id: "brand",
    label: "Brand",
    emoji: "\u{1F680}",
    bgSwatch: "#fff3e6",
    borderSwatch: "#ff6600",
  },
];

<CalloutPlugin presets={customPresets} />;

DEFAULT_EMOJIS

The default emoji list used by the EmojiPickerPlugin. Contains 100+ emojis with names and search keywords.

Type: EmojiItem[]

interface EmojiItem {
  emoji: string; // The emoji character
  name: string; // Machine-readable name (e.g., "grinning_face")
  keywords: string[]; // Search terms for filtering
}

Sample entries

[
  {
    emoji: "😀",
    name: "grinning_face",
    keywords: ["happy", "smile", "joy", "grin"],
  },
  {
    emoji: "😂",
    name: "face_with_tears_of_joy",
    keywords: ["laugh", "cry", "happy", "tears", "lol", "funny"],
  },
  {
    emoji: "🤔",
    name: "thinking_face",
    keywords: ["think", "hmm", "ponder", "consider", "wondering"],
  },
  {
    emoji: "❤️",
    name: "red_heart",
    keywords: ["love", "heart", "like", "romance"],
  },
  { emoji: "🔥", name: "fire", keywords: ["hot", "flame", "lit", "trending"] },
  // ... 100+ more entries
];

The list covers the most commonly used emojis across categories: faces, gestures, hearts, nature, food, activities, travel, objects, symbols, and flags.

Customizing

Override the emoji list via the emojis prop on EmojiPickerPlugin:

import { EmojiPickerPlugin, DEFAULT_EMOJIS } from "@blokhaus/core";
import type { EmojiItem } from "@blokhaus/core";

// Add custom emojis
const customEmojis: EmojiItem[] = [
  ...DEFAULT_EMOJIS,
  {
    emoji: "🦄",
    name: "unicorn",
    keywords: ["magic", "fantasy", "horse", "mythical"],
  },
];

<EmojiPickerPlugin emojis={customEmojis} maxResults={12} />;

Or provide a completely custom set:

const brandEmojis: EmojiItem[] = [
  { emoji: "🚀", name: "rocket", keywords: ["launch", "ship", "deploy"] },
  { emoji: "✅", name: "check", keywords: ["done", "complete", "success"] },
  { emoji: "⚠️", name: "warning", keywords: ["alert", "caution", "danger"] },
  { emoji: "🐛", name: "bug", keywords: ["bug", "issue", "error"] },
];

<EmojiPickerPlugin emojis={brandEmojis} />;

Search behavior

The emoji picker searches against both the name field and all entries in the keywords array. The search is case-insensitive and matches from the beginning of each term. For example, typing "hap" matches emojis with "happy" in their keywords.