Theme
ore-styled ships a single theme object that holds every visual token it uses — spacing scale, font colors, and per-component texture paths plus sizing. Read from it when you want a custom screen to match the rest of the system.
Import
import { theme } from '@bedrock-core/ore-styled';
Top-level shape
theme = {
tokens: {
spacing: { xs, sm, md, lg, xl },
fontColor: { default, muted, danger, success, disabled },
},
components: {
button, card, checkbox, divider, header, menuRow, radio, tabs, toggle,
toggleButton, itemSlot, field, dropdown, form, slider,
},
}
Tokens
tokens.spacing
| Key | Value |
|---|---|
xs | 2 |
sm | 4 |
md | 8 |
lg | 12 |
xl | 16 |
Use these when setting gap, padding, or margin on custom panels so your layouts breathe at the same rhythm as the built-in components.
tokens.fontColor
| Key | Value (Minecraft format code) |
|---|---|
default | §f (white) |
muted | §7 (light gray) |
danger | §c (red) |
success | §a (green) |
disabled | §8 (dark gray) |
Prefix raw Text children with these for color consistency:
<Text>{`${theme.tokens.fontColor.muted}Subtitle copy`}</Text>
Components
Each entry under theme.components holds the textures, sizing, padding, and (where applicable) text styling for a single ore-styled component. The component reads from here directly, but you can read the same values to extend or reuse them.
button
padding: { x, y }variants: one entry perButtonvariant. Each variant hastextures(default,hover,pressed,disabled) and atextStyle(font,scale,color,disabledColor).
card
padding,gapvariants: one entry perCardvariant, each holdingtextures.background.
checkbox
size,gap, and a full set oftextures(unchecked/checked × default/hover/disabled).
divider
textures.horizontal.{default,light,dark}andtextures.vertical.{default,light,dark}.
header
padding,gap,iconSize— edge of the square back/close controls (px).textStyle:font,scale,color, andseparator— the color code for the>drawn between breadcrumb segments.textures:background, plusback/backHover/backPressedandclose/closeHover/closePressed— used byHeader.
menuRow
padding,gap,iconSize— edge of the row's leading thumbnail (px).textStyle:font,scale, and color codes forcolor/disabledColor(title) andmuted/mutedDisabled(subtitle).textures:background/backgroundHover/backgroundPressed/backgroundSelected— the dropdown-option face reused byMenuRow.
radio
size,gap, and a full set oftextures(unselected/selected × default/hover/disabled).
Radio reuses this same section — there's no separate Form-specific radio theme.
tabs
height,paddingX,selectedDrop,textures(normal,hover,pressed,disabled,disabledPressed), andtextStyle:font,scale, and a colour per state as RGB in 0..1 (selected,unselected,disabled).
Tabs reads this section. Its values and its textures under textures/ui/ore-styled/tabs started as copies of the toggleButton section's.
toggle
width,height, fulltexturesset (off/on × default/hover/disabled).
toggleButton
height,paddingX,selectedDrop(how far a chosen segment's label sits lower),textures(normal,hover,pressed,disabled,disabledPressed), andtextStyle:font,scale, and a colour per state as RGB in 0..1 (selected,unselected,disabled).
ToggleButtons reads this section in both of its modes.
field
padding: { top, bottom, x },gap.textStyle:font,scale, and color codes forvalue/placeholder/disabledtext.textures.{background,backgroundHover,backgroundDisabled}— theInput/Inputfield box.
dropdown
padding: { top, bottom, x },arrow: { width, height }.textStyle:font,scale, and color codes forvalue/disabledtext.textures:background/backgroundHover/backgroundDisabled(closed box),arrow/arrowDisabled, andpopup/option/optionHover/optionSelected— used byDropdown/Dropdown.
form
labelGap— vertical gap (px) between a field's label and its control.labelStyle:font,scale,color,disabledColor— the caption style everyForm.*field composes itslabelwith.
slider
height,trackHeight,thumb: { width, height }.textStyle:font,scale, and color codes forvalue/disabledtext.textures:track/trackDisabled,progress/progressDisabled,thumb/thumbHover/thumbDisabled— used bySlider/Slider.
Types
import type { OreTheme, ButtonTextStyle } from '@bedrock-core/ore-styled';
OreTheme— the full theme shape.ButtonTextStyle—{ font, scale, color, disabledColor }, the shape used inside the button variants.
Example: reusing the spacing scale
import { theme } from '@bedrock-core/ore-styled';
<Panel padding={theme.tokens.spacing.md} gap={theme.tokens.spacing.sm}>
<Text>{`${theme.tokens.fontColor.default}Title`}</Text>
<Text>{`${theme.tokens.fontColor.muted}Subtitle`}</Text>
</Panel>