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
| Label | CSS Variable | Swatch |
|---|---|---|
| Default | "" (empty, resets to default) | currentColor |
| Gray | var(--blokhaus-text-gray) | #9b9a97 |
| Brown | var(--blokhaus-text-brown) | #64473a |
| Orange | var(--blokhaus-text-orange) | #d9730d |
| Yellow | var(--blokhaus-text-yellow) | #dfab01 |
| Green | var(--blokhaus-text-green) | #0f7b6c |
| Blue | var(--blokhaus-text-blue) | #0b6e99 |
| Purple | var(--blokhaus-text-purple) | #6940a5 |
| Pink | var(--blokhaus-text-pink) | #ad1a72 |
| Red | var(--blokhaus-text-red) | #e03e3e |
Highlight colors
| Label | CSS Variable | Swatch |
|---|---|---|
| Default | "" (empty, removes highlight) | transparent |
| Gray | var(--blokhaus-highlight-gray) | #ebeced |
| Brown | var(--blokhaus-highlight-brown) | #e9e5e3 |
| Orange | var(--blokhaus-highlight-orange) | #faebdd |
| Yellow | var(--blokhaus-highlight-yellow) | #fbf3db |
| Green | var(--blokhaus-highlight-green) | #ddedea |
| Blue | var(--blokhaus-highlight-blue) | #ddebf1 |
| Purple | var(--blokhaus-highlight-purple) | #eae4f2 |
| Pink | var(--blokhaus-highlight-pink) | #f4dfeb |
| Red | var(--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
| Label | CSS Value | Preview Font |
|---|---|---|
| Default | "" (empty, resets to default) | var(--blokhaus-font-sans) |
| Serif | var(--blokhaus-font-serif) | var(--blokhaus-font-serif) |
| Mono | var(--blokhaus-font-mono) | var(--blokhaus-font-mono) |
| Hand | var(--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
| ID | Label | Emoji | Background | Border |
|---|---|---|---|---|
default | Default | 💡 | #f1f1ef | #d4d4d4 |
info | Info | ℹ️ | #ddebf1 | #0b6e99 |
warning | Warning | ⚠️ | #fbf3db | #dfab01 |
error | Error | 🚫 | #fbe4e4 | #e03e3e |
success | Success | ✅ | #ddedea | #0f7b6c |
purple | Note | 📝 | #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.
Related
- ColorPlugin -- Uses
DEFAULT_COLOR_PALETTE - FontPicker -- Uses
DEFAULT_FONT_FAMILIES - CalloutPlugin -- Uses
DEFAULT_CALLOUT_PRESETS - EmojiPickerPlugin -- Uses
DEFAULT_EMOJIS - Theming guide -- How to customize CSS variables